Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2014

    Unanswered: DB2 V9.7 - Default date format problem

    The registry variable DB2_COMPATIBILITY_VECTOR is set to "ORA",and the
    db cfg parameter "date_compat"(Date compatibility) is enabled. So when I issue the following SQL statements, "current date" is transformed to timestamp format (Oracle-like format).
    My question is: What is the equivalent parameter of NLS_DATE_FORMAT available in Oracle for DB2 ? And how to set a session level date format by using NLS_DATE_FORMAT ?

    db2 "select current date from sysibm.dual"
    SQL Result

    db2 "select current date from sysibm.sysdummy1"
    SQL Result

    Wanted SQL Result

    Thanks in advance

  2. #2
    Join Date
    Apr 2012
    Provided Answers: 25
    The format is determined by the locale for the client application (which in turn depends in part on the operating system, or client functionality). If you want a DATE in this context (and not a timestamp) then either use DATE(column-name) in the SQL or reconsider if date_compat is essential.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts