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.
This topic has been locked.
2 replies Latest Post - 2013-03-26T11:09:10Z by juchin
Pinned topic interval DAY TO SECND(3)
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2013-03-26T11:09:10Z at 2013-03-26T11:09:10Z by juchin
nivanov1 100000H9H722 PostsACCEPTED ANSWER
Re: interval DAY TO SECND(3)2013-03-22T14:01:52Z in response to juchinThe 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 270002FA078 PostsACCEPTED ANSWER
Re: interval DAY TO SECND(3)2013-03-26T11:09:10Z in response to nivanov1Thank 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.