TO_DSINTERVAL
TO_DSINTERVAL is a function in SQL that converts a character string of a specific format into an interval day to second type. It enables SQL queries to manipulate data by specific intervals of days, hours, minutes, and seconds.
TO_DSINTERVAL(string)
- string: This parameter is a varchar2 datatype that represents the interval to be converted. The format for the string is ‘DY day HH
Example
Output
Explanation
The TO_DSINTERVAL
function has been used to add 1 hour to the current system timestamp in this case. The string ‘0 01:00:00.000’ in the TO_DSINTERVAL
function indicates ‘0 days, 1 hour, 0 minutes and 0 seconds’. The resultant timestamp is displayed under New_Timestamp.