TO_DSINTERVAL is one of the vital Conversion functions of Oracle. It is used to convert a string to an INTERVAL DAY TO SECOND value. The TO_DSINTERVAL function is supported in the various versions of the Oracle/PLSQL, including, Oracle 12c, Oracle 11g, Oracle 10g and Oracle 9i.
Syntax:
TO_DSINTERVAL ( char, nls_language )
Parameters:
char: It is used to specify the string to be converted.
nls_language: It is an optional parameter which is used to specify the nls language to be used for conversion.
Example1:
TO_DSINTERVAL('130 08:30:00') |
Output:
'+000000130’
Explanation:
Here, a string is converted to an INTERVAL DAY TO SECOND value