15.00 - Parameter Style Clause - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

prodname
Teradata Database
vrm_release
15.00
category
Programming Reference
featnum
B035-1184-015K

Parameter Style Clause

This optional clause specifies the parameter passing style to be used by the function. Teradata Database supports three 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” on page 262 for parameter style information that is specific to row‑level security constraint UDFs.

    Specific details of both options are described in SQL External Routine Programming.