Null behavior change from ODBC 3.0 to 3.6 
Author Message
 Null behavior change from ODBC 3.0 to 3.6

Hi folks,

we're using VB5, SQL Server 6.5 and RDO 2.0; just updated some clients from
ODBC 3.0 to ODBC 3.6.
We noticed that our apps do not return correct/complete data anymore. The
reason is a changed behavior on cheking for Null values.

The affected SQL statements got sth. like SELECT ...... WHERE col1=Null...
If I change the WHERE clause to use the IS Null operator instead, then the
data is returned correctly.

We did NOT change any settings on the SQL Server.

Does anyone know the reason for this?

Is there any solution or workaround other than rewriting all my SQL
statements?

Thanks for your help.

Andreas Roth (Selters, Germany)




Tue, 05 Feb 2002 03:00:00 GMT  
 Null behavior change from ODBC 3.0 to 3.6


Quote:
> Hi folks,

> we're using VB5, SQL Server 6.5 and RDO 2.0;

just updated some clients from
Quote:
> ODBC 3.0 to ODBC 3.6.
> We noticed that our apps do not return

correct/complete data anymore. The
Quote:
> reason is a changed behavior on cheking for
Null values.

> The affected SQL statements got sth. like

SELECT ...... WHERE col1=Null...
Quote:
> If I change the WHERE clause to use the IS Null

operator instead, then the
Quote:
> data is returned correctly.

> We did NOT change any settings on the SQL
Server.

> Does anyone know the reason for this?

> Is there any solution or workaround other than

rewriting all my SQL
Quote:
> statements?

> Thanks for your help.

> Andreas Roth (Selters, Germany)



I'm not sure why you'd be getting differences
when changing the ODBC drivers.   However, based
upon SQL documentation, which is consistent with
my experience, col1=Null should always yield
FALSE regardless of your ODBC driver.  Null is
undefined so any comparison to a value that is
undefined will always yield FALSE.  Using IS NULL
or IS NOT NULL is the way to go.

Stan Tierney (Phoenix, AZ)


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



Fri, 08 Feb 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. DAO 3.51 to DAO 3.6 NULLs question

2. CR6 Problem w SQL Server ODBC driver 3.6?

3. DAO 3.6 changes from 3.5

4. Change DAO3.5/3.6 reference while runtime?

5. Changing Field Properties via ADO 3.6

6. Changing Field Properties via DAO 3.6

7. Changing Field Properties via DAO 3.6

8. IS NULL vs = NULL - ODBC Drivers

9. ODBC Error: Oracle7.2, ODBC, VB4.0, DAO, Jet 3.0

10. NULL Concatenation Behavior

11. dao 3.6 reference lost on closing database

12. DAO 3.6 bookmark problem

 

 
Powered by phpBB® Forum Software