Error Severity Levels - Basic Teradata Query

Basic Teradata Query Reference

Product
Basic Teradata Query
Release Number
16.00
Published
November 2016
Language
English (United States)
Last Update
2018-04-25
dita:mapPath
hyz1479325149183.ditamap
dita:ditavalPath
Audience_PDF_include.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 Teradata 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.