Oracle Plsql To_dsinterval Function

Oracle / PLSQL: TO_DSINTERVAL Function

This Oracle tutorial explains how to use the Oracle/PLSQL TO_DSINTERVAL function with syntax and examples.

Description

The Oracle/PLSQL TO_DSINTERVAL function converts a string to an INTERVAL DAY TO SECOND type.

Syntax

The syntax for the TO_DSINTERVAL function in Oracle/PLSQL is:

TO_DSINTERVAL( character [ nls_parameter ] )

Parameters or Arguments

character

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

nls_parameter

Optional. A decimal character and group separator value.

Returns

The TO_DSINTERVAL function returns a INTERVAL DAY TO SECOND value.

Applies To

The TO_DSINTERVAL function can be used in the following versions of Oracle/PLSQL:

  • Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i

Example

Let's look at some Oracle TO_DSINTERVAL function examples and explore how to use the TO_DSINTERVAL function in Oracle/PLSQL.

For example:

TO_DSINTERVAL('150 08:30:00')
Output: '+000000150'

TO_DSINTERVAL('80 12:30:00')
Output: '+000000080'

TO_DSINTERVAL('95 18:30:00')
Output: '+000000095'