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

Basic Teradata® Query Reference - 20.00

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Basic Teradata Query
Release Number
20.00
Published
October 2023
ft:locale
en-US
ft:lastEdition
2025-04-02
dita:mapPath
gxl1691484661681.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
psp1479308573013
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 in the previous example, UNKNOWN can also be used as a wildcard error number to accommodate any error codes that are not otherwise defined.