Return Values for INSERT or UPDATE UDFs - Analytics Database - Teradata Vantage

SQL External Routine Programming

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
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
Product Category
Teradata Vantageā„¢

INSERT and UPDATE UDFs should return the following values in the result and corresponding indicator parameters. The return values are based on the data type and NULL option defined for the constraint object. The data type for the return value must be the same as the type specified in the constraint object.

  • If the constraint data type is SMALLINT and the constraint does not allow nulls, then the valid return values are:
    Return Value Description
    0 Indicates that the call failed to pass the security policy. The INSERT or UPDATE is not performed and the system will move to the next row.
    non-zero Indicates that the call passed the security policy. The UDF returns the current session security label which the system will place in the constraint column of the target row. The INSERT or UPDATE operation is performed.
  • If the constraint data type is SMALLINT and the constraint allows nulls, then the valid return values are:
    IF the Return Indicator Value is... AND the Return Value is... THEN...
    -1 not applicable the call passed the security policy and the system will place a NULL in the constraint column of the target row. The INSERT or UPDATE operation is performed.
    0 0 the call failed to pass the security policy. The INSERT or UPDATE is not performed and the system will move to the next row.
    0 non-zero the call passed the security policy. The UDF returns the current session security label which the system will place in the constraint column of the target row. The INSERT or UPDATE operation is performed.
  • If the constraint data type is BYTE(n) and the constraint does not allow nulls, then the valid return values are:
    Return Value where... Description
    all bytes are 0 Indicates that the call failed to pass the security policy. The INSERT or UPDATE is not performed and the system will move to the next row.
    some byte is non-zero Indicates that the call passed the security policy. The UDF returns the current session security label which the system will place in the constraint column of the target row. The INSERT or UPDATE operation is performed.
  • If the constraint data type is BYTE(n) and the constraint allows nulls, then the valid return values are:
    IF the Return Indicator Value is... AND the Return Value is... THEN...
    -1 not applicable the call passed the security policy and the system will place a NULL in the constraint column of the target row. The INSERT or UPDATE operation is performed.
    0 all bytes are 0 the call failed to pass the security policy. The INSERT or UPDATE is not performed and the system will move to the next row.
    0 some byte is non-zero the call passed the security policy. The UDF returns the current session security label which the system will place in the constraint column of the target row. The INSERT or UPDATE operation is performed.