Return Values for INSERT or UPDATE UDFs - Advanced SQL Engine - Teradata Database

SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
rin1593638965306.ditamap
dita:ditavalPath
rin1593638965306.ditaval
dita:id
B035-1147
lifecycle
previous
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.