17.10 - Forcing an SQL Warning Condition - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1147-171K
Language
English (United States)

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.