Parameter Passing Convention - Analytics Database - Teradata Vantage

SQL External Routine Programming

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-03-30
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
qnu1472247494689
lifecycle
latest
Product Category
Teradata Vantageā„¢

UDFs support two types of parameter passing conventions.

Parameter Passing Convention Description Usage
Parameter Style SQL Provides a way to pass nulls as input arguments and return a null as the result.
  • Scalar function
  • Aggregate function
  • Table function
Parameter Style TD_GENERAL Does not accept null input arguments and does not return a null result.
  • Scalar function
  • Aggregate function

The parameter passing convention you use to code a UDF must correspond to the parameter passing specification in the CREATE FUNCTION statement for the UDF.

Teradata provides a special UDF input parameter data type called the dynamic user-defined type (UDT). UDFs can specify up to eight dynamic UDT input parameters. A dynamic UDT can accommodate up to 128 attributes, where the data types of the attributes are determined at runtime.

If you consider each attribute of a dynamic UDT as an input parameter, then the number of effective input parameters increases to 1144, where:

(8 dynamic UDT parameters * 128 attributes) + (120 parameters of other data types) = 1144

For details on using dynamic UDTs, see Defining Functions that Use UDT Types.