Forcing an SQL Warning Condition - 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ā„¢

You can force an SQL warning condition at the point in the code where the external stored procedure appears to have problems. To force the warning, set the sqlstate return argument to '01H xx', where you choose the numeric value of xx.

If you use parameter style SQL, you can also set the error_message return argument to return up to 256 SQL_TEXT characters.

The warning is issued as a return state of the procedure. The warning does not terminate the transaction; therefore, you must set return arguments to valid values that the transaction can use.

Only one warning can be returned per invocation.

You force an SQL warning condition in a stored procedure in the same manner you force an SQL warning condition in a UDF. For an example of how to set the SQLSTATE result code and error message return argument in a UDF, see Forcing an SQL Warning Condition.