UDF Parameter Styles - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Detailed Topics

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
jpx1556733107962.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1184
lifecycle
previous
Product Category
Teradata Vantage™
Customers using Vantage delivered as-a-service cannot create their own C++ and Java UDFs, UDMs, UDTs, or External Stored Procedures.

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.