Forcing an SQL Warning Condition - 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
ft:locale
en-US
ft:lastEdition
2023-07-11
dita:mapPath
iiv1628111441820.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1147
lifecycle
latest
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.