C Constant/Variable Mode Table Function W/ Dynamic Result Row Spec | Vantage - C Constant/Variable Mode Table Function With Dynamic Result Row Specification - 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ā„¢

This example is similar to the preceding example, C Constant/Variable Mode Table Function, and shows the C code for a table function that supports both TBL_MODE_CONST and the TBL_MODE_VARY modes. The TBL_MODE_CONST is very simple in that any one AMP will extract the data out of the text string that is passed in.

The table function can return a maximum of four columns, as specified by the RETURNS TABLE VARYING COLUMNS clause in the REPLACE FUNCTION statement.

Each output parameter in the table function parameter list is declared as a void pointer because the actual data types of the result row arguments are unknown until function invocation.

During execution, the table function calls the FNC_TblGetColDef library function to get the actual number and data types of the result row arguments.