Subject Re: [ib-support] setNull doesn't work
Author Martijn Tonies
Hi,

> I've a problem with interbase or interclient.
> I've wrote this source
> ...
> String select = "select * from xsysapps where DETRANSFER = ?";

Notice the two different statements:

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);
> 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
null"
> The query propertly work
>
> Help me