Oracle Date/Time Function - Oracle/PLSQL TO_DSINTERVAL Function






This Oracle tutorial explains how to use the Oracle/PLSQL TO_DSINTERVAL function.

TO_DSINTERVAL converts the string x to an INTERVAL DAY TO SECOND.

Syntax

The syntax for the Oracle/PLSQL TO_DSINTERVAL function is:

TO_DSINTERVAL( character [ nls_parameter ] )

character is the value to convert to an INTERVAL DAY TO SECOND type. It can be a char, varchar2, nchar, or nvarchar2 value.

nls_parameter is a decimal character and group separator value.

Example


SQL> select to_dsinterval('15 09:30:00') from dual;
--  w w w. java 2  s.c om
TO_DSINTERVAL('1509:30:00')
-------------------------------------------------------------
+000000015 09:30:00.000000000

SQL> select to_dsinterval('80 13:30:00') from dual;

TO_DSINTERVAL('8013:30:00')
-------------------------------------------------------------
+000000080 13:30:00.000000000

SQL> select to_dsinterval('95 18:30:00') from dual;

TO_DSINTERVAL('9518:30:00')
-------------------------------------------------------------
+000000095 18:30:00.000000000

SQL>

SQL> select to_dsinterval('10 01:30:00') from dual;

TO_DSINTERVAL('1001:30:00')
-----------------------------------------------------
+000000010 01:30:00.000000000

SQL>