You are on page 1of 23

Listing of SQLSTATE values

Page 1 of 23

Send feedback | Rate this page

Listing of SQLSTATE values


The tables below provide descriptions of SQLSTATE codes that can be returned to applications by DB2 UDB for iSeries. The tables include SQLSTATE values, their meanings, and their corresponding SQLCODE values. Table 1. Class Code 00: Unqualified Successful Completion SQLSTATE Meaning Value 00000 Completion of the operation was successful and did not result in any type of warning or exception condition.

SQLCODE Values +000

Table 2. Class Code 01: Warning SQLSTATE Value 01002 01003 01004 01005 01006 01007 01009 0100A 0100C 0100D 0100E 01503 01504 01505 01506

Meaning

SQLCODE Values +596 +000

A DISCONNECT error occurred. Null values were eliminated from the argument of a column function.

The value of a string was truncated when assigned to another string +000, +445, data type with a shorter length. +802, +20141 Insufficient number of entries in an SQLDA. A privilege was not revoked. A privilege was not granted. The search condition is too long for the information schema. The query expression of the view is too long for the information schema. One or more ad hoc result sets were returned from the procedure. The cursor that was closed has been reopened on the next result set within the chain. The procedure returned too many result sets. The number of result columns is larger than the number of host variables provided. The UPDATE or DELETE statement does not include a WHERE clause. The statement was not executed because it is unacceptable in this environment. An adjustment was made to a DATE or TIMESTAMP value to correct an invalid date resulting from an arithmetic operation. +239 +569 +570 +177 +178 +466 +467 +464, +20206 +000, +030 +000, +088 +084 +000

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 2 of 23

SQLSTATE Value 01515

Meaning

SQLCODE Values

The null value has been assigned to a host variable, because the non +304 -null value of the column is not within the range of the host variable. A character that cannot be converted was replaced with a substitute +335 character. The null value has been assigned to a host variable, because a numeric value is out of range. The null value has been assigned to a host variable, because the characters cannot be converted. The local table or view name used in the CREATE ALIAS statement is undefined. Isolation level has been escalated. WHERE NOT NULL is ignored, because the index key cannot contain null values. An undefined object name was detected. The string representation of a datetime value is invalid. An arithmetic operation on a date or timestamp has a result that is not within the valid range of dates. +802 +331 +403 +595 +645 +204 +180, +181 +183

01517 01519 01520 01522 01526 01528 01532 01534 01535 01536 01539 01542 01544

During remote bind where existence checking is deferred, the server +114 -name specified does not match the current server. Connection is successful but only SBCS characters should be used. Authorization ID does not have the privilege to perform the operation as specified. The null value has been assigned to a host variable, because a substring error occurred; for example, an argument of SUBSTR is out of range. An unqualified column name has been interpreted as a correlated reference. A mixed data value is improperly formed. The authorization ID does not have the privilege to perform the specified operation on the identified object. Too many host variables have been specified on SELECT INTO or FETCH. The null value has been assigned to a host variable, because division by zero occurred. The null value has been assigned to a host variable, because a miscellaneous data exception occurred; for example, the character value for the CAST, DECIMAL, FLOAT, or INTEGER scalar +863 +552 +138

01545 01547 01548 01557 01564 01565

+012 +191, +304, +802 +551 +326 +802 +304, +420, +802

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 3 of 23

SQLSTATE Value

Meaning function is invalid; a floating-point NAN (not a number) or invalid data in a packed decimal field was detected.

SQLCODE Values

01567 01587 01593 01594 01627 01634 01643 01646 01647 01658 01660 01662 01Hxx

The table was created but not journaled. The unit of work was committed or rolled back, but the outcome is not fully known at all sites. An ALTER TABLE may cause data truncation. Insufficient number of entries in an SQLDA for ALL information (i.e. not enough descriptors to return the distinct name). The DATALINK value may not be valid because the table is in reconcile pending or reconcile is not a possible state. The distinct data type name is too long and cannot be returned in the SQLDA. The short name is returned instead. Assignment to SQLCODE or SQLSTATE variable does not signal a warning or error. A result sets cannot be returned because the cursor was closed. A DB2SQL BEFORE trigger changed to DB2ROW. Binary data is invalid for DECRYPT_CHAR and DECYRYPT_DB. The routine was created but a restore will not update the catalog. Release record option ignored on CLOSE. Valid warning SQLSTATEs returned by a user-defined function or external procedure CALL.

+7905 +990 +460 +237 +360 +7036 +385 +7050 +7051 +20224 +7909 +30107 +462

Table 3. Class Code 02: No Data SQLSTATE Value 02000

Meaning

SQLCODE Values +100

One of the following exceptions occurred: The result of the SELECT INTO statement or the subselect of the INSERT statement was an empty table. The number of rows identified in the searched UPDATE or DELETE statement was zero. The position of the cursor referenced in the FETCH statement was after the last row of the result table. The fetch orientation is invalid.

