17.10 - Usage Notes - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1147-171K
Language
English (United States)

Before calling this function, the general scratchpad must be allocated by a call to FNC_TblAllocCtx.

Do not store pointers in the scratchpad that reference other structures in the scratchpad, because the returned address of the scratchpad is not the same for subsequent invocations of the table function. Instead, use relative addressing, such as offsets from the current address of the scratchpad.

The general scratchpad is local to each copy of the table function for the current transaction or request running on each AMP vproc. It is not retained for subsequent transactions or requests.

Data changed in the scratchpad is retained for subsequent calls.

This function can only be called from within a table function. Calling this function from a scalar function, aggregate function, UDM, or external stored procedure results in an exception on the transaction.