Thread: Errors with nulls thru ODBC

Errors with nulls thru ODBC

From
"Johann Zuschlag"
Date:
Hi,
 
I found a funny behavior using psqlodbc (07.01.0009) with PostgeSQL 7.1.3. An application shows eratic results in columns with smallint and int when there is no value defined, i.e. null, unknown. Sometimes I get a 1, 3, 5, 0, or nothing (smallint).
 
The app is just doing a simple SELECT. There is no =null or similiar. I went thru all mails concerning null, isnull etc. I guess the problem is with the driver, not with postgreSQL. If I compare the same app with MSSQL I get the correct results, i.e. nothing. ;-)
 
Maybe the app is not well programmed. But why does it work with MSSQL? In the MS-ODBC driver there is a tag at ANSI-NULLS. So what? It should behave same.
 
Ok, for sure I can solve it with a default value. But I have to go thru more than 100 tables with up to 50 columns.
 
Maybe there is a simple answer for that. Any ideas? How does the driver report back nulls?
 
regards
 
Johann Zuschlag
 

Re: Errors with nulls thru ODBC

From
Hiroshi Inoue
Date:
> Johann Zuschlag wrote:
>
> Hi,
>
> I found a funny behavior using psqlodbc (07.01.0009) with PostgeSQL
> 7.1.3. An application shows eratic results in columns with smallint
> and int when there is no value defined, i.e. null, unknown. Sometimes
> I get a 1, 3, 5, 0, or nothing (smallint).
>
> The app is just doing a simple SELECT. There is no =null or similiar.
> I went thru all mails concerning null, isnull etc. I guess the problem
> is with the driver, not with postgreSQL. If I compare the same app
> with MSSQL I get the correct results, i.e. nothing. ;-)

Could you send me the Mylog output ?

regards,
Hiroshi Inoue