02001

No additional result sets returned.

+387

Table 4. Class Code 07: Dynamic SQL Error

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 4 of 23

SQLSTATE Value 07001 07002 07003 07004 07005 07006

Meaning The number of host variables is not correct for the number of parameter markers. The call parameter list or control block is invalid. The statement identified in the EXECUTE statement is a selectstatement, or is not in a prepared state. The USING clause or INTO clause is required for dynamic parameters. The statement name of the cursor identifies a prepared statement that cannot be associated with a cursor. An input host variable, transition variable, or parameter marker cannot be used, because of its data type.

SQLCODE Values -313 -804 -518 -313 -517 -301

Table 5. Class Code 08: Connection Exception SQLSTATE Meaning Value 08001 08002 08003 08004 08501 The application requester is unable to establish the connection. The connection already exists. The connection does not exist. The application server rejected establishment of the connection. A DISCONNECT is not allowed when the connection uses an LU6.2 protected conversation.

SQLCODE Values -30080, -30082, -30089 -842 -843, -900 -30060, -30061 -858

Table 6. Class Code 09: Triggered Action Exception SQLSTATE Meaning Value 09000 A triggered SQL statement failed.

SQLCODE Values -723

Table 7. Class Code 0A: Feature Not Supported SQLSTATE Meaning Value 0A001 The CONNECT statement is invalid, because the process is not in the connectable state.

SQLCODE Values -752

Table 8. Class Code 0E: Invalid Schema Name List Specification SQLSTATE Meaning Value 0E000 The schema name list in a SET PATH statement is not valid.

SQLCODE Values -329

Table 9. Class Code 0F: Invalid Token

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 5 of 23

SQLSTATE Value 0F001

Meaning The locator value does not currently represent any value.

SQLCODE Values -423

Table 10. Class Code 0K: Resignal When Handler Not Active SQLSTATE Meaning Value 0K000 A RESIGNAL was issued but a handler is not active.

SQLCODE Values -787

Table 11. Class Code 0W: Prohibited Statement Encountered During Trigger SQLSTATE Meaning Value 0W000 The statement is not allowed in a trigger.

SQLCODE Values -751

Table 12. Class Code 0Z: Diagnostics Exception SQLSTATE Meaning Value 0Z001 0Z002 Maximum number of stacked diagnostics areas exceeded. Stacked diagnostics accessed without and active handler.

SQLCODE Values -20226 -20228

Table 13. Class Code 20: Case Not Found for Case Statement SQLSTATE Meaning Value 20000 The case was not found for the CASE statement.

SQLCODE Values -773

Table 14. Class Code 21: Cardinality Violation SQLSTATE Meaning Value 21000 The result of a SELECT INTO, scalar fullselect, or subquery of a basic predicate is more than one value.

SQLCODE Values -811

Table 15. Class Code 22: Data Exception SQLSTATE Value 22001

Meaning

SQLCODE Values

Character data, right truncation occurred; for example, an update or -302, -303, insert value is a string that is too long for the column, or a datetime 404, -433, -802 value cannot be assigned to a host variable, because it is too small. A null value, or the absence of an indicator parameter was detected; -305 for example, the null value cannot be assigned to a host variable, because no indicator variable is specified.

22002

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 6 of 23

SQLSTATE Value 22003 22004

Meaning A numeric value is out of range. A null value cannot returned from a procedure that is defined as PARAMETER STYLE GENERAL or a type-preserving method that is invoked with a non-null argument. The fetch orientation is invalid. An invalid datetime format was detected; that is, an invalid string representation or value was specified. Datetime field overflow occurred; for example, an arithmetic operation on a date or timestamp has a result that is not within the valid range of dates. A substring error occurred; for example, an argument of SUBSTR is out of range. Division by zero is invalid. The character value for the CAST, DECIMAL, FLOAT, or INTEGER scalar function is invalid. The LIKE predicate has an invalid escape character.

SQLCODE Values -302, -304, 406, -446, -802 -305

22006 22007 22008

-231 -180, -181 -183

22011 22012 22018 22019 22021 22023 22024 22025 22501 22503 22504 22511 22522 22524 22525

-138 -802 -420 -130

A character is not in the coded character set or the conversion is not -330, -331 supported. A parameter or host variable value is invalid. -302, -304, 406, -802

A NUL-terminated input host variable or parameter did not contain -302 a NUL. The LIKE predicate string pattern contains an invalid occurrence of -130 an escape character. The length control field of a variable length string is negative or greater than the maximum. The string representation of a name is invalid. A mixed data value is invalid. ADT length exceeds maximum column length. The value for a ROWID or reference column is not valid. A CCSID value is not valid at all, not valid for the data type or subtype, or not valid for the encoding scheme. Character conversion resulted in truncation Partitioning key value is not valid. -311 -188 -191, -304, 406, -802 -399 -189 -334 -327

