Skip site navigation (1) Skip section navigation (2)

[INTERFACES] C++ Builder (Delphi), ODBC and large objects

From: "angg" <angg(at)vng(dot)ru>
To: <byronn(at)insightdist(dot)com>
Cc: <pgsql-interfaces(at)hub(dot)org>
Subject: [INTERFACES] C++ Builder (Delphi), ODBC and large objects
Date: 1998-10-22 07:01:52
Message-ID: 01bdfd89$d8d61ea0$0b02a8c0@mis1 (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
21.10.1998 Byron Nikolaidis wrote:

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

I have type 'lo' created
as it is recomended in

and a table
  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
>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(at)informika(dot)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
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.

Attachment: WrteData.log
Description: application/octet-stream (15.8 KB)
Attachment: ReadAfterWriteData.log
Description: application/octet-stream (17.6 KB)

pgsql-interfaces by date

Next:From: Andrzej SzydloDate: 1998-10-22 07:03:43
Subject: Re: [INTERFACES] C++ Builder (Delphi), ODBC and large objects
Previous:From: anggDate: 1998-10-22 06:00:32
Subject: [INTERFACES] C++ Builder (Delphi), ODBC and large objects

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group