Error Severity Levels - Basic Teradata Query

Basic Teradata Query Reference

Product
Basic Teradata Query
Release Number
15.00
Language
English (United States)
Last Update
2018-09-25
dita:id
B035-2414
lifecycle
previous
Product Category
Teradata Tools and Utilities

Error Severity Levels

As described in the preceding subsection, the default return code assignments for Teradata Database error messages also determine the internal BTEQ ERRORLEVEL value that can be used in subsequent testing and branching commands, such as:

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

The BTEQ 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

Note: As shown, UNKNOWN can also be used as a wildcard error number to accommodate any error codes that are not otherwise defined.