Subject Query : Numeric NULL value in where clause - usage?
Author karthick srini
Dear Members,

I have an nullable numeric column having null values.


Consider below query and out put ,

QL> select * from A3;

ID DATA STRD
=========== ============ ==========

4 <null> kk
3 <null> <null>
2 2 bbb
1 1 aa
5 5 <null>

SQL> show table a3;
ID INTEGER Not Null
DATA INTEGER Nullable
STRD VARCHAR(10) Nullable
CONSTRAINT INTEG_736:
Primary key (ID)


I like to select some data with 'IN' in where clause
fro numeric column ,
SQL> select * from A3 where DATA IN(2,1,NULL);
Statement failed, SQLCODE = -104

Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, char 36
-NULL
SQL>

I get an error as given above. If I give NULL with in
quotes I get error
-conversion error from string "NULL"

Even below query fails,
select * from A3 where DATA=(null);

Please do help me , how to handle numeric NULL value
in where clause.

S.Karthick



_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com