16.20 - UDF Parameter Styles - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Data Definition Language Detailed Topics

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Release Date
March 2019
Content Type
Programming Reference
Publication ID
B035-1184-162K
Language
English (United States)

The following three parameter styles are all valid for external functions.

Style Description
SQL Uses indicator variables to pass arguments.

This is the default parameter style for all UDFs.

As a result, you can always pass nulls as inputs and return them in results. If a row-level security policy constraint permits nulls, then its parameter style must be SQL.

If the function executes a row-level security policy constraint, each input and output parameter for the function has a second indicator parameter. The following indicator parameter values apply.

  • If the indicator parameter value is -1, its corresponding value parameter is null.
  • If the indicator parameter value is 0, its corresponding value parameter is not null.

No other values are valid for an indicator parameter in a row-level security policy constraint UDF.

TD_GENERAL Uses parameters to pass arguments.

Can neither be passed nulls nor return nulls. If a row-level security policy constraint does not permit nulls, then its parameter style must be TD_GENERAL.

If the function executes a row-level security policy constraint, there are no indicator parameters.

JAVA If the Java function must accept null arguments, then the EXTERNAL NAME clause must include the list of parameters and specify data types that map to Java objects.

PARAMETER STYLE JAVA must be specified for all Java functions.

A row-level security policy constraint function cannot have a parameter style of JAVA.