Rules for INSERT and UPDATE Row-Level Security Policy Functions - 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™

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.

    Teradata Database verifies that the returned constraint value meets the constraint definition.

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

    Teradata Database 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.

    Teradata Database verifies that the returned constraint value meets the constraint definition.

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

    Teradata Database 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.

    Teradata Database verifies that the return constraint value meets the constraint definition.

    0 did not pass the policy.

    Teradata Database 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.

    Teradata Database ignores the target row for any further action.