db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernt M. Johnsen" <Bernt.John...@Sun.COM>
Subject Re: NULL checking in Derby
Date Wed, 31 Oct 2007 08:48:14 GMT
Hi,

>>>>>>>>>>>> Soumen Saha wrote (2007-10-26 22:36:19):
> DELETE FROM QUIZ_OPTIONS_INFO WHERE OPTION_TEXT IN ('',null);
> 

This statement is strictly not allowed in SQL since the data type of
null is not determinable. You should write something like

DELETE FROM QUIZ_OPTIONS_INFO WHERE OPTION_TEXT IN ('',CAST(null AS VARCHAR(10)));


> This is working in SQL Server but not in Derby... The error is Error code
> -1, SQL state 42X01: Syntax error: Encountered "NULL" . Could some one
> please tell the solution... My aim is to delete all the rows where the
> OPTION_TEXT is empty..
> 
> Thanks & Regards,
> Soumen

-- 
Bernt Marius Johnsen, Database Technology Group, 
Staff Engineer, Derby/Java DB
Sun Microsystems, Trondheim, Norway

Mime
View raw message