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

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.