Table 16. Class Code 23: Constraint Violation

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 7 of 23

SQLSTATE Value 23001 23502 23503 23504 23505 23511 23512 23513 23515 23520 23522

Meaning The update or delete of a parent key is prevented by a RESTRICT update or delete rule.

SQLCODE Values -531, -532

An insert or update value is null, but the column cannot contain null -407 values. The insert or update value of a foreign key is invalid. -530 The update or delete of a parent key is prevented by a NO ACTION -531, -532 update or delete rule. A violation of the constraint imposed by a unique index or a unique -803 constraint occurred. A parent row cannot be deleted, because the check constraint restricts the deletion. The check constraint cannot be added, because the table contains rows that do not satisfy the constraint definition. -543 -544

The resulting row of the INSERT or UPDATE does not conform to -545 the check constraint definition. The unique index cannot be created or unique constraint added because the table contains duplicate values of the specified key. The foreign key cannot be defined, because all of its values are not equal to a parent key of the parent table. The range of values for the identity column or sequence is exhausted. -603 -667 -359

Table 17. Class Code 24: Invalid Cursor State SQLSTATE Meaning Value 24501 24502 24504 24506 24507 24513 24514 The identified cursor is not open. The cursor identified in an OPEN statement is already open. The cursor identified in the UPDATE, DELETE, SET, or GET statement is not positioned on a row. The statement identified in the PREPARE is the statement of an open cursor.

SQLCODE Values -501, -507 -502 -508 -519

FETCH CURRENT was specified, but the current row is deleted, or -226 a value of an ORDER BY column of the current row has changed. FETCH NEXT, PRIOR, CURRENT, or RELATIVE is not allowed, -227 because the cursor position is not known. A previous error has disabled this cursor. -906

Table 18. Class Code 25: Invalid Transaction State

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 8 of 23

SQLSTATE Value 25000 25006 25501

Meaning An update operation is invalid for the application execution environment. An update operation is not valid because the transaction is read only. The statement is only allowed as the first statement in a unit of work.

SQLCODE Values -30090 -817 -428

Table 19. Class Code 26: Invalid SQL Statement Identifier SQLSTATE Meaning Value 26501 26510 The statement identified does not exist. The statement name specified in a DECLARE CURSOR already has a cursor allocated to it.

SQLCODE Values -514, -516 -5023

Table 20. Class Code 27: Triggered Data Change Violation SQLSTATE Meaning Value 27000 An attempt was made to modify the target table of the MERGE statement by a constraint or trigger.

SQLCODE Values -907

Table 21. Class Code 28: Invalid Authorization Specification SQLSTATE Meaning Value 28000 Authorization name is invalid.

SQLCODE Values -113, -188

Table 22. Class Code 2D: Invalid Transaction Termination SQLSTATE Meaning Value 2D522 2D528 2D529 COMMIT and ROLLBACK are not allowed in an ATOMIC Compound statement. Dynamic COMMIT or COMMIT ON RETURN procedure is invalid for the application execution environment Dynamic ROLLBACK is invalid for the application execution environment.

SQLCODE Values -774 -426, -30090 -427, -30090

Table 23. Class Code 2E: Invalid Connection Name SQLSTATE Meaning Value 2E000 Connection name is invalid.

SQLCODE Values -113, -188, -251

Table 24. Class Code 2F: SQL Function Exception

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 9 of 23

SQLSTATE Value 2F002 2F003 2F004 2F005

Meaning The SQL function attempted to modify data, but the function was not defined as MODIFIES SQL DATA. The statement is not allowed in a function or procedure. The SQL function attempted to read data, but the function was not defined as READS SQL DATA. The function did not execute a RETURN statement.

SQLCODE Values -577 -751 -579 -578

Table 25. Class Code 34: Invalid Cursor Name SQLSTATE Meaning Value 34000 Cursor name is invalid.

SQLCODE Values -504

Table 26. Class Code 35: Invalid Condition Number SQLSTATE Meaning Value 35000 Condition number is invalid.

SQLCODE Values -393

Table 27. Class Code 36: Cursor Sensitivity Exception SQLSTATE Meaning Value 36001 A SENSITIVE cursor cannot be defined for the specified selectstatement.

SQLCODE Values -243

Table 28. Class Code 38: External Function Exception SQLSTATE Meaning Value 38xxx 38001 38002 38003 38004 38501 Valid error SQLSTATEs returned by an external routine or trigger. The external routine is not allowed to execute SQL statements. The external routine attempted to modify data, but the routine was not defined as MODIFIES SQL DATA. The statement is not allowed in a routine. The external routine attempted to read data, but the routine was not defined as READS SQL DATA. Error occurred while calling a user-defined function, external procedure, or trigger (using the SIMPLE CALL or SIMPLE CALL WITH NULLS calling convention).

