Scalar Functions - Teradata Database

Database Introduction

Product
Teradata Database
Release Number
15.00
Language
English (United States)
Last Update
2018-09-25
dita:id
B035-1091
lifecycle
previous
Product Category
Teradata® Database

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