[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-1753) DB2Dialect.getCurrentTimestampSQLFunctionName() uses Oracle syntax

Philippe Mouawad (JIRA) noreply at atlassian.com
Fri Nov 2 09:30:29 EDT 2007


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Philippe Mouawad updated HHH-1753:
----------------------------------

    Attachment: patch-db2dialect-currentTime.txt

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

> DB2Dialect.getCurrentTimestampSQLFunctionName() uses Oracle syntax
> ------------------------------------------------------------------
>
>                 Key: HHH-1753
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1753
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.1.3
>         Environment: Hibernate 3.1.3, DB2 UDB Express-C 8.1 on Windows XP Professional SP2
>            Reporter: Carey Evans
>            Priority: Minor
>         Attachments: patch-db2dialect-currentTime.txt
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list