SQLCODE Values -443 -487 -577 -751 -579 -443, -4302

Table 29. Class Code 39: External Function Call Exception

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 10 of 23

SQLSTATE Value 39004

Meaning A null value is not allowed for an IN or INOUT argument when using PARAMETER STYLE GENERAL or an argument that is a Java primitive type.

SQLCODE Values -470, -20205

Table 30. Class Code 3B: Savepoint Exception SQLSTATE Meaning Value 3B001 3B002 3B501 3B502 The savepoint is not valid. The maximum number of savepoints has been reached. A duplicate savepoint name was detected.

SQLCODE Values -880 -20112 -881

A RELEASE or ROLLBACK TO SAVEPOINT was specified, but -882 a savepoint does not exist.

Table 31. Class Code 3C: Ambiguous Cursor Name SQLSTATE Meaning Value 3C000 The cursor name is ambiguous.

SQLCODE Values -051

Table 32. Class Code 3F: Invalid Schema (Collection) Name SQLSTATE Meaning Value 3F000 The schema (collection) name is invalid.

SQLCODE Values -713

Table 33. Class Code 42: Syntax Error or Access Rule Violation SQLSTATE Meaning Value 42501 42502 42506 42601 The authorization ID does not have the privilege to perform the specified operation on the identified object. The authorization ID does not have the privilege to perform the operation as specified. Owner authorization failure occurred. A character, token, or clause is invalid or missing.

SQLCODE Values -551 -552 -30053 -007, -011, 029, -097, -104, -109, -115, 128, -199, -441, -491 -113, -251 -010

42602 42603

A character that is invalid in a name has been detected. An unterminated string constant has been detected.

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 11 of 23

SQLSTATE Value 42604 42605 42606 42607 42609 42610 42611 42612 42613 42614 42615 42616 42617 42618 42620 42621 42622 42623 42625 42629 42631 42701 42702 42703 42704 42705 42707 42709

Meaning An invalid numeric or string constant has been detected. The number of arguments specified for a scalar function is invalid. An invalid hexadecimal constant has been detected. An operand of a column function or CONCAT operator is invalid. All operands of an operator or predicate are parameter markers. A parameter marker is not allowed. The column or argument definition is invalid. The statement string is an SQL statement that is not acceptable in the context in which it is presented. Clauses are mutually exclusive. A duplicate keyword or clause is invalid. An invalid alternative was detected. Invalid options are specified. The statement string is blank or empty. A host variable is not allowed. Read-only SCROLL was specified with the UPDATE clause. The check constraint generated column expression is invalid. A name or label is too long. A DEFAULT clause cannot be specified. A CASE expression is invalid. Parameter names must be specified for SQL routines. An expression must be specified on a RETURN statement in an SQL function. A duplicate column name in an INSERT or UPDATE operation or the SET transition-variable was detected. A column reference is ambiguous, because of duplicate names. An undefined column or parameter name was detected. An undefined object or constraint name was detected. An undefined server-name was detected. A column name in ORDER BY does not identify a column of the result table. A duplicate column name was specified in a key column list.

SQLCODE Values -103, -105 -170 -110 -112 -417 -184, -418 -106, -604 -084 -628 -637 -644 -5047 -198 -090, -312, 5012, -5024 -228 -546 -107 -373 -580 -078 -057 -121 -203 -205, -206, 213, -5001 -204 -950 -208 -537

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 12 of 23

SQLSTATE Value 42710 42711 42712 42713 42718 42723 42724

Meaning A duplicate object or constraint name was detected. A duplicate column name was detected in the object definition or ALTER TABLE statement. A duplicate table designator was detected in the FROM clause or REFERENCING clause of a CREATE TRIGGER statement. A duplicate object was detected in a list or is the same as an existing object. The local server name is not defined. A function with the same signature already exists in the schema. Unable to access an external program used for a user-defined function or a procedure.

SQLCODE Values -456, -601 -612 -212 -242 -250 -454 -444, -4300, 4303, -4304, 4306

42725

A routine or method was referenced directly (not by either signature -476 or by specific instance name), but there is more than one specific instance of that routine or method. Duplicate names for common table expressions were detected. A duplicate schema name in the SET CURRENT PATH statement was detected. -340 -585

42726 42732 42733

A procedure with the specified name cannot be added to the schema -484 because the procedure overloading is not allowed in this database and there is already a procedure with the same name in the schema. A duplicate parameter-name, SQL variable name, label, or condition-name was detected. -590

42734 42736 42737 42738 42802 42803

The label specified on the GOTO, ITERATE, or LEAVE statement -779 is not found or not valid. The condition specified is not defined. A duplicate column name or unnamed column was specified in a DECLARE CURSOR statement of a FOR statement. -781 -783

