Subject | Re: [ib-support] setNull doesn't work |
---|---|
Author | Martijn Tonies |
Post date | 2002-07-29T06:58:52Z |
Hi,
select * from xsysapps where DETRANSFER = NULL
and
select * from xsysapps where DETRANSFER is null
The first one will never return any rows -- NULL = NULL will
always evaluate into False.
The latter is the only way to check for NULL.
Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com
Upscene Productions
http://www.upscene.com
"This is an object-oriented system.
If we change anything, the users object."
> I've a problem with interbase or interclient.Notice the two different statements:
> I've wrote this source
> ...
> String select = "select * from xsysapps where DETRANSFER = ?";
select * from xsysapps where DETRANSFER = NULL
and
select * from xsysapps where DETRANSFER is null
The first one will never return any rows -- NULL = NULL will
always evaluate into False.
The latter is the only way to check for NULL.
Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com
Upscene Productions
http://www.upscene.com
"This is an object-oriented system.
If we change anything, the users object."
> PreparedStatement ps = this.con.prepareStatement(select);null"
> ps.setNull(1, Types.DATE);
> ResultSet rs = ps.executeQuery();
> int i = 0;
> while(rs.next())
> i++;
> System.out.println(i);
> ...
> where all rows have DETRANSFER column to null.
> The output of i is 0
> if i change the select in "select * from xsysapps where DETRANSFER is
> The query propertly work
>
> Help me