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.