Skip to Content.
Sympa Menu

freetds - select with NULL in where-clause doesnt work

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Hans Lang" <hal AT mmg.de>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: select with NULL in where-clause doesnt work
  • Date: Fri, 11 Oct 2002 15:52:50 -0400


Hi,

i am using freetds 0.60 with php 4.2.3 on Intel-Linux P4, 1.8Ghz.
The SQL-Server is a MS SQL 7.0 Server, running on an PIII, 1Ghz.

the problem i have is that i can't select records that have a NULL in a
DATETIME-field.

For example the value of "ausgeschieden", which is a DATETIME, in the
record with ID=315 :

1> select ausgeschieden from personal_adresse where id=315
2> go
ausgeschieden
NULL

this is fine, ID 315 isnt "ausgeschieden" yet.

Looking up for that record results in an empty set:
1> select id from personal_adresse where ausgeschieden=NULL
2> go

This is mysterious. Where is at least ID=315?

DATETIME's with Values behave as they should:
1> select count(ID) from personal_adresse where ausgeschieden<getdate();
2> go

197

or

1> select id from personal_adresse where ausgeschieden>getdate();
2> go
id
456

or

1> select ID from personal_adresse where ausgeschieden='Mar 31 2001
12:00AM';
2> go
ID
42
309
58
187
266
268
278
319



so what the hell is wrong with those NULLs here?
running the same selects with the sybase-libs does work. no wonder, they
are obviously right.

what can i do to make them run with freetds as well?



hopefully,
hans




Archive powered by MHonArc 2.6.24.

Top of Page