DB2Dialect.getCurrentTimestampSQLFunctionName() uses Oracle syntax

Description

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.
SQLSTATE=42703
db2 => select current_timestamp from sysibm.sysdummy1

1
-------------------------- 2006-05-16-13.13.47.625000

1 record(s) selected.

It looks to me like the method should be removed from the DB2Dialect class.

Environment

Hibernate 3.1.3, DB2 UDB Express-C 8.1 on Windows XP Professional SP2

Activity

Show:
Philippe Mouawad
November 2, 2007, 3:29 PM

Hello,
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.

Philippe
www.ubik-ingenierie.com

Philippe Mouawad
November 2, 2007, 3:34 PM

Still present in 3.2.5.
Not working either on DB2 9

Steve Ebersole
November 2, 2007, 4:47 PM

trunk / 3.2

Steve Ebersole
March 21, 2011, 7:05 PM

Bulk closing stale resolved issues

Assignee

Steve Ebersole

Reporter

Former user

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Minor
Configure