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.
nivanov1 100000H9H722 Posts
Re: interval DAY TO SECND(3)2013-03-22T14:01:52ZThis is the accepted answer. This is the accepted answer.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 270002FA078 Posts
Re: interval DAY TO SECND(3)2013-03-26T11:09:10ZThis is the accepted answer. This is the accepted answer.
- nivanov1 100000H9H7
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.