Phases of a Variable Mode Table Function | Teradata Vantage - Phases of a Variable Mode Table Function - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
rin1593638965306.ditamap
dita:ditavalPath
rin1593638965306.ditaval
dita:id
B035-1147
lifecycle
previous
Product Category
Teradata Vantageā„¢

Vantage invokes a variable mode table function repeatedly, allowing the function to pass through different phases where it initializes itself, connects to external objects, builds output rows, closes open connections, and cleans up. The function can use the FNC_GetPhase or the FNC_GetPhaseEx library function to determine which phase it is in and what action to take.

A function that uses the FNC_GetPhase library function passes through the following phases.


FNC_GetPhase library function phases

Alternatively, a table function that needs to know when it is passed in the last qualified row on an AMP (perhaps because the function does not return a row until it has processed all of the input rows) can use the FNC_GetPhaseEx function with the TBL_LASTROW option and pass through the following phases.


FNC_GetPhaseEx library function phases

For more information on implementing each phase of a variable mode table function, see Implementation Guidelines.