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)

Use this library function when it does not matter which copy of the table function participates in the current transaction and request.

Because all copies of the table function call FNC_TblFirstParticipant, each copy must check the return value to determine how to proceed.

IF the return value is … THEN …
1 this copy of the table function is the one participating in the current transaction and request.
0 another copy of the table function is the one participating in the current transaction and request.

When the call to FNC_TblFirstParticipant returns, this copy of the table function should take the following steps:

Call FNC_TblOptOut.

Return.

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

This function can only be called once.

A table function that calls FNC_TblFirstParticipant cannot also call FNC_TblControl.

Calling this function is valid when the table function calls FNC_GetPhase and gets a:

  • value of TBL_PRE_INIT for the processing phase
  • return value of TBL_MODE_CONST

If one copy of the table function calls FNC_TblFirstParticipant, then all copies of the table function must also call FNC_TblFirstParticipant.