BTEQ Return Codes | Basic Teradata Query - BTEQ Return Codes - Basic Teradata Query

Basic Teradata® Query Reference

Product
Basic Teradata Query
Release Number
17.10
Published
February 2022
Language
English (United States)
Last Update
2022-02-03
dita:mapPath
nnw1608578382132.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
B035-2414
lifecycle
previous
Product Category
Teradata Tools and Utilities

BTEQ's return code is the value it returns to the client operating system when its execution is complete. The value of the return code indicates the completion status of the job or task as follows:

Return Code Description
00 Job completed with no errors
02 BTEQ had to produce a warning to alert that an SQL request instruction was given without any sessions being logged on.
04 Warning error
08 User error
12 Severe internal error

The value of BTEQ's default return code is determined by the most severe error code BTEQ receives back from the database over the course of time it is executing input instructions. BTEQ assigns a default severity value to each error code (as shown in the following tables) for return codes of 0, 4, 8 and 12. If, for example, an SQL request results in database error 3737, "Name is longer than 30 characters", BTEQ will minimally use 4 as its return code upon exit unless a difference value is explicitly used on the EXIT command.

BTEQ exposes the return code's current value prior to exit through the ERRORLEVEL status value keyword. That keyword can be used in IF and ELSEIF command conditions to make it easier to determine an appropriate course of action based on hitting a particular severity level rather than having to explicitly test for multiple specific error codes.

There is also an ERRORLEVEL command which can be used to change the severities mapped to database error codes, and add additional levels of error severity. Any database message not contained in the following tables is mapped to an 8 severity value, unless the ERRORLEVEL command is used to override that default. See the ERRORLEVEL command, as described in the following subsection.

The default severity mapped to a 2631 error is 0. For more details, see Usage Notes for the RETRY command.

To support detection of the more egregious compiler error results, the default severity map includes associations to cover the common warning codes for compiling objects and their execution. These mappings will only be in effect when the ERRORONDBSWARNING command setting is ON.

Return Code 04 Default Error Message Assignments  
Error Code Description
2580 Mload not active on table %TVMID.
2667 Statistics cannot be collected on an empty table.
3534 Index already exists.
3666 This view has too many columns to store or retrieve comments.
3737 Name is longer than 30 characters.
3747 No start-up string defined for this user.
3803 Table “%VSTR” already exists.
3804 View “%VSTR” already exists.
3805 Macro “%VSTR” already exists.
5527 The compiler reported warnings only for a non-Stored Procedure object. This value was returned as a database warning code as opposed to an error code. So it can only affect the ERRORLEVEL status value when ERRORONDBSWARNING has been set to ON.
5607 The compiler reported warnings only for a Stored Procedure object. This value was returned as a database warning code as opposed to an error code. So it can only affect the ERRORLEVEL status value when ERRORONDBSWARNING has been set to ON.
Return Code 08 Default Error Message Assignments 
Error Codes Description
CLI0530 Character set name or code unknown.
2123 A segment could not be read successfully.
2538 A disk read error occurred in the tables area.
2541 End of hash code range reached.
2632 All AMPs own sessions for this Fast/MultiLoad
2639 Too many simultaneous transactions.
2641 %DBID.%TVMID was restructured. Resubmit.
2644 No more room in database %DBID.
2654 Operation not allowed: %DBID.%TVMID is being restored.
2805 Maximum row length exceeded in %TVMID.
2809 Invalid recovery sequence detected.
2815 Apparent invalid restart of a restore.
2818 Invalid lock to dump table without after image journaling.
2825 No record of the last request was found after database restart.
2826 Request completed but all output was lost due to database restart.
2827 Request was aborted by user or due to statement error.
2828 Request was rolled back during system recovery.
2830 Unique secondary index must be dropped before restoring table.
2835 A unique index has been invalidated. Resubmit request.
2837 Table being fast loaded; no data dumped.
2838 Table is unhashed; no data dumped.
2840 Data rows discarded due to inconsistent hash codes.
2843 No more room in database.
2866 Table was recovery aborted; no data dumped.
2868 This permanent journal table is damaged; no data dumped.
2920 Delete journal and AMP down without dual.
2921 No saved subtable for journal %DBID.%TVMID.
2926 No more room in %DBID.%TVMID.
3001 Session is already logged on.
3111 The dispatcher has timed out the transaction.
3116 Response buffer size is insufficient to hold one record.
3119 Continue request submitted but no response to return.
3120 The request is aborted because of a database recovery.
3127 Transaction aborted due to lock conflict with Queue Table Manager.
3128 Transaction aborted due to exceeding the maximum consume statement limit.
3178 Queue Table Cache is full.
3319 TDWM control command timed out.
3329 Query Band is in transition state.
3415 An active request exists for this session.
3523 %FSTR does not have %VSTR access to %DBID.%TVMID.
3524 %FSTR does not have %VSTR access to database %DBID.
3566 Database does not have a PERMANENT journal.
3596 RESTORE Teradata Database invalid if table, view or macro exists outside of Teradata Database.
3598 Concurrent change conflict on database; try again.
3603 Concurrent change conflict on table; try again.
3613 Dump/restore, no hashed nonfallback tables found.
3656 Journal table specified no longer exists.
3658 ROLLBACK/ROLLFORWARD table specifications are invalid.
3705 Teradata SQL request is longer than the Simulator maximum.
3802 Database “%VSTR” does not exist.
3807 Table/view “%VSTR” does not exist.
3824 Macro “%VSTR” does not exist.
3873 “%VSTR” is not a journal table.
3877 NO FALLBACK specified and the table is FALLBACK.
3897 Request aborted due to a database restart. Resubmit.
3916 Requested information not in dictionary.
5495 Stored Procedure %VSTR does not exist.
5880 Concurrent change conflict on stored procedure.
5991 Error during resolver or plan generation.
7423 Object already locked and NOWAIT. Transaction Aborted.
7592 Space accounting cache is full of non-purgeable entries.
7618 Stored procedure execution request for %DBID.%TVMID has timed out.
7676 Insufficient memory in stored procedure cache.
8024 All virtual circuits are currently in use.
8086 All the virtual circuits on the node are in use.
9728 Retry later as currently a load operation is in progress on the table %DBID.%TVMID.
Return Code 12 Default Error Message Assignments 
Error Code Description
CLI0001 Parameter list invalid or missing.
CLI0002 Invalid number of parameters received.
CLI0003 Error validating HSIRCB.
CLI0004 Error validating HSICB.
CLI0005 Error validating HSISPB.
CLI0006 Invalid destination HSICB detected.
CLI0007 Invalid destination RCB detected.
CLI0008 DBCFRC cannot free RCB/HSICB control blocks because they are not contiguous in storage.
CLI0009 Invalid DBCAREA pointer or id.
CLI0010 ECB already waiting.
2971 The AMP lock table has overflowed.
2972 No table header exists for table.
5526 The compiler reported errors and possibly warnings for a Stored Procedure object. This value was returned as a database warning code as opposed to an error code. So it can only affect the ERRORLEVEL status value when ERRORONDBSWARNING has been set to ON.
5603 The compiler reported errors and possibly warnings for a non-Stored Procedure object. This value was returned as a database warning code as opposed to an error code. So it can only affect the ERRORLEVEL status value when ERRORONDBSWARNING has been set to ON.
7980 Java class dependency not met. This value was returned as a database warning code as opposed to an error code. So it can only affect the ERRORLEVEL status value when ERRORONDBSWARNING has been set to ON.