Re: New libpq based driver snapshot 08.01.0003 available - Mailing list pgsql-odbc

From Zoltan Boszormenyi
Subject Re: New libpq based driver snapshot 08.01.0003 available
Date
Msg-id 42F2413B.8040906@dunaweb.hu
Whole thread Raw
In response to Re: New libpq based driver snapshot 08.01.0003 available  ("Dave Page" <dpage@vale-housing.co.uk>)
List pgsql-odbc
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

pgsql-odbc by date:

Previous
From: "Alejandro D. Burne"
Date:
Subject: Re: Usind database with encoding UNICODE and vovel
Next
From: Josef Springer
Date:
Subject: Re: Usind database with encoding UNICODE and vovel