Table UDFs that Retain Data Between Iterations | Java UDFs | Teradata Vantage - Table UDFs that Retain Data Between Iterations - 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ā„¢

Table UDFs can use intermediate storage to retain data between iterations.

In the TBL_PRE_INIT phase, a table function usually allocates intermediate storage space by calling com.teradata.fnc.Tbl.allocCtx(), passing in an initialized instance of the class that the table function uses to hold the data it wants to retain. In later phases, the table function calls com.teradata.fnc.Tbl.setCtxObject() to write data to the previously allocated intermediate storage space and com.teradata.fnc.Tbl.getCtxObject() to retrieve the data and continue the processing.