Archives of the TeradataForum
Message Posted: Fri, 07 Jan 2005 @ 19:06:42 GMT
To trap the error messages in the normal output log, issue the following BTEQ command at the top of the script:
.set errorout stdout;
This redirects the error output away from the defaulted STDERR log file to STDOUT (the normal log) for network attached clients.
Also you get a varying return code level obviously on any SQL statement and the return code (rc) will be the most severe error level resulting from the script. Even, if there is something similar to a deadlock the transaction is automatically resubmitted and completes successfully, it can cause the return code to be an error level of 8 unless you specifically code for the possibility by setting the appropriate error levels (.set ERRORLEVEL......) or trapping the specific RDBMS error codes.
Conversely to running the entire script regardless of error levels encountered, you can abruptly stop the script upon a specific error level by coding the BTEQ MAXERROR command to set the maximum error level permitted before terminating the script.
For example, to terminate the script upon any error level encountered greater than 4 without trapping each SQL statement's result; you can issue the following command:
.set maxerror 4;
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|