Table UDFs | SQL External Routine Programming | Teradata Vantage - 17.10 - Table UDFs - 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)

A table function is invoked in the FROM clause of an SQL SELECT statement and returns a table a row at a time in a loop to the SELECT statement. The function can produce the rows of a table from the input arguments passed to it or by reading an external file or message queue.

Like a method that implements a scalar or aggregate UDF, the parameter list for a method that implements a table UDF includes input parameters that map to the input arguments of the UDF when it is specified in an SQL statement.

Unlike a method that implements a scalar or aggregate UDF, the parameter list of a method that implements a table UDF includes output parameters that map to the columns in the result rows that the table UDF produces. Another difference is that the return type for a method that implements a table UDF is always void.

A table function can have:
  • 128 input parameters
  • As many output parameters as defined by the RETURNS TABLE clause of the CREATE FUNCTION or REPLACE FUNCTION statement for the table function.

    The number of output parameters is limited by the maximum number of columns that can be defined for a regular table.