db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <Richard.Hille...@Sun.COM>
Subject Re: problem with cast (null as int)
Date Mon, 03 Aug 2009 13:16:46 GMT
Hi Eranda,

I am unable to reproduce this problem using ij against the trunk. The 
following script runs correctly for me:

connect 'jdbc:derby:memory:temp;create=true';

values ( cast ( 1.5 as int ) );
values ( cast ( null as int ) );

values ( 3, cast ( 1.5 as int ) );
values ( 3, cast ( null as int ) );

Regards,
-Rick

Eranda Sooriyabandara wrote:
> Hi,
>
> There is a problem with 
> rs = st.executeQuery(
>             "values (3, cast (null as int))");
> And it gave the error
> Exception in thread "main" java.sql.SQLDataException: An attempt was 
> made to get a data value of type 'INTEGER' from a data value of type 
> 'null'.
>
> Are there any reasons for this error occurring?
> Thanks
> Eranda


Mime
View raw message