The number of insert or update values is not the same as the number -117 of columns. A column reference in the SELECT or HAVING clause is invalid, because it is not a grouping column; or a column reference in the GROUP BY clause is invalid. The result expressions in a CASE expression are not compatible. An integer in the ORDER BY clause does not identify a column of the result table. A value cannot be assigned to a host variable, because the data types are not compatible. -119, -122

42804 42805 42806

-581 -125 -303

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 13 of 23

SQLSTATE Value 42807 42808 42809 42810 42811 42812 42813 42814 42815

Meaning The INSERT, UPDATE, or DELETE is not permitted on this object. A column identified in the INSERT or UPDATE operation is not updatable.

SQLCODE Values -150, -155 -151

The identified object is not the type of object to which the statement -152, -156, -159 applies. A base table is not identified in a FOREIGN KEY clause. The number of columns specified is not the same as the number of columns in the SELECT clause. A library name is required in CREATE TABLE in the system naming mode. WITH CHECK OPTION cannot be used for the specified view. -157 -158 -5002 -160

The column cannot be dropped, because it is the only column in the -195 table. The data type, length, scale, value, or CCSID is invalid. -060, -171, 451, -713, -846, -5005 -182, -187 -196

42816 42817

A datetime value or duration in an expression is invalid. The column cannot be dropped, because RESTRICT was specified and a view or constraint is dependent on the column or the column is part of a partitioning key. The operands of an operator or function are not compatible. An operand of an arithmetic operation or an operand of a function that requires a number is not a number. A numeric constant is too long, or it has a value that is not within the range of its data type. A data type for an assignment to a column or variable is not compatible with the data type. An expression in the ORDER BY clause or GROUP BY clause is not valid.

42818 42819 42820 42821 42822 42823 42824 42825 42826

-131, -401 -402 -405, -410 -408 -214

Multiple columns are returned from a subquery that only allows one -412 column. An operand of LIKE is not a string, or the first operand is not a column. The rows of UNION, INTERSECT, EXCEPT, or VALUES do not have compatible columns. The rows of UNION, INTERSECT, EXCEPT, or VALUES do not have the same number of columns. -132, -414 -415 -421

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 14 of 23

SQLSTATE Value 42827 42828 42829 42830 42832 42833 42834 42835 42836 42837 42841 42842 42845 42846 42847 42848 42850 42851 42852 42854

Meaning The table identified in the UPDATE or DELETE is not the same table designated by the cursor. The table designated by the cursor of the UPDATE or DELETE statement cannot be modified, or the cursor is read-only.

SQLCODE Values -509 -510, -520

FOR UPDATE OF is invalid, because the result table designated by -511 the cursor cannot be modified. The foreign key does not conform to the description of the parent key. The operation is not allowed on system objects. The qualified object name is inconsistent with the naming option. SET NULL cannot be specified, because no column of the foreign key can be assigned the null value. Cyclic references cannot be specified between named derived tables. The specification of a recursive, named derived table is invalid. The column cannot be altered, because its attributes are not compatible with the current column attributes. A parameter marker can not be a user-defined type or reference type. A column or parameter definition is invalid, because a specified option is inconsistent with the column description. An invalid use of a NOT DETERMINISTIC or EXTERNAL ACTION function was detected. Cast from source type to target type is not supported. An OVRDBF command was issued for one of the referenced files, but one of the parameters is not valid for SQL. Isolation level CS WITH KEEP LOCKS is not allowed. A logical file is invalid in CREATE VIEW. A referenced file is not a table, view, or physical file. The privileges specified in GRANT or REVOKE are invalid or inconsistent. (For example, GRANT ALTER on a view.) A result column data type in the select list is not compatible with the defined type in a typed view or materialized query table definition. -538 -607 -5016 -629 -341 -346 -190 -432 -683 -583 -461 -7002 -194 -7010 -7011 -557 -20055

42855

The assignment of the LOB to this host variable is not allowed. The -392 target host variable for all fetches of this LOB value for This cursor must be a locator or LOB variable.

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 15 of 23

SQLSTATE Value 42857 42858 42860 42862 42863 42866

Meaning A referenced file has more than one format. Operation cannot be applied to the specified object. The constraint cannot be dropped because it is enforcing a primary key or ROWID. An extended dynamic statement cannot be executed against a nonextended dynamic package. An undefined host variable in REXX has been detected.

SQLCODE Values -7003 -7001 -784 -827 -306

The data type in either the RETURNS clause or the CAST FROM -475 clause in the CREATE FUNCTION statement is not appropriate for the data type returned from the sourced function or RETURN statement in the function body. FETCH statement clauses are incompatible with the cursor definition. -225

42872 42873 42874 42875 42876 42877 42878 42879

An invalid number of rows was specified in a multiple-row FETCH -221 or multiple-row INSERT. ALWCPYDTA(*NO) was specified, but a copy is necessary to implement the select-statement. The schema-name portion of a qualified name must be the same name as the schema name. Different CCSIDs for keys in CREATE INDEX are only allowed with a *HEX sort sequence. The column name cannot be qualified. An invalid function or procedure name was used with the EXTERNAL keyword. -527 -5051 -7024 -197 -449

The data type of one or more input parameters in the CREATE -492 FUNCTION statement is not appropriate for the corresponding data type in the source function. The CAST TO and CAST FROM data types are incompatible, or would always result in truncation of a fixed string. Invalid use of a function. The specific instance name qualifier is not equal to the function name qualifier. No function or method was found with a matching signature. No routine was found with the specified name and compatible arguments. The number of input parameters specified on a CREATE FUNCTION statement does not match the number provided by the function named in the SOURCE clause. -453 -391 -455 -458 -440 -483

42880 42881 42882 42883 42884 42885

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 16 of 23

SQLSTATE Value 42886 42887 42888 42889 42890

Meaning The IN, OUT, or INOUT parameter attributes do not match. The function is not valid in the context where it occurs. The table does not have a primary key. The table already has a primary key. A column list was specified in the references clause, but the identified parent table does not have a unique constraint with the specified column names. A duplicate UNIQUE constraint already exists. The referential constraint and trigger are not allowed, because the DELETE rule and trigger event are not compatible. The object or constraint cannot be dropped or authorities cannot be revoked from the object, because other objects are dependent on it. The value of a column or sequence attribute is invalid. For static SQL, an input host variable cannot be used, because its data type is not compatible with the parameter of a procedure or user-defined function. The ASP number is invalid. An invalid correlated reference or transition table was detected in a trigger. Correlated references and column names are not allowed for triggered actions with the FOR EACH STATEMENT clause. Unable to access a file referenced by a file reference variable. An invalid SQLSTATE was specified. A number specified in an SQL statement is out of the valid range. The name specified on a rename is not valid. WITHOUT RETURN cursors must not be specified in SET RESULT SETS. Only one ROWID or IDENTITY column can be specified for a table. A ROWID or reference column specification is not valid. A ROWID or IDENTITY column cannot be specified as the target column of an INSERT or UPDATE. Unable to access a file referenced by a DATALINK value. AS LOCATOR cannot be specified for a non-LOB parameter. A cursor specified in a FOR statement cannot be referenced in an OPEN, CLOSE, or FETCH statement.

SQLCODE Values -469 -390 -539 -624 -573

42891 42892 42893 42894 42895

-541 -675 -478, -616 -574 -301

42896 42898 42899 428A1 428B3 428B7 428B8 428BA 428C1 428C7 428C9 428D1 428D2 428D4

-7026 -696 -697 -452 -435 -490 -7029 -20236 -372 -771 -798 -358 -398 -776

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 17 of 23

SQLSTATE Value 428D5 428D6 428D7 428D8 428EC 428EK 428EW 428F1 428F2 428F9 428FA 428FC 428FD 428FE 428FR 428FT 428FY 428G0 428G2 42903 42904 42906 42907 42908 42910 42911 42912

Meaning The ending label does not match the beginning label. UNDO is not allowed for NOT ATOMIC compound statements. The condition value is not allowed. The sqlcode or sqlstate variable declaration is not valid. The qualifier for a declared global temporary table name or an index on a declared global temporary table must be SESSION. An SQL TABLE function must return a table result.

SQLCODE Values -778 -780 -782 -785 -079

The fullselect specified for the materialized query table is not valid. -20058

The table cannot be converted to or from a materialized query table. -20093 -20120 An integer expression must be specified on a RETURN statement in -058 an SQL procedure. A sequence expression cannot be specified in this context. The scale of the decimal number must be zero. The length of the encryption password is not valid. The password used for decryption does not match the password used to encrypt the data. The data is not a result of the ENCRYPT function. A column cannot be altered as specified. The table is not compatible with the specified data partitioning operation. A column cannot be added, dropped, or altered in a materialized query table. A logical file prevents the alter of the partition attributes. The last data partition cannot be dropped from the table. Invalid use of an aggregate function or OLAP function. The SQL procedure was not created because of a compile error. A column function in a subquery of a HAVING clause includes an expression that applies an operator to a correlated reference. The string is too long. The statement does not include a required column list. The statement is not allowed in a Compound statement. A decimal divide operation is invalid, because the result would have a negative scale. A column cannot be updated, because it is not identified in the UPDATE clause of the select-statement of the cursor. -348 -336 -20144 -20145 -20146 -20180 -20183 -20235 -20246 -20251 -120 -7032 -133 -134 -153 -775 -419 -503

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 18 of 23

SQLSTATE Value 42914 42917 42918 42919 42922 42923 42924 42926 42929 42930 42932 42937 42939 42944 42961 42962 42969

