pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: angg <angg@vng.ru>
To: byronn@insightdist.com
Cc: pgsql-interfaces@hub.org
Subject: [INTERFACES] C++ Builder (Delphi), ODBC and large objects
Date: Fri, 23 Oct 1998 07:38:30 +0500
Message-ID: <01bdfe2e$3848fca0$0b02a8c0@mis1> (raw)

21.10.1998 Byron Nikolaidis wrote:

>Please send me the psqlodbc.log files showing both the "0-value" error and
the
>"couldn't open large object for reading".

I have type 'lo' created
CREATE TYPE lo (
  internallength=4,
  externallength=10,
  input=int4in,
  output=int4out,
  default='',
  passedbyvalue
);
as it is recomended in
http://www.insightdist.com/psqlodbc/psqlodbc_faq.html#largeobjects

and a table
CREATE TABLE tmp_rq (
  req_id      int2,
  req_content lo
);
I manually (to simplify debugging) insert record with req_id = 1.
In my application I have an SQL (RequestLive),
SELECT req_id, req_content FROM tmp_rq WHERE req_id = 1;
It  binded to TDBRichEdit (TDBMemo) component.

I run the application, write text (long) to the large object field
fromTDBRichEdit, and exit.
I'm attaching psqlodbc.log file renaming it to WriteData.log

Then run the application again try to read data from large object field by
TDBRichEdit (nothing is showed), and exit.
This time I renamed psqlodbc.log file to ReadAfterWriteData.log

I can see there are some information you don't need, but I decided to leave
the files as is not to remove something valuable by ignorance.

>Also, send the odbc trace log files (sql.log) as well showing the results
of
>both the read and write attempts.  Make sure the log file is clean before
you begin.

In both cases described above sql.log file was emty. To try to get the files
I did the following:

In MS 32-bit ODBC I checked
"All the time" ("When to trace" on "Tracing" page)" and press "Start tracing
Now" button.
In ODBC Administrator (PostOdbc driver) I set Trace mode = 0x0040

Here is quoting from "ODBC driver connection settings" help:
TRACE MODE A numeric value (bit mask) specifying how much trace information
to log. The Windows OutputDebugString call is used to output the requested
information to the debug window. The following table shows which information
is logged based on bit settings:
Bit Settings Logged Information
0x0001 prepared query statement
0x0002 executed query statements
0x0004 vendor errors
0x0008 statement options (that is: allocate, free)
0x0010 connect / disconnect
0x0020 transaction
0x0040 BLOB I/O
0x0080 miscellaneous
0x0100 vendor calls

But I do get 488 KB sql.log file when I create large object.
I'm not attaching it because I don't know whether you need it. If you do
I'll send it too.

I got a message from Sergey E. Levov <serg@informika.ru>
he writes:
>If you have sources try the follwing:
>Find the string
>       if (pcbValue && *pcbValue <= SQL_LEN_DATA_AT_EXEC_OFFSET)
>in the file bind.c and change it into
>       if (pcbValue && ((*pcbValue <= SQL_LEN_DATA_AT_EXEC_OFFSET) ||
>                        (*pcbValue == SQL_DATA_AT_EXEC)))
>and rebuild the driver. Perhaps it help.

I downloaded sources from www.insightdist.com/psqlodbc.
Unfortunatelly I need MS Visual C++ 4.0 to rebuild the driver which I
haven't. I am seeking an opportunity to do the job now.


Thank you, Mikhail.

Attachments:

  WrteData.log (application/octet-stream, 15.8K) download

  ReadAfterWriteData.log (application/octet-stream, 17.6K) download

view thread (19+ messages)  latest in thread

Message-ID: <01bdfe2e$3848fca0$0b02a8c0@mis1>
Permalink:  ../01bdfe2e$3848fca0$0b02a8c0@mis1/
Also on:    postgresql.org/message-id/01bdfe2e$3848fca0$0b02a8c0@mis1

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: angg@vng.ru, byronn@insightdist.com, pgsql-interfaces@hub.org
  Subject: Re: [INTERFACES] C++ Builder (Delphi), ODBC and large objects
  In-Reply-To: <01bdfe2e$3848fca0$0b02a8c0@mis1>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox