Parameter Style Clause - Analytics Database - Teradata Vantage

SQL Data Definition Language Detailed Topics

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1184
lifecycle
latest
Product Category
Teradata Vantage™
This optional clause specifies the parameter passing style to be used by the function. Vantage supports the following parameter passing styles for user-defined functions:
  • SQL
  • TD_GENERAL
  • JAVA
The following rules apply to the parameter styles specified for row-level security policy functions.
  • The SQL parameter style defines that each input and the output parameter for the UDF has a second indicator parameter.

    The SQL parameter style enables the C or C++ code body to indicate null data.

    The set of indicator parameters in the C or C++ definition of the UDF follows the set of corresponding value parameters. The indicator parameters must be in the same order as the value parameters.

    IF the indicator parameter value is … THEN its corresponding value parameter is …
     -1 null.
    0 is not null.

    No other values are acceptable for an indicator parameter.

  • The TD_GENERAL parameter style defines that there are no indicator parameters for the UDF parameters.

    The TD_GENERAL parameter style does not enable the code body to indicate null data.

  • The JAVA parameter style is not supported for row-level security policy functions.

The SQL parameter style allows the code body to indicate null data. This cannot be done with the TD_GENERAL parameter style.

You can specify the parameter style clause in one of two places:
  • SQL data access clause
  • External function name

You cannot specify the parameter style both places in the same user-defined function definition statement. Only one parameter style clause is permitted per UDF definition.

See General Rules for Row-Level Security Function Parameter Styles for parameter style information that is specific to row-level security constraint UDFs.

Specific details of both options are described in Teradata Vantage™ - SQL External Routine Programming, B035-1147.