Db2 Error Messages
Contents |
feature of DB2 programs is the error processing. The error diagnostic containing the SQL Return Code is held in the field SQLCODE within the DB2 SQLCA block. SQLCODE is no longer part of the SQL-standard. The SQL-standard replaced SQLCODE by the mysql error messages more detailed SQLSTATE. Contents 1 SQLCA 2 SQLCODE 2.1 Zero (Successful) 2.2 Negative values (Errors) 2.3 websphere error messages Positive Values (Warnings) 3 References SQLCA[edit] The SQL communications area (SQLCA) structure is used within the DB2 program to return error information to the
Informix Error Messages
application program. This information in the SQLCA and the SQLCODE field is updated after every API call for the SQL statement... SQLCA contains ERROR HANDLING data SQLCODE[edit] The SQLCODE field contains the SQL return code. The code can be http://www.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/codes/src/tpc/db2z_sqlcodes.html zero (0), negative or positive. 0 means successful execution. Negative means unsuccessful with an error. An example is -911 which means a timeout has occurred with a rollback. Positive means successful execution with a warning. An example is +100 which means no rows found or end of table Here is a more comprehensive list of the SQLCODEs for DB2: Zero (Successful)[edit] 0 Successful Negative values (Errors)[edit] -007 The specified 'character' is not a valid character in SQL statements. -010 THE https://en.wikipedia.org/wiki/DB2_SQL_return_codes string constant beginning with string is not terminated properly. -029 INTO Clause required. -060 INVALID type SPECIFICATION: spec -084 Unacceptable SQL statement. -101 The statement is too long or too complex. -102 String constant is too long. -104 Illegal symbol encountered in the SQL statement. -117 The number of values in the INSERT does not match the number of columns. -122 Column or Expression in the Select List is not valid -180 Bad data in Date/Time/Timestamp. -181 Bad data in Date/Time/Timestamp. -188 The host variable in a DESCRIBE statement is not a valid string representation of a name. -199 Illegal use of the specified keyword. -204 Object not defined to DB2. -205 Column name not in table. -206 Column does not exist in any table of the SELECT. -208 THE ORDER BY CLAUSE IS INVALID BECAUSE COLUMN column-name IS NOT PART OF THE RESULT TABLE -216 Not the same number of expressions on both sides of the comparison in a SELECT. -224 FETCH cannot make an INSENSITIVE cursor SENSITIVE. -229 The locale specified in a SET LOCALE statement was not found. -302 THE VALUE OF INPUT VARIABLE OR PARAMETER NUMBER position-number IS INVALID OR TOO LARGE FOR THE TARGET COLUMN OR THE TARGET VALUE -303 A VALUE CANNOT BE ASSIGNED TO OUTPUT HOST VARIABLE NUMBER position-number BECAUSE THE DATA TYPES ARE NOT COMPARABLE -305 Null indicator needed. -311 Varchar, insert or update. -LEN field with the right data
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn http://stackoverflow.com/questions/2720112/how-to-get-descriptive-error-messages-from-db2 more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to get descriptive error messages from DB2? up vote error messages 6 down vote favorite 2 When I call a SQL statement via JDBC on the DB2 and the statement fails, I catch an SQLException with the following message text: com.ibm.db2.jcc.a.nn: DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=O.METADATENSATZ, DRIVER=3.52.95 I tried an automatic translation of the message according to the error list published by IBM, but there are placeholders inside the messages referencing other elements of the exception. While looking sql error messages for these elements inside the exception, I found the DB2ExceptionFormatter and tried to use it to access the missing elements. But here I stopped, because the DB2ExceptionFormatter gave me a clue: Error occurred while trying to obtain message text from server. Only message tokens are available. So my question is: What do I have to configure to get the correct messages from the DB2 server? If I can get a human readable message from the server, I could use it directly and wouldn't have to translate it by myself. java jdbc db2 share|improve this question asked Apr 27 '10 at 9:41 tangens 23.7k891118 In order to answer that question, it would be helpful to know what DB2 version and system (LUW, z/OS, AS400, etc.) you are using. –JRA_TLL Dec 30 '15 at 8:37 add a comment| 2 Answers 2 active oldest votes up vote 6 down vote accepted I'm not sure what message reference you're looking at above (it seems to be iSeries?) but you're better off going to the DB2 Message Reference over here. Looking up SQL0206 gets us this page, with the following information: name is not valid in the context where it is used. The SQLERRMC is "O.METADATEN