Oracle - PL/SQL - NUMTOYMINTERVAL Function

NUMTOYMINTERVAL converts number n to an INTERVAL YEAR TO MONTH 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 numtoyminterval function is:

numtoyminterval( number, expression )

number is the number to convert to an interval.

expression is the unit. It must be one of the following values: YEAR or MONTH.

Applies To:

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

For example:

numtoyminterval(100000000, 'MONTH')

would return '+0083'

numtoyminterval(100000, 'YEAR')

would return '+0001'