Topic
2 replies Latest Post - ‏2013-03-26T11:09:10Z by juchin
juchin
juchin
8 Posts
ACCEPTED ANSWER

Pinned topic interval DAY TO SECND(3)

‏2013-03-22T08:31:39Z |
We have many SQLs with interval DAY TO SECOND(3) on Oracle. We are migarating DB2 from Oracle and these SQLs need to run on DB2. However, DB2 does not have DAY TO SECOND(3) function.
How should we modify SQLs to implement DAY TO SECOND(3)?
Thank you for your advice in advance.

Handa
Updated on 2013-03-26T11:09:10Z at 2013-03-26T11:09:10Z by juchin
  • nivanov1
    nivanov1
    22 Posts
    ACCEPTED ANSWER

    Re: interval DAY TO SECND(3)

    ‏2013-03-22T14:01:52Z  in response to juchin
    The answer depends on whether your DB2 database is in the Oracle compatibility mode or not.

    In a standard (not Oracle-compatible) DB2 database time duration is a decimal number in the form HHMMSS (for more details http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.sql.ref.doc/doc/r0023457.html)

    In an Oracle-compatible DB2 database all datetime arithmetic operations follow Oracle semantics, that is, the duration will be a DECFLOAT value containing the number of days (or fractions of a day) between the two datetime values.
    • juchin
      juchin
      8 Posts
      ACCEPTED ANSWER

      Re: interval DAY TO SECND(3)

      ‏2013-03-26T11:09:10Z  in response to nivanov1
      Thank you for your help so much.
      What SQL should we execute to get "interval DAY TO SECOND(3)"?
      We don't know SQL function instead of DAY TO SECOND(3) in Oracle.
      We are migrating DB2 with Oracle compatibility mode.

      Handa