NUMTODSINTERVAL

NUMTODSINTERVAL converts the number x to an INTERVAL DAY TO SECOND. The format of the function is:

numtodsinterval( number, expression )

number is the number to convert to an interval. expression is the unit. It must be one of the following values: DAY, HOUR, MINUTE, or SECOND.


SQL> select numtodsinterval(10, 'DAY') from dual;

NUMTODSINTERVAL(10,'DAY')
---------------------------------------------------------------------------
+000000010 00:00:00.000000000

SQL> select numtodsinterval(100, 'HOUR') from dual;

NUMTODSINTERVAL(100,'HOUR')
---------------------------------------------------------------------------
+000000004 04:00:00.000000000

SQL> select numtodsinterval(1000, 'MINUTE') from dual;

NUMTODSINTERVAL(1000,'MINUTE')
---------------------------------------------------------------------------
+000000000 16:40:00.000000000

SQL> select numtodsinterval(10000, 'SECOND') from dual;

NUMTODSINTERVAL(10000,'SECOND')
---------------------------------------------------------------------------
+000000000 02:46:40.000000000

SQL>
Home »
Oracle »
Conversion Functions » 

Related: