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.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
qwr1571437338192.ditamap
dita:ditavalPath
lze1555437562152.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.