From: Zoltan Boszormenyi <zboszor@dunaweb.hu>
To: Dave Page <dpage@vale-housing.co.uk>
Cc: pgsql-odbc@postgresql.org
Subject: Re: New libpq based driver snapshot 08.01.0003 available
Date: Thu, 04 Aug 2005 18:24:27 +0200
Message-ID: <42F2413B.8040906@dunaweb.hu> (raw)
In-Reply-To: <E7F85A1B5FF8D44C8A1AF6885BC9A0E4AC97A9@ratbert.vale-housing.co.uk>
References: <E7F85A1B5FF8D44C8A1AF6885BC9A0E4AC97A9@ratbert.vale-housing.co.uk>
Dave Page írta:
>
>>-----Original Message-----
>>From: Zoltan Boszormenyi [mailto:zboszor@dunaweb.hu]
>>Sent: 03 August 2005 19:08
>>To: Dave Page
>>Cc: pgsql-odbc@postgresql.org
>>Subject: Re: [ODBC] New libpq based driver snapshot
>>08.01.0003 available
>>
>>I got these on compiling the latest CVS
>>using the RedHat RawHide src.rpm environment:
>
>
> <snip>
>
>>You guessed right, 64 bit system, FC3/x86-64.
>
>
> Well, I guessed 64 bit at least :-) I have an x86-64 FC4 box kicking
> around so I'll look into this.
>
>
>>I used NULL as the last parameter of SQLBindCol() for every fields
>>meaning I don't care to be notified about NULL values.
>>
>>Last thing I tried was to use 3 SQLINTEGER for the 3 fields that may
>>have NULL values and use &null_val1, etc. as the last parameter
>>for SQLBindCol(). And it finally fixed it, I get all the rows that
>>e.g. psql produce for the same query.
>>
>>I looked quickly at the sources and copy_and_convert_field() in
>>convert.c has this at line 481:
>>
>>-----------------------------------------------
>> if (!value)
>> {
>> /*
>> * handle a null just by returning SQL_NULL_DATA in
>>pcbValue, and
>> * doing nothing to the buffer.
>> */
>> if (pcbValue)
>> {
>> *((SDWORD *) pcbValueBindRow) =
>>SQL_NULL_DATA;
>> return COPY_OK;
>> }
>> else
>> {
>> SC_set_error(stmt,
>>STMT_RETURN_NULL_WITHOUT_INDICATOR, "StrLen_or_IndPtr was a
>>null pointer
>>and NULL data was retrieved");
>> SC_log_error(func, "", stmt);
>> return SQL_ERROR;
>> }
>> }
>>-----------------------------------------------
>
>
> This is correct from my reading of the spec - specifically, it says:
>
> "If StrLen_or_IndPtr is a null pointer, no length or indicator value is
> used. This is an error when fetching data and the data is NULL."
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/ht
> m/odbcsqlbindcol.asp
>
> Regards, Dave
I checked it on our company Informix server (9.21), ODBC driver version:
Informix 3.80.00.10841, released on 2001.04.20. It behaves exactly like
the older PsqlODBC versions, as it does not bother when NULL fields are
passed to the application and SQLBincol(..., NULL) was used.
I remember the same behaviour when I took my database course at the
university in 1993 or '94, an Oracle server was accessed via ODBC
from VC++ (3.x?) application.
And as I said, the wording for the same in ODBC 3.5 Developers Guide
is less strict, and there exist more ODBC drivers that don't handle
this condition as an error. There may be legacy applications where
the same behaviour is expected.
However, PowerBuilder 8.0 seems to work with PsqlODBC-8.01.0003
with my limited testing.
Best regards,
Zoltán Böszörményi
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: zboszor@dunaweb.hu, dpage@vale-housing.co.uk
Subject: Re: New libpq based driver snapshot 08.01.0003 available
In-Reply-To: <42F2413B.8040906@dunaweb.hu>
References: <E7F85A1B5FF8D44C8A1AF6885BC9A0E4AC97A9@ratbert.vale-housing.co.uk> <42F2413B.8040906@dunaweb.hu>
* 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