Error Severity Levels | Basic Teradata Query - Error Severity Levels - Basic Teradata Query

Basic Teradata® Query Reference

Product
Basic Teradata Query
Release Number
17.00
Published
December 2020
Language
English (United States)
Last Update
2020-12-12
dita:mapPath
zqt1544831938740.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
B035-2414
lifecycle
previous
Product Category
Teradata Tools and Utilities

As described in BTEQ Return Codes, the default return code assignments for database error messages also determine the ERRORLEVEL status value that can be used in subsequent testing and branching commands, such as:

SELECT * FROM SOMEWHERE;
.IF ERRORLEVEL >= 14 THEN .QUIT 17;

The ERRORLEVEL command can also be used to change the severity level associated with one or more error codes, as in the following example:

.SET ERRORLEVEL 2168 SEVERITY 4,
       (2173, 3342, 5262) SEVERITY 8
.SET ERRORLEVEL UNKNOWN SEVERITY 16
As shown above, UNKNOWN can also be used as a wildcard error number to accommodate any error codes that are not otherwise defined.