db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas McKiernan" <Thomas.McKier...@GroupNBT.com>
Subject sysdate on derby?
Date Wed, 11 Feb 2009 13:47:35 GMT
Hi all,


Perhaps someone can help me.


I am currently adding a unit test framework to some existing code.

In production, the code uses Oracle DB and the JDBC SQL statements make
extensive use of Oracle's "SYSDATE'.


For various reasons we are trying to use Derby instances when unit
testing the code. 

Obviously we would expect there to be some differences between the two
DBs and the main one for us seems to be that Derby does not understand
the SYSDATE function - we see the following error when performing
'update some_table set...some_column=SYSDATE'...where...:


java.sql.SQLSyntaxErrorException: Column 'SYSDATE' is either not in any
table in the FROM list or appears within a join specification and is
outside the scope of the join specification or appears in a HAVING
clause and is not in the GROUP BY list. If this is a CREATE or ALTER
TABLE  statement then 'SYSDATE' is not a column in the target table.



I do not want to refactor the existing code *if* it can be helped.

Is there a way I can get Derby to understand SYSDATE in a similar
fashion to Oracle? Or a neat trick I can do so that the SQL statements
stay more-or-less the same?


Many thanks,




Thomas McKiernan 
Java Developer, GroupNBT plc
T: +44 (0)20 7015 9292
F: +44 (0)20 7015 9365
thomas.mckiernan@groupnbt.com <mailto:thomas.mckiernan@groupnbt.com> 
Group NBT plc



"The information in this Internet E-Mail is confidential and may be
legally privileged.
It is intended solely for the addressee.
Access to this Internet E-Mail by anyone else is unauthorised.
If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on
it, is prohibited and may be unlawful."

Group NBT plc, 3rd floor, Prospero House, 241 Borough High Street,
London SE1 1GA
Group NBT plc is registered in England No: 370 9856

Please consider the environment before printing this e-mail. 



View raw message