17.10 - General Rules for Row-Level Security Function Parameter Styles - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1184-171K
Language
English (United States)
The following set of rules applies to all row-level security function parameter styles.
  • If the parameter style for a function is SQL, a constraint column can accept a null.

    A parameter style of SQL for a row-level security UDF specifies that each input and output parameter for the UDF has a second indicator variable parameter to indicate if the return value is or is not null.

  • If the parameter style for a function is TD_GENERAL, a constraint column cannot accept a null.
  • If the value for a return indicator variable is -1, the value of the output parameter for the function is null.
  • The result of the function call must be a value that Vantage places in the target row.
  • A parameter style of SQL for a row-level security UDF specifies that each input and output parameter for the UDF has a second indicator variable parameter.

    The SQL parameter style for a row-level security UDF also specifies that each input and output parameter for the UDF has a second indicator variable parameter to indicate if the return value is or is not null.

    In the C or C++ definition of the UDF, the set of indicator variable parameters follows the set of corresponding value parameters. Indicator variable parameters must be specified in the same order as the value parameters.

    An indicator variable value of … Indicates that the corresponding value parameter is …
                 -1 null, meaning that it is not defined.
                   0 not null.
  • The RETURNS data type that you specify for a row-level security UDF depends on the statement-action the function performs.
    IF the function implements this statement-action … THEN the RETURNS clause data type must be …
    • INSERT
    • UPDATE
    the same as the data type used to specify the applicable constraint.

    The value for the parameter is the value to be inserted into, or updated in, the row.

    • DELETE
    • SELECT
    a CHARACTER(1) type to return a value of T or F.

See Rules for INSERT and UPDATE Row-Level Security Policy Functions and Rules for SELECT and DELETE Row-Level Security Policy Functions for parameter style information that is specific to those row-level security function types.