db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael J. Segel" <mse...@segel.com>
Subject Re: Select and null problem
Date Wed, 26 Oct 2005 21:56:22 GMT
On Wednesday 26 October 2005 15:06, Nicolas Dufour wrote:
> Hi
> I m trying to do a pretty simple insert :
> insert into foo (fields ........) select value1, value2,  ....,  field3,
> field5 from foo where id = x
> Everything work until when a value is equal to NULL, i have this message :
> error: Encountered "null" at line ....
> Ok sql has seen a null well good for it ... but why its an error !?
> Thanks
> Nicolas Dufour

I guess there's a couple of ways of looking at your question.
Are you saying that you're using a prepared statement and the value x is a 

That you then get in to trouble when x is a NULL?

If so you can't use x=NULL. I guess in simple terms you have two different 
data types. (NULL has a special meaning).

For NULL, you have to use the IS NULL syntax.

Or am I missing something?

Michael Segel
(312) 952-8175

View raw message