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

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.