Meaning The DELETE is invalid, because a table referenced in a subquery can be affected by the operation. The object cannot be explicitly dropped or altered. A user-defined data type cannot be created with a system-defined data type name (for example, INTEGER). Nested compound statements are not allowed. DROP SCHEMA cannot be executed under commitment control. Program or package must be recreated to reference an alias-name. An alias resolved to another alias rather than a table or view at the remote location. Locators are not allowed with COMMIT(*NONE). FOR ALL PARTITIONS is not allowed for an encoded vector index.

SQLCODE Values -536 -658 -473 -777 -5003 -7033 -513 -7034 -20243

The same column was identified in FOR UPDATE OF and ORDER -5021 BY. The program preparation assumptions are incorrect. The parameter must not have a subtype of mixed. The name cannot be used, because the specified identifier is reserved for system use. The authorization ID cannot be both an owner and primary group owner. The server name specified does not match the current server. A long column, LOB column, structured type column or datalink column cannot be used in an index, a key, or a constraint. The package was not created and the current unit of work was rolled back, because of internal limitations or an invalid section number. -30052 -192 -457, -707 -7028 -114 -350 -7020

42970 42971

COMMIT HOLD or ROLLBACK HOLD is only allowed to a DB2 -7018 UDB for iSeries application server. SQL statements cannot be executed under commitment control, because commitment control is already active to another relational database. An expression in a join-condition or ON clause of a MERGE statement references columns in more than one of the operand tables. The authorization ID cannot be changed when connecting to the local server. -7017

42972

-338

42977

-7022

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 19 of 23

SQLSTATE Value 42978 42981 42984

Meaning An indicator variable is not a small integer. CREATE SCHEMA is not allowed if changes are pending in the unit of work. The privilege cannot be granted to the view, because *OBJOPR or *OBJMGT authority exists on a dependent view or table, and the grantee does not have *ALLOBJ or the specified privilege on the dependent table or view. The statement is not allowed in a routine. The statement is not allowed in a trigger. A unique index or unique constraint is not allowed because the key columns are not a superset of the partitioned key columns. The requested function does not apply to global temporary tables. The partition key cannot be a datetime or floating-point column. A referential constraint is not allowed because the foreign key columns are not a superset of the partitioned key columns or the node group is not the same as the parent table. The query is not allowed on a distributed table or view. Rows from a distributed table cannot be redistributed because the table contains a datalink column with FILE LINK CONTROL. A referential constraint with a delete rule of CASCADE is not allowed on a table with a DataLink column with FILE LINK CONTROL. RETURN must be the last SQL statement of the atomic compound statement within an SQL row or table function. A partitioned table cannot contain an identity column. The ICU sort sequence cannot be used in this context.

SQLCODE Values -080 -7941 -7027

42985 42987 42990 42995 42996 42998

-577, -579, -751 -751 -270 -526 -328 -256

42999 429B6 429B7

-255 -7037 -7038

429BD 429BH 429BM

-20148 -20247 -20268

Table 34. Class Code 44: WITH CHECK OPTION Violation SQLSTATE Meaning Value 44000 The INSERT or UPDATE is not allowed, because a resulting row does not satisfy the view definition.

SQLCODE Values -161

Table 35. Class Code 46: Java Errors SQLSTATE Value 46001

Meaning

SQLCODE Values -20200

The URL specified on an install or replace of a jar procedure did not identify a valid jar file.

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 20 of 23

SQLSTATE Value 46002 46003 46007 46008 46501

Meaning The jar name specified on the install, replace, or remove of a Java procedure is not valid. The jar file cannot be removed, a class is in use by a procedure. A Java function has a Java method with an invalid signature. A Java function cannot map to a single Java method. The install or remove jar procedure for "<jar-id>" specified the use of a deployment descriptor.

SQLCODE Values -20201 -20202 -20203 -20204 -20207

Table 36. Class Code 51: Invalid Application State SQLSTATE Meaning Value 51002 51003 51004 51009 51015 51021 51035 51036 51037 51039 The package corresponding to an SQL statement execution request was not found. Consistency tokens do not match. An address in the SQLDA is invalid. COMMIT or ROLLBACK is not allowed, because commitment control has not been started. An attempt was made to execute a section that was found to be in error at bind time. SQL statements cannot be executed until the application process executes a rollback operation. A PREVVAL expression cannot be used because a value has not been generated for the sequence yet in this session. An implicit connect to a remote server is not allowed because a savepoint is outstanding. The operation is not allowed because a trigger has been marked inoperative. The ENCRYPTION PASSWORD value is not set.

SQLCODE Values -805 -818 -822 -7007 -525 -918 -845 -20110 -7048 -20143

Table 37. Class Code 53: Invalid Operand or Inconsistent Specification SQLSTATE Meaning Value 53038 53039 53045 The number of key limit values is zero or greater than the number of columns in the key. The PART clause of the ALTER statement is omitted or invalid. The data type of the key limit constant is not the same as the data type of the column.

