parameter_specification - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Advanced SQL Engine
Teradata Database
Release Number
September 2020
English (United States)
Last Update
Product Category
Teradata Vantage™

Optional parameter names and locators for the variables to be passed to the function. A function that is used to compress or decompress a UDT column can have only one input parameter. The data type of the parameter can be any of the supported UDT data types.

For information about naming database objects, see Teradata Vantage™ - SQL Fundamentals, B035-1141.

You must specify opening and closing parentheses even if no parameters are to be passed to the function.

The maximum number of parameters a UDF accepts is 128.

The parameter data type of an algorithmic compression function used to compress a UDT column must match the RETURNS data type of its decompression function exactly. The type of an algorithmic compression function must also match the data type of the UDT column being compressed.

UDFs with a parameter type of UDT must reside in SYSUDTLIB rather than in SYSLIB.

parameter name
Parameter names must be unique within a UDF definition. If you specify one parameter name, then you must specify names for all the parameters passed to the function. You cannot use the keyword SELF to name UDF parameters. If you do not specify parameter names, Vantage assigns unique names to them in the form P1, P2, …, P n. These names are used in the COMMENT statement and displayed in the report produced by the HELP FUNCTION statement, and appear in the text of error messages. See COMMENT (Comment Placing Form) and HELP FUNCTION.
A parenthetical comma-separated list of data types, including UDTs. The data types are required to differentiate between overloaded functions with the same name.
The data type associated with each parameter is the type of the parameter or returned value. All Vantage data types are valid. For data types that take a length or size specification, like BYTE, CHARACTER, DECIMAL, VARCHAR, and so on, the size of the parameter indicates the largest number of bytes that can be passed. Character data can also specify a CHARACTER SET clause.
You cannot specify a character server data set of KANJI1. Otherwise, the system returns an error to the requestor.
BLOB and CLOB types must be represented by a locator. For a description of locators, see Teradata Vantage™ - SQL Data Manipulation Language, B035-1146. Vantage does not support in-memory LOB parameters: an AS LOCATOR phrase must be specified for each LOB parameter and return value.
Whenever a LOB that requires data type conversion is passed to a UDF, the LOB must be materialized for the conversion to take place.