ERRORONDBSWARNING Command | Basic Teradata Query - ERRORONDBSWARNING (EODW) - 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

Purpose

This control enables users to specify that database warnings are to be treated as though they are errors. This allows the ERRORLEVEL status value to also be assigned to the severity level associated with each encountered warning.

Syntax



Shorthand Syntax (Interactive Mode Only)
Command Shorthand
ERRORONDBSWARNING EODW

The command takes values ON or OFF and is OFF by default. When neither ON or OFF is supplied, ON is assumed.

Usage Notes

The set of unique database warning codes does not overlap with the set of unique error codes. Hence, when ERRORONDBSWARNING is set to ON, the ERRORCODE and ERRORLEVEL status value keywords can be used to refer to the superset of all database error and warning codes. This is the only way to cause ERRORLEVEL to be set to capture the severity level associated with a warning.

As long as the setting is ON, the ERRORCODE status value will be set to the same value as the WARNINGCODE status value for each successful request. Therefore, once this action is no longer needed, the control must be turned OFF.

The DEFAULTS command does not affect ERRORONDBSWARNING setting.

The ERRORONDBSWARNING command is valid in an SQL macro.

Example 1 – ERRORONDBSWARNING ON for Testing Compiles

Assume that users need to detect that the REPLACE of a Stored Procedure has been successfully accomplished without errors and that they do not want to code for specific warning or error code values but rather check to see if the ERRORLEVEL status value is still zero. Setting ERRORONDBSWARNING to ON prior to issuing the COMPILE command will enable the following concise IF...THEN... command to be subsequently used:

.IF ERRORCODE!=0 THEN .GOTO errorfound