Oracle - PL/SQL - NUMTODSINTERVAL Function

NUMTODSINTERVAL converts n to an INTERVAL DAY TO SECOND literal. The argument number can be any NUMBER value or an expression that can be implicitly converted to a NUMBER value. The argument expression can be of CHAR, VARCHAR2, NCHAR, or NVARCHAR2 datatype.

The syntax for the numtodsinterval 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.

Applies To:

· Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g

For example:

numtodsinterval(150, 'DAY')

would return '+000000150'

numtodsinterval(1500, 'HOUR')

would return '+000000062'

numtodsinterval(15000, 'MINUTE')

would return '+000000010'

numtodsinterval(150000, 'SECOND')

would return '+000000001'