db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Satheesh Bandaram <sathe...@Sourcery.Org>
Subject Re: select null - 2nd edition :)
Date Thu, 27 Oct 2005 17:04:47 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
I am not sure what SQL standard says about NULLs in this context, but
if you can CAST your untyped null to the type you are inserting to, it
works with Derby.<br>
ij&gt; create table tnull (i int, j int, k int);<br>
0 rows inserted/updated/deleted<br>
ij&gt; insert into tnull values (1,2,3);<br>
1 row inserted/updated/deleted<br>
ij&gt; insert into tnull select i, j, null from
&lt;===== Raises error, like
you said<br>
ERROR 42X01: Syntax error: Encountered "null" at line 1, column 32.<br>
ij&gt; insert into tnull select i, j, <b>cast(null as int)</b> from
&lt;===== Works fine!<br>
1 row inserted/updated/deleted<br>
Nicolas Dufour wrote:
<blockquote cite="mid4360F098.6050704@neometsys.fr" type="cite">Hi
I have talked with users of other bases and it seems that the statement
select null from table is standard and should work.
So now why i doesn't work on Derby ? not yet implemented ?

View raw message