Phases of a Variable Mode Table Function | Teradata Vantage - Phases of a Variable Mode Table Function - Analytics Database - Teradata Vantage

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
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.