MONTHS_TO_INTERVAL_UDF (VARCHAR, NUMBER)

Definition

This user-defined function (UDF) is used to transform month values to intervals. This is an auxiliary function.

MONTHS_TO_INTERVAL_UDF
(INPUT_PART VARCHAR(30), INPUT_VALUE NUMBER)

Parameters

INPUT_PART VARCHAR

The related type of the second parameter. E.g. YEAR TO MONTH, YEAR, MONTH.

INPUT_VALUE VARCHAR

The month to be converted to intervals.

Returns

Returns a varchar with the input value transform to an interval.

Usage example

Input:

SELECT MONTHS_TO_INTERVAL_UDF('YEAR TO MONTH', 2);

Output:

2

Last updated