db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Dufour <nicolas.duf...@neometsys.fr>
Subject Re: select null - 2nd edition :)
Date Fri, 28 Oct 2005 15:18:18 GMT
Great it works perfectly !

Is this cast a part of  SQL Standard ?

Thanks

Nicolas

Satheesh Bandaram wrote:
> 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.
>
> Satheesh
>
> ij> create table tnull (i int, j int, k int);
> 0 rows inserted/updated/deleted
> ij> insert into tnull values (1,2,3);
> 1 row inserted/updated/deleted
> ij> insert into tnull select i, j, null from 
> tnull;                                     <===== Raises error, like 
> you said
> ERROR 42X01: Syntax error: Encountered "null" at line 1, column 32.
> ij> insert into tnull select i, j, *cast(null as int)* from 
> tnull;                     <===== Works fine!
> 1 row inserted/updated/deleted
>
> Nicolas Dufour wrote:
>> 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 ?
>>
>> Thanks
>>
>> Nicolas


Mime
View raw message