The DB2Dialect class overrides Dialect.getCurrentTimestampSQLFunctionName() to return "sysdate". However, DB2 supports the standard "current_timestamp" value, not the new value, which appears to be from Oracle:
db2 => select sysdate from sysibm.sysdummy1
SQL0206N "SYSDATE" is not valid in the context where it is used.
db2 => select current_timestamp from sysibm.sysdummy1
1 record(s) selected.
It looks to me like the method should be removed from the DB2Dialect class.
Hibernate 3.1.3, DB2 UDB Express-C 8.1 on Windows XP Professional SP2
Here is the patch for getCurrentTimestampSQLFunctionName with DB2Dialect class, patch created from version 3.2.5 of Hibernate.
It would be nice from you to include it in next release.
It is a blocking issue for me since I am using it to be portable accross 3 DB for a Query that cannot be written in HQL.
Still present in 3.2.5.
Not working either on DB2 9
trunk / 3.2
Bulk closing stale resolved issues