Scalar Functions - Advanced SQL Engine - Teradata Database

Database Introduction

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
qia1556235689628.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1091
lifecycle
previous
Product Category
Teradata Vantageā„¢

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