A scalar function works on input parameters to create a result.
When it is part of an expression, the function is invoked as needed whenever expressions are evaluated for an SQL statement. When a function completes, its result is used by the expression in which the function was referenced.
For example, the following request returns the current date plus 13 years.
SELECT ADD_MONTHS (CURRENT_DATE, 12*13);
The following request returns the date 6 months ago.
SELECT ADD_MONTHS (CURRENT_DATE, -6);