You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Vincenz Braun <vb...@evelox.de> on 2004/06/25 02:09:20 UTC

Oracle Null value for prepared select statement

Hi,

 

I am using an OQLQuery with a parameter that is nullable.

 

e.g. "Select all from class1 where field2 = $1 and field3 = ?2"

 

The underlying JDBCImpl uses a PreparedStatement and sets

this parameter to null (with setNull(..). 

 

e.g "select column1, column2, column3 from table1 where column2 = ? and
column3 = ?"

ps.setNull(2, Types.NUMERIC);

 

Under oracle the result set is always empty. I tried to change the OQLQery

to use field3 = NIL with no success.

 

Is there any way to get the correct result set when binding null values and

Using Oracle 9i?

 

Thanks,

Vincenz