SQLCODE Values -663 -665 -678

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 21 of 23

Table 38. Class Code 54: SQL or Product Limit Exceeded SQLSTATE Meaning Value 54001 54002 54004 54005 54006 54008 54009 54010 54011 54018 54019 54021 54023 54028 54035 54038 54044 54054 The statement is too long or too complex. A string constant is too long. The statement has too many table names or too many items in a SELECT or INSERT list. The sort key is too long, or has too many columns. The result of concatenation is too long. The key is too long, a column of the key is too long, or the key many columns. Too many users were specified in GRANT or REVOKE. The record length of the table is too long. Too many columns were specified for a table, view, or table function. The row is too long. The maximum number of late descriptors has been exceeded, probably because too many different CCSIDs were used. Too many constraints, or the size of the constraint is too large. The limit for the number of parameters or arguments for a function or a procedure has been exceeded. The maximum number of concurrent LOB handles has been reached. An internal object limit exceeded. Maximum depth of nested routines or triggers was exceeded.

SQLCODE Values -101 -102 -129, -840 -136 -137 -602, -613, 614, -631 -5017 -101 -101, -680 -809 -871 -642 -442, -448 -429 -7049 -724

A multiple-byte (UCS-2) sort sequence table cannot be supported in -7031 DRDA because it is too large. The combination of the number of table space partitions and the corresponding length of the partitioning limit key it too large. -4701

Table 39. Class Code 55: Object Not in Prerequisite State SQLSTATE Meaning Value 55005 55006 55007 Recursion is only supported to a DB2 UDB for iSeries application server. The object cannot be dropped, because it is currently in use by the same application process. The object cannot be altered, because it is currently in use by the same application process.

SQLCODE Values -145 -615, -950 -951

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 22 of 23

SQLSTATE Value 55018 55019 55029 55042 55048 55050

Meaning The schema cannot be dropped, because it is in the library list. The object is in an invalid state for the operation. Local program attempted to connect to a remote database. The alias is not allowed because it identifies a single member of a multiple member file. Encrypted data cannot be encrypted. An object cannot be created into a protected schema.

SQLCODE Values -7006 -7008, -20054 -862 -7030 -20147 -7052

Table 40. Class Code 56: Miscellaneous SQL or Product Error SQLSTATE Meaning Value 56016 56084 56095 560BF 560C4 The ranges specified for data partitions are not valid.

SQLCODE Values -636

An unsupported SQLTYPE was encountered in a select list or input -351, -352 list. A bind option is invalid. The encryption and decryption facility has not been installed. The option is not valid for the ARD interface. -30104 -20223 -5027, -5028

Table 41. Class Code 57: Resource Not Available or Operator Intervention SQLSTATE Meaning Value 57005 57006 57007 57011 57012 57013 57014 57017 57033 57042 The statement cannot be executed, because a utility or a governor time limit was exceeded. The object cannot be created, because a DROP or CREATE is pending. The object cannot be used, because an operation is pending. Virtual storage or database resource is not available. A non-database resource is not available. This will not affect the successful execution of subsequent statements. A non-database resource is not available. This will affect the successful execution of subsequent statements. Processing was canceled as requested. Character conversion is not defined. Deadlock or timeout occurred without automatic rollback. DDM recursion has occurred.

SQLCODE Values -666 -679 -910 -904, -971, 7053 -30040 -30041 -952 -332 -913 -30001

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011

Listing of SQLSTATE values

Page 23 of 23

SQLSTATE Value 57043 57050

Meaning A local SQL application program cannot be executed on an application server. The file server is not currently available.

SQLCODE Values -7021 -357

Table 42. Class Code 58: System Error SQLSTATE Value 58003 58004 58008

Meaning

SQLCODE Values -144 -901, -4301 -30000

An invalid section number was detected. A system error (that does not necessarily preclude the successful execution of subsequent SQL statements) occurred. Execution failed due to a distribution protocol error that will not affect the successful execution of subsequent DDM commands or SQL statements. Execution failed due to a distribution protocol error that caused deallocation of the conversation. Execution failed due to a distribution protocol error that will affect the successful execution of subsequent DDM commands or SQL statements. The DDM command is invalid while the bind process in progress. The bind process with the specified package name and consistency token is not active. The DDM command is not supported. The DDM object is not supported. The DDM parameter is not supported. The DDM parameter value is not supported. The DDM reply message is not supported.

58009 58010

-30020 -30021

58011 58012 58014 58015 58016 58017 58018 58028 58033

-30050 -30051 -30070 -30071 -30072 -30073 -30074

The commit operation failed, because a resource in the unit of work -175 was not able to commit its resources. An unexpected error occurred while attempting to access a client driver. -969

Parent topic: SQLCODE and SQLSTATE concepts

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/rzala/rzalaccl.htm

5/10/2011