Enables database warnings to be treated as though they are errors.
The command takes values ON or OFF and is OFF by default. When neither ON or OFF is supplied, ON is assumed.
The set of unique DBS warning codes does not overlap with the set of unique DBS error codes. So when ERRORONDBSWARNING is set to ON, the ERRORCODE and ERRORLEVEL status value keywords can actually 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 is the setting is ON, the ERRORCODE status value will get set to the same value as the WARNINGCODE status value for each successful request. So once this action is no longer needed, the control should be turned OFF.
Example 1 – ERRORONDBSWARNING ON for testing compiles
Assume a user need to detect that the REPLACE of a Stored Procedure has been completely successfully accomplished without errors and that they do not want to code for specific warning or error code values but rather just 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