15.00 - 15.10 - Scalar Functions - Teradata Database

Teradata Database Introduction to Teradata

Product
Teradata Database
Release Number
15.00
15.10
Content Type
User Guide
Publication ID
B035-1091-151K
Language
English (United States)
Last Update
2018-09-25

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);