17.10 - Rules for INSERT and UPDATE Row-Level Security Policy Functions - 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 is specific to INSERT and UPDATE row-level security policy functions.
  • For an INSERT or UPDATE row-level security constraint UDF, the result must be a value to be placed in the target row.
  • The RETURN parameters for a hierarchical (SMALLINT) INSERT or UPDATE constraint with a parameter style of SQL are as follows.
    This return output … With this return indicator variable value … Indicates that the call …
    NULL -1 passed the policy and the constraint for the new row is null.
    any non-0 -1 passed the policy and the constraint for the new row is null.
    any non-0 0 passed the policy.

    The return value is a valid constraint value, is not null, and is the value for the new row.

    Vantage verifies the returned constraint value meets the constraint definition.

    0 0 did not pass the policy and the corresponding parameter is not null.

    Vantage ignores the target row for any further action.

  • The RETURN parameters for a non-hierarchical (BYTE[(n)] INSERT or UPDATE constraint UDF with a parameter style of SQL are as follows.
    This return output … With this return indicator variable value … Indicates that the call …
    NULL -1 passed the policy and the constraint for the new row is null.
    any non-0 -1 passed the policy and the constraint for the new row is null.
    any non-0 0 passed the policy.

    The return value is a valid constraint value, is not null, and is the value for the new row.

    Vantage verifies the returned constraint value meets the constraint definition.

    0 0 did not pass the policy and the corresponding parameter is not null.

    Vantage ignores the target row for any further action.

  • The RETURN parameters for a hierarchical (SMALLINT) INSERT or UPDATE constraint UDF with a parameter style of TD_GENERAL are as follows.
    This return output … Indicates that the call …
    any non-0 value passed the policy, the value is a valid constraint value, and is the value for the new row.

    Vantage verifies the return constraint value meets the constraint definition.

    0 did not pass the policy.

    Vantage ignores the target row for any further action.

  • The RETURN parameters for a non-hierarchical (BYTE[(n)] INSERT or UPDATE constraint UDF with a parameter style of TD_GENERAL are as follows.
    This return output … With this return indicator variable value … Indicates that the call …
    any byte is non-zero 0 passed the policy, the value is a valid constraint value, and is the value for the new row.
    all bytes are 0 0 did not pass the policy.

    Vantage ignores the target row for any further action.