DB2的SQLSTATE值

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 Value Meaning SQLCODE Values
00000 Completion of the operation was successful and did not result in any type of warning or exception condition. +000

 

Table 2.  Class Code 01: Warning
SQLSTATE Value Meaning SQLCODE Values
01002 A DISCONNECT error occurred. +596
01003 Null values were eliminated from the argument of a column function. +000
01004 The value of a string was truncated when assigned to another string data type with a shorter length. +000, +445, +802, +20141
01005 Insufficient number of entries in an SQLDA. +239
01006 A privilege was not revoked. +569
01007 A privilege was not granted. +570
01009 The search condition is too long for the information schema. +177
0100A The query expression of the view is too long for the information schema. +178
0100C One or more ad hoc result sets were returned from the procedure. +466
0100D The cursor that was closed has been reopened on the next result set within the chain. +467
0100E The procedure returned too many result sets. +464, +20206
01503 The number of result columns is larger than the number of host variables provided. +000, +030
01504 The UPDATE or DELETE statement does not include a WHERE clause. +000, +088
01505 The statement was not executed because it is unacceptable in this environment. +084
01506 An adjustment was made to a DATE or TIMESTAMP value to correct an invalid date resulting from an arithmetic operation. +000
01515 The null value has been assigned to a host variable, because the non-null value of the column is not within the range of the host variable. +304
01517 A character that cannot be converted was replaced with a substitute character. +335
01519 The null value has been assigned to a host variable, because a numeric value is out of range. +802
01520 The null value has been assigned to a host variable, because the characters cannot be converted. +331
01522 The local table or view name used in the CREATE ALIAS statement is undefined. +403
01526 Isolation level has been escalated. +595
01528 WHERE NOT NULL is ignored, because the index key cannot contain null values. +645
01532 An undefined object name was detected. +204
01534 The string representation of a datetime value is invalid. +180, +181
01535 An arithmetic operation on a date or timestamp has a result that is not within the valid range of dates. +183
01536 During remote bind where existence checking is deferred, the server-name specified does not match the current server. +114
01539 Connection is successful but only SBCS characters should be used. +863
01542 Authorization ID does not have the privilege to perform the operation as specified. +552
01544 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. +138
01545 An unqualified column name has been interpreted as a correlated reference. +012
01547 A mixed data value is improperly formed. +191, +304, +802
01548 The authorization ID does not have the privilege to perform the specified operation on the identified object. +551
01557 Too many host variables have been specified on SELECT INTO or FETCH. +326
01564 The null value has been assigned to a host variable, because division by zero occurred. +802
01565 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 function is invalid; a floating-point NAN (not a number) or invalid data in a packed decimal field was detected. +304, +420, +802
01567 The table was created but not journaled. +7905
01587 The unit of work was committed or rolled back, but the outcome is not fully known at all sites. +990
01593 An ALTER TABLE may cause data truncation. +460
01594 Insufficient number of entries in an SQLDA for ALL information (i.e. not enough descriptors to return the distinct name). +237
01627 The DATALINK value may not be valid because the table is in reconcile pending or reconcile is not a possible state. +360
01634 The distinct data type name is too long and cannot be returned in the SQLDA. The short name is returned instead. +7036
01643 Assignment to SQLCODE or SQLSTATE variable does not signal a warning or error. +385
01646 A result sets cannot be returned because the cursor was closed. +7050
01647 A DB2SQL BEFORE trigger changed to DB2ROW. +7051
01658 Binary data is invalid for DECRYPT_CHAR and DECYRYPT_DB. +20224
01660 The routine was created but a restore will not update the catalog. +7909
01662 Release record option ignored on CLOSE. +30107
01Hxx Valid warning SQLSTATEs returned by a user-defined function or external procedure CALL. +462

 

Table 3.  Class Code 02: No Data
SQLSTATE Value Meaning SQLCODE Values
02000 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.
+100
02001 No additional result sets returned. +387

 

Table 4.  Class Code 07: Dynamic SQL Error
SQLSTATE Value Meaning SQLCODE Values
07001 The number of host variables is not correct for the number of parameter markers. -313
07002 The call parameter list or control block is invalid. -804
07003 The statement identified in the EXECUTE statement is a select-statement, or is not in a prepared state. -518
07004 The USING clause or INTO clause is required for dynamic parameters. -313
07005 The statement name of the cursor identifies a prepared statement that cannot be associated with a cursor. -517
07006 An input host variable, transition variable, or parameter marker cannot be used, because of its data type. -301

 

Table 5.  Class Code 08: Connection Exception
SQLSTATE Value Meaning SQLCODE Values
08001 The application requester is unable to establish the connection. -30080, -30082, -30089
08002 The connection already exists. -842
08003 The connection does not exist. -843, -900
08004 The application server rejected establishment of the connection. -30060, -30061
08501 A DISCONNECT is not allowed when the connection uses an LU6.2 protected conversation. -858

 

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

 

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

 

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

 

Table 9.  Class Code 0F: Invalid Token
SQLSTATE Value Meaning SQLCODE Values
0F001 The locator value does not currently represent any value. -423

 

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

 

Start of change
Table 11.  Class Code 0W: Prohibited Statement Encountered During Trigger
SQLSTATE Value Meaning SQLCODE Values
0W000 The statement is not allowed in a trigger. -751
End of change

 

Start of change
Table 12.  Class Code 0Z: Diagnostics Exception
SQLSTATE Value Meaning SQLCODE Values
0Z001 Maximum number of stacked diagnostics areas exceeded. -20226
0Z002 Stacked diagnostics accessed without and active handler. -20228
End of change
Table 13.  Class Code 20: Case Not Found for Case Statement
SQLSTATE Value Meaning SQLCODE Values
20000 The case was not found for the CASE statement. -773

 

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

 

Table 15.  Class Code 22: Data Exception
SQLSTATE Value Meaning SQLCODE Values
22001 Character data, right truncation occurred; for example, an update or insert value is a string that is too long for the column, or a datetime value cannot be assigned to a host variable, because it is too small. -302, -303, -404, -433, -802
22002 A null value, or the absence of an indicator parameter was detected; for example, the null value cannot be assigned to a host variable, because no indicator variable is specified. -305
22003 A numeric value is out of range. -302, -304, -406, -446, -802
22004 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. -305
22006 The fetch orientation is invalid. -231
22007 An invalid datetime format was detected; that is, an invalid string representation or value was specified. -180, -181
22008 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. -183
22011 A substring error occurred; for example, an argument of SUBSTR is out of range. -138
22012 Division by zero is invalid. -802
22018 The character value for the CAST, DECIMAL, FLOAT, or INTEGER scalar function is invalid. -420
22019 The LIKE predicate has an invalid escape character. -130
22021 A character is not in the coded character set or the conversion is not supported. -330, -331
22023 A parameter or host variable value is invalid. -302, -304, -406, -802
22024 A NUL-terminated input host variable or parameter did not contain a NUL. -302
22025 The LIKE predicate string pattern contains an invalid occurrence of an escape character. -130
22501 The length control field of a variable length string is negative or greater than the maximum. -311
22503 The string representation of a name is invalid. -188
22504 A mixed data value is invalid. -191, -304, -406, -802
22511 ADT length exceeds maximum column length. The value for a ROWID or reference column is not valid. -399
22522 A CCSID value is not valid at all, not valid for the data type or subtype, or not valid for the encoding scheme. -189
22524 Character conversion resulted in truncation -334
22525 Partitioning key value is not valid. -327

 

Table 16.  Class Code 23: Constraint Violation
SQLSTATE Value Meaning SQLCODE Values
23001 The update or delete of a parent key is prevented by a RESTRICT update or delete rule. -531, -532
23502 An insert or update value is null, but the column cannot contain null values. -407
23503 The insert or update value of a foreign key is invalid. -530
23504 The update or delete of a parent key is prevented by a NO ACTION update or delete rule. -531, -532
23505 A violation of the constraint imposed by a unique index or a unique constraint occurred. -803
23511 A parent row cannot be deleted, because the check constraint restricts the deletion. -543
23512 The check constraint cannot be added, because the table contains rows that do not satisfy the constraint definition. -544
23513 The resulting row of the INSERT or UPDATE does not conform to the check constraint definition. -545
23515 The unique index cannot be created or unique constraint added because the table contains duplicate values of the specified key. -603
23520 The foreign key cannot be defined, because all of its values are not equal to a parent key of the parent table. -667
23522 The range of values for the identity column or sequence is exhausted. -359

 

Table 17.  Class Code 24: Invalid Cursor State
SQLSTATE Value Meaning SQLCODE Values
24501 The identified cursor is not open. -501, -507
24502 The cursor identified in an OPEN statement is already open. -502
24504 The cursor identified in the UPDATE, DELETE, SET, or GET statement is not positioned on a row. -508
24506 The statement identified in the PREPARE is the statement of an open cursor. -519
24507 FETCH CURRENT was specified, but the current row is deleted, or a value of an ORDER BY column of the current row has changed. -226
24513 FETCH NEXT, PRIOR, CURRENT, or RELATIVE is not allowed, because the cursor position is not known. -227
24514 A previous error has disabled this cursor. -906

 

Table 18.  Class Code 25: Invalid Transaction State
SQLSTATE Value Meaning SQLCODE Values
25000 An update operation is invalid for the application execution environment. -30090
25006 An update operation is not valid because the transaction is read only. -817
25501 The statement is only allowed as the first statement in a unit of work. -428

 

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

 

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

 

Table 21.  Class Code 28: Invalid Authorization Specification
SQLSTATE Value Meaning SQLCODE Values
28000 Authorization name is invalid. -113, -188

 

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

 

Table 23.  Class Code 2E: Invalid Connection Name
SQLSTATE Value Meaning SQLCODE Values
2E000 Connection name is invalid. -113, -188, -251

 

Table 24.  Class Code 2F: SQL Function Exception
SQLSTATE Value Meaning SQLCODE Values
2F002 The SQL function attempted to modify data, but the function was not defined as MODIFIES SQL DATA. -577
2F003 The statement is not allowed in a function or procedure. -751
2F004 The SQL function attempted to read data, but the function was not defined as READS SQL DATA. -579
2F005 The function did not execute a RETURN statement. -578

 

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

 

Start of change
Table 26.  Class Code 35: Invalid Condition Number
SQLSTATE Value Meaning SQLCODE Values
35000 Condition number is invalid. -393
End of change

 

Start of change
Table 27.  Class Code 36: Cursor Sensitivity Exception
SQLSTATE Value Meaning SQLCODE Values
36001 A SENSITIVE cursor cannot be defined for the specified select-statement. -243
End of change

 

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

 

Table 29.  Class Code 39: External Function Call Exception
SQLSTATE Value Meaning SQLCODE Values
39004 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. -470, -20205

 

Table 30.  Class Code 3B: Savepoint Exception
SQLSTATE Value Meaning SQLCODE Values
3B001 The savepoint is not valid. -880
3B002 The maximum number of savepoints has been reached. -20112
3B501 A duplicate savepoint name was detected. -881
3B502 A RELEASE or ROLLBACK TO SAVEPOINT was specified, but a savepoint does not exist. -882

 

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

 

Start of change
Table 32.  Class Code 3F: Invalid Schema (Collection) Name
SQLSTATE Value Meaning SQLCODE Values
3F000 The schema (collection) name is invalid. -713
End of change

 

Table 33.  Class Code 42: Syntax Error or Access Rule Violation
SQLSTATE Value Meaning SQLCODE Values
42501 The authorization ID does not have the privilege to perform the specified operation on the identified object. -551
42502 The authorization ID does not have the privilege to perform the operation as specified. -552
42506 Owner authorization failure occurred. -30053
42601 A character, token, or clause is invalid or missing. -007, -011, -029, -097, -104, -109, -115, -128, -199, -441, -491
42602 A character that is invalid in a name has been detected. -113, -251
42603 An unterminated string constant has been detected. -010
42604 An invalid numeric or string constant has been detected. -103, -105
42605 The number of arguments specified for a scalar function is invalid. -170
42606 An invalid hexadecimal constant has been detected. -110
42607 An operand of a column function or CONCAT operator is invalid. -112
42609 All operands of an operator or predicate are parameter markers. -417
42610 A parameter marker is not allowed. -184, -418
42611 The column or argument definition is invalid. -106, -604
42612 The statement string is an SQL statement that is not acceptable in the context in which it is presented. -084
42613 Clauses are mutually exclusive. -628
42614 A duplicate keyword or clause is invalid. -637
42615 An invalid alternative was detected. -644
42616 Invalid options are specified. -5047
42617 The statement string is blank or empty. -198
42618 A host variable is not allowed. -090, -312, -5012, -5024
42620 Read-only SCROLL was specified with the UPDATE clause. -228
42621 The check constraint generated column expression is invalid. -546
42622 A name or label is too long. -107
42623 A DEFAULT clause cannot be specified. -373
42625 A CASE expression is invalid. -580
42629 Parameter names must be specified for SQL routines. -078
42631 An expression must be specified on a RETURN statement in an SQL function. -057
42701 A duplicate column name in an INSERT or UPDATE operation or the SET transition-variable was detected. -121
42702 A column reference is ambiguous, because of duplicate names. -203
42703 An undefined column or parameter name was detected. -205, -206, -213, -5001
42704 An undefined object or constraint name was detected. -204
42705 An undefined server-name was detected. -950
42707 A column name in ORDER BY does not identify a column of the result table. -208
42709 A duplicate column name was specified in a key column list. -537
42710 A duplicate object or constraint name was detected. -456, -601
42711 A duplicate column name was detected in the object definition or ALTER TABLE statement. -612
42712 A duplicate table designator was detected in the FROM clause or REFERENCING clause of a CREATE TRIGGER statement. -212
42713 A duplicate object was detected in a list or is the same as an existing object. -242
42718 The local server name is not defined. -250
42723 A function with the same signature already exists in the schema. -454
42724 Unable to access an external program used for a user-defined function or a procedure. -444, -4300, -4303, -4304, -4306
42725 A routine or method was referenced directly (not by either signature or by specific instance name), but there is more than one specific instance of that routine or method. -476
42726 Duplicate names for common table expressions were detected. -340
42732 A duplicate schema name in the SET CURRENT PATH statement was detected. -585
42733 A procedure with the specified name cannot be added to the schema because the procedure overloading is not allowed in this database and there is already a procedure with the same name in the schema. -484
42734 A duplicate parameter-name, SQL variable name, label, or condition-name was detected. -590
42736 The label specified on the GOTO, ITERATE, or LEAVE statement is not found or not valid. -779
42737 The condition specified is not defined. -781
42738 A duplicate column name or unnamed column was specified in a DECLARE CURSOR statement of a FOR statement. -783
42802 The number of insert or update values is not the same as the number of columns. -117
42803 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. -119, -122
42804 The result expressions in a CASE expression are not compatible. -581
42805 An integer in the ORDER BY clause does not identify a column of the result table. -125
42806 A value cannot be assigned to a host variable, because the data types are not compatible. -303
42807 The INSERT, UPDATE, or DELETE is not permitted on this object. -150, -155
42808 A column identified in the INSERT or UPDATE operation is not updatable. -151
42809 The identified object is not the type of object to which the statement applies. -152, -156, -159
42810 A base table is not identified in a FOREIGN KEY clause. -157
42811 The number of columns specified is not the same as the number of columns in the SELECT clause. -158
42812 A library name is required in CREATE TABLE in the system naming mode. -5002
42813 WITH CHECK OPTION cannot be used for the specified view. -160
42814 The column cannot be dropped, because it is the only column in the table. -195
42815 The data type, length, scale, value, or CCSID is invalid. -060, -171, -451, -713, -846, -5005
42816 A datetime value or duration in an expression is invalid. -182, -187
42817 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. -196
42818 The operands of an operator or function are not compatible. -131, -401
42819 An operand of an arithmetic operation or an operand of a function that requires a number is not a number. -402
42820 A numeric constant is too long, or it has a value that is not within the range of its data type. -405, -410
42821 A data type for an assignment to a column or variable is not compatible with the data type. -408
42822 An expression in the ORDER BY clause or GROUP BY clause is not valid. -214
42823 Multiple columns are returned from a subquery that only allows one column. -412
42824 An operand of LIKE is not a string, or the first operand is not a column. -132, -414
42825 The rows of UNION, INTERSECT, EXCEPT, or VALUES do not have compatible columns. -415
42826 The rows of UNION, INTERSECT, EXCEPT, or VALUES do not have the same number of columns. -421
42827 The table identified in the UPDATE or DELETE is not the same table designated by the cursor. -509
42828 The table designated by the cursor of the UPDATE or DELETE statement cannot be modified, or the cursor is read-only. -510, -520
42829 FOR UPDATE OF is invalid, because the result table designated by the cursor cannot be modified. -511
42830 The foreign key does not conform to the description of the parent key. -538
42832 The operation is not allowed on system objects. -607
42833 The qualified object name is inconsistent with the naming option. -5016
42834 SET NULL cannot be specified, because no column of the foreign key can be assigned the null value. -629
42835 Cyclic references cannot be specified between named derived tables. -341
42836 The specification of a recursive, named derived table is invalid. -346
42837 The column cannot be altered, because its attributes are not compatible with the current column attributes. -190
42841 A parameter marker can not be a user-defined type or reference type. -432
42842 A column or parameter definition is invalid, because a specified option is inconsistent with the column description. -683
42845 An invalid use of a NOT DETERMINISTIC or EXTERNAL ACTION function was detected. -583
42846 Cast from source type to target type is not supported. -461
42847 An OVRDBF command was issued for one of the referenced files, but one of the parameters is not valid for SQL. -7002
42848 Isolation level CS WITH KEEP LOCKS is not allowed. -194
42850 A logical file is invalid in CREATE VIEW. -7010
42851 A referenced file is not a table, view, or physical file. -7011
42852 The privileges specified in GRANT or REVOKE are invalid or inconsistent. (For example, GRANT ALTER on a view.) -557
42854 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. -20055
42855 The assignment of the LOB to this host variable is not allowed. The target host variable for all fetches of this LOB value for This cursor must be a locator or LOB variable. -392
42857 A referenced file has more than one format. -7003
42858 Operation cannot be applied to the specified object. -7001
42860 The constraint cannot be dropped because it is enforcing a primary key or ROWID. -784
42862 An extended dynamic statement cannot be executed against a non-extended dynamic package. -827
42863 An undefined host variable in REXX has been detected. -306
42866 The data type in either the RETURNS clause or the CAST FROM 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. -475
42872 FETCH statement clauses are incompatible with the cursor definition. -225
42873 An invalid number of rows was specified in a multiple-row FETCH or multiple-row INSERT. -221
42874 ALWCPYDTA(*NO) was specified, but a copy is necessary to implement the select-statement. -527
42875 The schema-name portion of a qualified name must be the same name as the schema name. -5051
42876 Different CCSIDs for keys in CREATE INDEX are only allowed with a *HEX sort sequence. -7024
42877 The column name cannot be qualified. -197
42878 An invalid function or procedure name was used with the EXTERNAL keyword. -449
42879 The data type of one or more input parameters in the CREATE FUNCTION statement is not appropriate for the corresponding data type in the source function. -492
42880 The CAST TO and CAST FROM data types are incompatible, or would always result in truncation of a fixed string. -453
42881 Invalid use of a function. -391
42882 The specific instance name qualifier is not equal to the function name qualifier. -455
42883 No function or method was found with a matching signature. -458
42884 No routine was found with the specified name and compatible arguments. -440
42885 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. -483
42886 The IN, OUT, or INOUT parameter attributes do not match. -469
42887 The function is not valid in the context where it occurs. -390
42888 The table does not have a primary key. -539
42889 The table already has a primary key. -624
42890 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. -573
42891 A duplicate UNIQUE constraint already exists. -541
42892 The referential constraint and trigger are not allowed, because the DELETE rule and trigger event are not compatible. -675
42893 The object or constraint cannot be dropped or authorities cannot be revoked from the object, because other objects are dependent on it. -478, -616
42894 The value of a column or sequence attribute is invalid. -574
42895 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. -301
42896 The ASP number is invalid. -7026
42898 An invalid correlated reference or transition table was detected in a trigger. -696
42899 Correlated references and column names are not allowed for triggered actions with the FOR EACH STATEMENT clause. -697
428A1 Unable to access a file referenced by a file reference variable. -452
428B3 An invalid SQLSTATE was specified. -435
428B7 A number specified in an SQL statement is out of the valid range. -490
428B8 The name specified on a rename is not valid. -7029
428BA WITHOUT RETURN cursors must not be specified in SET RESULT SETS. -20236
428C1 Only one ROWID or IDENTITY column can be specified for a table. -372
428C7 A ROWID or reference column specification is not valid. -771
428C9 A ROWID or IDENTITY column cannot be specified as the target column of an INSERT or UPDATE. -798
428D1 Unable to access a file referenced by a DATALINK value. -358
428D2 AS LOCATOR cannot be specified for a non-LOB parameter. -398
428D4 A cursor specified in a FOR statement cannot be referenced in an OPEN, CLOSE, or FETCH statement. -776
428D5 The ending label does not match the beginning label. -778
428D6 UNDO is not allowed for NOT ATOMIC compound statements. -780
428D7 The condition value is not allowed. -782
428D8 The sqlcode or sqlstate variable declaration is not valid. -785
428EC The fullselect specified for the materialized query table is not valid. -20058
428EK The qualifier for a declared global temporary table name or an index on a declared global temporary table must be SESSION. -079
428EW The table cannot be converted to or from a materialized query table. -20093
428F1 An SQL TABLE function must return a table result. -20120
428F2 An integer expression must be specified on a RETURN statement in an SQL procedure. -058
428F9 A sequence expression cannot be specified in this context. -348
428FA The scale of the decimal number must be zero. -336
428FC The length of the encryption password is not valid. -20144
428FD The password used for decryption does not match the password used to encrypt the data. -20145
428FE The data is not a result of the ENCRYPT function. -20146
428FR A column cannot be altered as specified. -20180
428FT The table is not compatible with the specified data partitioning operation. -20183
428FY A column cannot be added, dropped, or altered in a materialized query table. -20235
428G0 A logical file prevents the alter of the partition attributes. -20246
428G2 The last data partition cannot be dropped from the table. -20251
42903 Invalid use of an aggregate function or OLAP function. -120
42904 The SQL procedure was not created because of a compile error. -7032
42906 A column function in a subquery of a HAVING clause includes an expression that applies an operator to a correlated reference. -133
42907 The string is too long. -134
42908 The statement does not include a required column list. -153
42910 The statement is not allowed in a Compound statement. -775
42911 A decimal divide operation is invalid, because the result would have a negative scale. -419
42912 A column cannot be updated, because it is not identified in the UPDATE clause of the select-statement of the cursor. -503
42914 The DELETE is invalid, because a table referenced in a subquery can be affected by the operation. -536
42917 The object cannot be explicitly dropped or altered. -658
42918 A user-defined data type cannot be created with a system-defined data type name (for example, INTEGER). -473
42919 Nested compound statements are not allowed. -777
42922 DROP SCHEMA cannot be executed under commitment control. -5003
42923 Program or package must be recreated to reference an alias-name. -7033
42924 An alias resolved to another alias rather than a table or view at the remote location. -513
42926 Locators are not allowed with COMMIT(*NONE). -7034
42929 FOR ALL PARTITIONS is not allowed for an encoded vector index. -20243
42930 The same column was identified in FOR UPDATE OF and ORDER BY. -5021
42932 The program preparation assumptions are incorrect. -30052
42937 The parameter must not have a subtype of mixed. -192
42939 The name cannot be used, because the specified identifier is reserved for system use. -457, -707
42944 The authorization ID cannot be both an owner and primary group owner. -7028
42961 The server name specified does not match the current server. -114
42962 A long column, LOB column, structured type column or datalink column cannot be used in an index, a key, or a constraint. -350
42969 The package was not created and the current unit of work was rolled back, because of internal limitations or an invalid section number. -7020
42970 COMMIT HOLD or ROLLBACK HOLD is only allowed to a DB2 UDB for iSeries application server. -7018
42971 SQL statements cannot be executed under commitment control, because commitment control is already active to another relational database. -7017
42972 An expression in a join-condition or ON clause of a MERGE statement references columns in more than one of the operand tables. -338
42977 The authorization ID cannot be changed when connecting to the local server. -7022
42978 An indicator variable is not a small integer. -080
42981 CREATE SCHEMA is not allowed if changes are pending in the unit of work. -7941
42984 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. -7027
42985 The statement is not allowed in a routine. -577, -579, -751
42987 The statement is not allowed in a trigger. -751
42990 A unique index or unique constraint is not allowed because the key columns are not a superset of the partitioned key columns. -270
42995 The requested function does not apply to global temporary tables. -526
42996 The partition key cannot be a datetime or floating-point column. -328
42998 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. -256
42999 The query is not allowed on a distributed table or view. -255
429B6 Rows from a distributed table cannot be redistributed because the table contains a datalink column with FILE LINK CONTROL. -7037
429B7 A referential constraint with a delete rule of CASCADE is not allowed on a table with a DataLink column with FILE LINK CONTROL. -7038
429BD RETURN must be the last SQL statement of the atomic compound statement within an SQL row or table function. -20148
429BH A partitioned table cannot contain an identity column. -20247
429BM The ICU sort sequence cannot be used in this context. -20268

 

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

 

Table 35.  Class Code 46: Java Errors
SQLSTATE Value Meaning SQLCODE Values
46001 The URL specified on an install or replace of a jar procedure did not identify a valid jar file. -20200
46002 The jar name specified on the install, replace, or remove of a Java procedure is not valid. -20201
46003 The jar file cannot be removed, a class is in use by a procedure. -20202
46007 A Java function has a Java method with an invalid signature. -20203
46008 A Java function cannot map to a single Java method. -20204
46501 The install or remove jar procedure for "<jar-id>" specified the use of a deployment descriptor. -20207

 

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

 

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

 

Table 38.  Class Code 54: SQL or Product Limit Exceeded
SQLSTATE Value Meaning SQLCODE Values
54001 The statement is too long or too complex. -101
54002 A string constant is too long. -102
54004 The statement has too many table names or too many items in a SELECT or INSERT list. -129, -840
54005 The sort key is too long, or has too many columns. -136
54006 The result of concatenation is too long. -137
54008 The key is too long, a column of the key is too long, or the key many columns. -602, -613, -614, -631
54009 Too many users were specified in GRANT or REVOKE. -5017
54010 The record length of the table is too long. -101
54011 Too many columns were specified for a table, view, or table function. -101, -680
54018 The row is too long. -809
54019 The maximum number of late descriptors has been exceeded, probably because too many different CCSIDs were used. -871
54021 Too many constraints, or the size of the constraint is too large. -642
54023 The limit for the number of parameters or arguments for a function or a procedure has been exceeded. -442, -448
54028 The maximum number of concurrent LOB handles has been reached. -429
54035 An internal object limit exceeded. -7049
54038 Maximum depth of nested routines or triggers was exceeded. -724
54044 A multiple-byte (UCS-2) sort sequence table cannot be supported in DRDA® because it is too large. -7031
54054 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 Value Meaning SQLCODE Values
55005 Recursion is only supported to a DB2 UDB for iSeries application server. -145
55006 The object cannot be dropped, because it is currently in use by the same application process. -615, -950
55007 The object cannot be altered, because it is currently in use by the same application process. -951
55018 The schema cannot be dropped, because it is in the library list. -7006
55019 The object is in an invalid state for the operation. -7008, -20054
55029 Local program attempted to connect to a remote database. -862
55042 The alias is not allowed because it identifies a single member of a multiple member file. -7030
55048 Encrypted data cannot be encrypted. -20147
55050 An object cannot be created into a protected schema. -7052

 

Table 40.  Class Code 56: Miscellaneous SQL or Product Error
SQLSTATE Value Meaning SQLCODE Values
56016 The ranges specified for data partitions are not valid. -636
56084 An unsupported SQLTYPE was encountered in a select list or input list. -351, -352
56095 A bind option is invalid. -30104
560BF The encryption and decryption facility has not been installed. -20223
560C4 The option is not valid for the ARD interface. -5027, -5028

 

Table 41.  Class Code 57: Resource Not Available or Operator Intervention
SQLSTATE Value Meaning SQLCODE Values
57005 The statement cannot be executed, because a utility or a governor time limit was exceeded. -666
57006 The object cannot be created, because a DROP or CREATE is pending. -679
57007 The object cannot be used, because an operation is pending. -910
57011 Virtual storage or database resource is not available. -904, -971, -7053
57012 A non-database resource is not available. This will not affect the successful execution of subsequent statements. -30040
57013 A non-database resource is not available. This will affect the successful execution of subsequent statements. -30041
57014 Processing was canceled as requested. -952
57017 Character conversion is not defined. -332
57033 Deadlock or timeout occurred without automatic rollback. -913
57042 DDM recursion has occurred. -30001
57043 A local SQL application program cannot be executed on an application server. -7021
57050 The file server is not currently available. -357

 

Table 42.  Class Code 58: System Error
SQLSTATE Value Meaning SQLCODE Values
58003 An invalid section number was detected. -144
58004 A system error (that does not necessarily preclude the successful execution of subsequent SQL statements) occurred. -901, -4301
58008 Execution failed due to a distribution protocol error that will not affect the successful execution of subsequent DDM commands or SQL statements. -30000
58009 Execution failed due to a distribution protocol error that caused deallocation of the conversation. -30020
58010 Execution failed due to a distribution protocol error that will affect the successful execution of subsequent DDM commands or SQL statements. -30021
58011 The DDM command is invalid while the bind process in progress. -30050
58012 The bind process with the specified package name and consistency token is not active. -30051
58014 The DDM command is not supported. -30070
58015 The DDM object is not supported. -30071
58016 The DDM parameter is not supported. -30072
58017 The DDM parameter value is not supported. -30073
58018 The DDM reply message is not supported. -30074
58028 The commit operation failed, because a resource in the unit of work was not able to commit its resources. -175
58033 An unexpected error occurred while attempting to access a client driver. -969

 

 

 

SQLSTATE消息
本节列示SQLSTATE及其含义。SQLSTATE是按类代码进行分组的;对于子代码,请参阅相应的表。

2. SQLSTATE类代码 类
代码  
含义 要获得子代码,
参阅...
00完全成功完成 表3
01警告 表4
02无数据 表5
07动态SQL错误 表6
08连接异常 表7
09触发操作异常 表8
0A功能部件不受支持 表9
0D目标类型规范无效 表10
0F无效标记 表11
0K RESIGNAL语句无效 表12
0N SQL/XML映射错误 表13
20找不到CASE语句的条件 表15
21基数违例 表16
22数据异常 表17
23约束违例 表18
24无效的游标状态 表19
25无效的事务状态 表20
26无效SQL语句标识 表21
28无效权限规范 表23
2D无效事务终止 表24
2E无效连接名称 表25
34无效的游标名称 表26
36游标灵敏度异常 表27
38外部函数异常 表28
39外部函数调用异常 表29
3B SAVEPOINT无效 表30
40事务回滚 表31
42语法错误或访问规则违例 表32
44 WITH CHECK OPTION违例 表33
46 Java DDL表34
51无效应用程序状态 表35
53无效操作数或不一致的规范 表36
54超出SQL限制,或超出产品限制 表37
55对象不处于先决条件状态 表38
56其他SQL或产品错误 表39
57资源不可用或操作员干预 表40
58系统错误 表41
5U实用程序 表42

类代码00完全成功完成
表3.类代码00:完全成功完成SQLSTATE值  
含义
00000操作执行成功,并且未产生任何类型的警告或异常情况。

类代码01警告
表4.类代码01:警告SQLSTATE值  
含义
01002发生DISCONNECT错误。
01003从列函数的参数消去NULL值。
01004字符串值在指定给具有较短长度的另一字符串数据类型时被截断。
01005 SQLDA中的条目数不够。
01007未授予特权。
0100C从过程返回了一个或多个特殊结果集。
0100D关闭的游标已在链中的下一个结果集上重新打开。
0100E生成的过程大于允许的最大结果集数目。只有第一个整数结果集已经返回到调用者。
01503结果列数比提供的主机变量数大。
01504 UPDATE或DELETE语句不包括WHERE子句。
01506对DATE或TIMESTAMP值进行了调整,以更正算术运算得出的无效日期。
01509由于用户虚拟机中的存储器不够,取消游标的分块。
01515已为主机变量指定了一个空值,因为列的非空值不在主机变量的范围之内。
01516已忽略不可用的WITH GRANT OPTION。
01517用替代字符替换不能转换的字符。
01519已为主机变量指定了一个空值,因为数字值超出范围。
01524列函数的结果不包括由算术表达式求值得出的空值。
01526隔离级别已升级。
01527 SET语句引用的专用寄存器在AS上不存在。
01539连接成功但只应使用SBCS字符。
01543已忽略重复约束。
01545未限定列名已解释为相关引用。
01550索引未创建,因为具有指定描述的索引已经存在。
01560忽略了一个冗余的GRANT。
01562在数据库配置文件中的新日志路径(newlogpth)无效。
01563日志文件的当前路径(logpath)无效。日志文件路径被复位为缺省值。
01564已为主机变量指定了空值,因为发生了被零除的错误。
01586该语句导致一个或多个表自动置于设置完整性暂挂状态。
01589语句包含有冗余规范。
01592在引用SOURCE函数的CREATE FUNCTION语句中,或:
输入参数的长度、精度或小数位大于源函数相应参数的长度、精度或小数位;或
RETURNS或CAST FROM参数的长度、精度或小数位比源函数的小;或
CREATE FUNCTION语句中的CAST FROM参数的长度、精度或小数位比RETURNS参数的大。
运行时可能发生截断(那时可能会引起错误)。
01594对于所有信息,SQLDA内的条目数不够多(即,没有足够的描述符返回相异名称)。
01595该视图已替换现有无效视图。
01596没有为基于长字符串数据类型的单值类型创建比较函数。
01598尝试激活活动的事件监视器,或尝试释放不活动的事件监视器。
01599忽略REBIND上的绑定选项。
01602优化级别已降低。
01603 CHECK DATA处理过程中发现约束违例,已将其移至异常表。
01604已经说明了SQL语句,但是未执行它。
01605递归公共表表达式可能包含无限循环。
01606节点或系统数据库目录是空的。
01607只读事务中节点的时间差超过定义的阈值。
01608已经替换了不受支持的值。
01609生成的过程大于允许的最大结果集数目。只有第一个整数结果集已经返回到调用者。
01610从过程返回了一个或多个特殊结果集。
01611关闭的游标已在链中的下一个结果集上重新打开。
01614定位器数小于结果集数。
01616估计的CPU成本超出了资源限制。
01618重新分发节点组是更改数据库分区所必需的。
01620 UNION ALL的某些基本表可能是同一个表。
01621检索到的LOB值可能已更改。
01622语句成功完成,但在语句完成之后发生了系统错误。
01623忽略DEGREE的值。
01625模式名在CURRENT PATH中出现了多次。
01626数据库只有一个活动的缓冲池。
01627 DATALINK值可能无效,因为该表处理协调暂挂或协调不可能的状态。
01632并发连接数超出了该产品的定义授权。
01633可能不能使用具体化查询表来优化查询的处理。
01636数据库管理器一直未验证非增量数据的完整性。
01637未启用调试。
01639联合对象可能需要调用程序具有对数据源对象的必要特权。
01641 Datalink类型属性限制结构化类型的使用。
01642对于最大的可能USER缺省值,列不足够长。
01643对SQL例程中SQLSTATE或SQLCODE变量的赋值可能会被覆盖,不会激活任何处理程序。
01645 SQL过程的可执行文件未保存在数据库目录中。
01648忽略了COMPRESS列属性,因为对表取消激活了VALUE COMPRESSION。
01649缓冲池操作已经完成,但是直到下一次数据库重新启动才会生效。
01650索引和表统计信息不一致。
01651成功激活了事件监视器,但是某些监视信息可能丢失了。
01652由于语句上下文而忽略了隔离子句。
01653权限授予给USER。因为权限名称大于8字节,所以不考虑组。
01654未启动缓冲池。
01655成功创建了事件监视器,但是至少有一个事件监视器目标表已存在。
01657缓冲池操作在下一次数据库重新启动之后才会生效。
01665列名或参数名被截断。
01667可能不能使用视图来优化查询的处理。
01669由于远程目录与本地目录之间的模式不一致,因此,未彻底更新指定昵称的统计信息。
01670对新表来说,不存在缺省主表空间。
01671高速缓存的语句的环境与当前环境不同。将使用当前环境来重新优化指定的语句。
01674表空间属性对于查询性能不是最佳的。
01675指定的表空间数超过了需要的表空间数。多余的表空间将被忽略。
01676忽略了传送操作,因为授权标识已经是数据库对象的所有者。
01677对于已经定义了插件的服务器忽略了包装器选项。
01678对用户映射的更改只应用于联合目录表,而不应用于外部用户映射存储库。
01679无法为指定的授权标识建立可信连接。
01684不支持指定的语言环境。返回的消息使用的是英语语言环境。
01686表空间正在从REGULAR转换为LARGE。必须对此表空间中的表的索引进行重组或重建,以便支持大型RID。
01689在未连接到数据源的情况下完成了SQL编译。
0168A在数据源上找不到源过程的程序包主体,或者它无效。
01H51 “MQSeries应用程序消息传递接口”消息被截断。
01H52例程的执行已完成,但是执行期间至少遇到了一个错误或警告。提供了更多信息。
01H53例程遇到了警告。参阅SQLCODE以获取详细信息。
01HXX由用户定义的函数或外部过程CALL返回了有效警告SQLSTAE。

类代码02无数据
表5.类代码02:无数据SQLSTATE值  
含义
02000发生下述异常之一:
SELECT INTO语句或INSERT语句的子查询的结果为空表。
在搜索的UPDATE或DELETE语句内标识的行数为零。
在FETCH语句中引用的游标位置处于结果表最后一行之后。

02501游标位置对于当前行的FETCH无效。
02502检测到删除或更新孔
02506遇到了错误,并且已按RETURN DATA UNTIL子句指定那样容许它。

类代码07动态SQL错误
表6.类代码07:动态SQL错误SQLSTATE值  
含义
07001对于参数标记的数目来说,主机变量的数目不正确。
07002调用参数列表或控制块无效。
07003在EXECUTE语句内标识的语句是一条select语句,或未处于已预编译状态。
07004动态参数需要USING子句或INTO子句。
07005游标的语句名标识的是一个不能与游标关联的已预编译语句。
07006由于其数据类型的缘故不能使用某输入主机变量。

类代码08连接异常
表7.类代码08:连接异常SQLSTATE值  
含义
08001应用程序请求器不能建立连接。
08002连接已存在。
08003连接不存在。
08004应用程序服务器拒绝了建立连接。
08007事务解析未知。
08502用TWOPHASE的SYNCPOINT运行的应用程序进程发出的CONNECT语句无效,因为无事务管理器可用。
08504当处理指定的路径重命名配置文件时遇到错误。

类代码09触发操作异常
表8.类代码09:触发操作异常SQLSTATE值  
含义
09000触发SQL语句失败。

类代码0A不支持功能部件
表9.类代码0A:不支持功能部件SQLSTATE值  
含义
0A001 CONNECT语句无效,因为进程不处于可连接状态。
0A502未对此数据库实例启用操作。
0A503由于潜在的数据不一致,不能编译联合插入、更新或删除操作。

类代码0D目标类型规范无效
表10.类代码0D:目标类型规范无效SQLSTATE值  
含义
0D000目标结构化数据类型规范是源结构化数据类型的正确子类型。

类代码0F无效标记
表11.类代码OF:无效标记SQLSTATE值  
含义
0F001 LOB标记变量当前不表示任何值。

类代码0K RESIGNAL语句无效
表12.类代码0K:RESIGNAL语句无效SQLSTATE值  
含义
0K000 RESIGNAL语句不在处理程序中。

类代码0N SQL/XML映射错误
表13.类代码0N:SQL/XML映射错误SQLSTATE值  
含义
0N002无法将字符映射至有效XML字符。

类代码10 XQuery错误
表14.类代码10:XQuery错误SQLSTATE值  
含义
10000 XQuery错误。
10501 XQuery表达式缺少静态或动态上下文组件的指定。
10502在XQuery表达式的序言中遇到了错误。
10503在XQuery或XPath表达式中定义了重复的名称。
10504在无效URI中指定了XQuery名称空间声明。
10505字符、标记或子句在XQuery表达式中缺少了或者无效。
10506 XQuery表达式引用了一个未定义的名称。
10507处理XPath或XQuery表达式时遇到了类型错误。
10508 XQuery表达式在已计算的构造函数中包括一个无效的名称表达式。
10509指定了不受支持的XQuery语言功能部件。
10510未指定字符串文字作为强制类型转换表达式操作数或构造函数参数。
10601在处理XQuery函数或运算符时遇到了算术错误。
10602在处理XQuery函数或运算符时遇到了数据类型转换错误。
10603在处理XQuery函数或运算符时遇到了字符处理错误。
10604未提供文档上下文来处理XQuery函数。
10605在处理XQuery函数或运算符时遇到了日期时间错误。
10606没有上下文项用来处理XQuery函数或运算符。
10607在处理XQuery函数或运算符时遇到了名称空间错误。
10608在XQuery函数或运算符的参数中遇到了错误。
10609在处理XQuery函数或运算符时遇到了正则表达式错误。
10610在处理XQuery函数或运算符时遇到了类型错误。
10611在处理XQuery函数或运算符时遇到了未标识的错误。
10901 XQuery原子值超出了DB2 XQuery数据类型的范围。
10902 XQuery原子值超过了DB2 XQuery运算符或函数的长度限制。
10903已超过相匹配的XQuery节点数的内部限制。

类代码20找不到CASE语句的条件
表15.类代码20:找不到Case语句的条件SQLSTATE值  
含义
20000找不到CASE语句的条件。

类代码21基数违例
表16.类代码21:基数违例SQLSTATE值  
含义
21000 SELECT INTO的结果是一个多行的结果表,或者,基本谓词的子查询结果为多个值。
21501对自引用表进行多行INSERT是无效的。
21502主键的多行UPDATE是无效的。
21504从删除规则为RESTRICT或SET NULL的自引用表进行多行DELETE是无效的。
21505行函数返回的内容不能超过一行。 
21506表的同一行不能是多个更新、删除或插入操作的目标。

类代码22数据异常
表17.类代码22:数据异常SQLSTATE值  
含义
22001字符数据,发生右截断;例如,更新或插入值对于列来说太长(字符串),或者日期时间值由于太小而不能赋给主机变量。
22002检测到空值或缺少指示符参数;例如,不能将空值赋给主机变量,因为没有指定指示符变量。
22003数值超出范围。
22004不能从定义为PARAMETER STYLE. GENERAL的过程或者从用非空参数调用的类型保留方法中返回空值。
22007检测到无效的日期时间格式;即指定了无效的字符串表示法或值。
22008发生日期时间字段溢出;例如,对日期或时间戳记算术运算的结果不在有效日期范围之内。
2200G大多数特定类型都不匹配。
2200L XML值不是具有单个根元素的结构良好的文档。
2200M未能将值作为结构良好的XML文档进行解析或者根据XML模式来验证该值。
2200S XML注释无效。
2200T XML处理指令无效。
2200W XML值包含未能序列化的数据。
22011发生子字符串错误;例如,SUBSTR的参数超出范围。
22012用零作除数是无效的。
22018对于CAST、DECIMAL、FLOAT、或INTEGER标量函数,字符值是无效的。
22019 LIKE谓词有无效转义字符。
22021某字符不在编码字符集中。
22024以NUL结束的输入主机变量或参数不包含NUL。
22025 LIKE谓词字符串模式包含无效的转义字符。
2202D配合mutator方法使用了空实例。
2202H在TABLESAMPLE子句中指定的样本大小无效。
22501变长字符串的长度控制字段为负值或大于最大值。
22504混合数据值是无效的。
22506对日期时间专用寄存器的引用无效,因为TOD时钟发生故障或操作系统时区参数超出范围。
22522 CCSID值根本无效,对数据类型或子类型无效,或对编码方案无效。
22525数据分区键值无效。
22526键变换函数没有生成任何行或生成了重复的行。
22527对多行INSERT操作检测到了无效的输入数据。
22532在XML模式存储库中未找到XSROBJECT。
22533在XML模式存储库中未找到唯一的XSROBJECT。
22534 XML模式文档未通过使用包括或重新定义而连接至其他XML模式文档。
22535 XML模式未声明指定的全局元素。
22536 XML值不包含必需的根元素。
225D1未启用指定的XML模式以进行分解。
225D2在分解XML文档期间发生了SQL错误。
225D3分解XML文档时遇到了对于XML模式类型无效的值。
225D4分解XML文档时遇到了对于目标SQL类型无效的值。
225D5分解XML文档时遇到了上下文中未知或无效的XML节点。
225D6指定的XML模式需要迁移到当前版本以支持分解。
225D7分解XML文档时遇到了一个根元素,该根元素不是XML模式中的复杂类型的全局元素。
225DE无法启用XML模式以进行分解。

类代码23约束违例
表18.类代码23:约束违例SQLSTATE值  
含义
23001 RESTRICT更新或删除规则防止父键被更新或删除。
23502插入或更新值为空,但该列不能包含空值。
23503外键的插入或更新值无效。
23504 NO ACTION更新或删除规则防止父键被更新或删除。
23505发生由唯一索引或唯一约束强加的约束违例。
23510使用由RLST表强加的命令时发生约束违例。
23511不能删除父行,因为检查约束限制该删除。
23512不能添加检查约束,因为该表含有不满足约束定义的行。
23513 INSERT或UPDATE的结果行不符合检查约束定义。
23514检查数据处理中发现约束违例。
23515未能创建唯一索引,或者不能添加唯一约束,因为该表包含指定键的重复值。
23520不能定义外键,因为其所有的值都不同于父表的父键。
23521对目录表的更新违反了内部约束。
23522标识列值的范围或者序列用完。
23523已经为安全标号列提供了无效值。
23524 UNION ALL视图内的无效行移动。
23525未能插入或更新XML值,这是因为在插入或更新XML列的索引期间检测到错误。
23526未能创建XML列的索引,因为在将XML值插入到索引中时检测到错误。

类代码24无效的游标状态
表19.类代码24:无效的游标状态SQLSTATE值  
含义
24501标识的游标未打开。
24502在OPEN语句中标识的游标已经打开。
24504在UPDATE、DELETE、SET或GET语句中标识的游标未定位在行上。
24506在PREPARE中标识的语句是一个打开游标语句。
24510对一个删除孔或更新孔尝试了

UPDATE或DELETE操作。
24512结果表与基本表不一致。
24513不允许FETCH NEXT、PRIOR、CURRENT或RELATIVE,原因是游标位置未知。
24514先前的错误已禁用此游标。
24516已对结果集指定了一个游标。
24517外部函数或方法将游标保持为打开。

类代码25无效的事务状态
表20.类代码25:无效的事务状态SQLSTATE值  
含义
25000插入、更新或删除操作在指定它的上下文中无效。
25001该语句只允许作为工作单元的第一条语句。
25501该语句只允许作为工作单元的第一条语句。
25502操作在单个事务中不能多次出现。

类代码26无效SQL语句标识
表21.类代码26:无效SQL语句标识SQLSTATE值  
含义
26501标识的语句不存在。

类代码27触发的数据更改违例
表22.类代码27:触发的数据更改违例SQLSTATE值  含义
27000试图在同一SQL语句中多次更改同一个表中的同一行。

类代码28无效权限规范
表23.类代码28:无效权限规范SQLSTATE值  
含义
28000权限名称无效。

类代码2D无效事务终止
表24.类代码2D:无效事务终止SQLSTATE值  
含义
2D521 SQL COMMIT或ROLLBACK在当前操作环境中无效。
2D522 ATOMIC复合语句中不允许COMMIT和ROLLBACK。
2D528动态COMMIT对于应用程序执行环境无效。
2D529动态ROLLBACK对于应用程序执行环境无效。

类代码2E无效连接名称
表25.类代码2E:无效连接名称SQLSTATE值  
含义
2E000连接名称无效。

类代码34无效的游标名称
表26.类代码34:无效的游标名称SQLSTATE值  
含义
34000游标名无效。

类代码36无效游标规范
表27.类代码36:无效游标规范SQLSTATE值  
含义
36001不能为指定的SELECT语句定义敏感游标。

类代码38外部函数异常
表28.类代码38:外部函数异常SQLSTATE值  
含义
38XXX外部例程或触发器返回有效错误SQLSTATE。
38001不允许外部例程执行SQL语句。
38002例程尝试修改数据,但例程未定义为MODIFIES SQL DATA。
38003例程中不允许该语句。
38004例程尝试读取数据,但例程未定义为READS SQL DATA。
38501(使用SIMPLE CALL或SIMPLE CALL WITH NULLS调用约定)调用用户定义的函数、外部过程或触发器时出错。
38502不允许外部函数执行SQL语句。
38503用户定义的函数异常终止(abend)。
38504用户定义的函数已被用户中断,以停止可能的循环条件。
38505 FINAL CALL上的例程中不允许SQL语句。
38506函数因来自OLE DB提供程序的错误而失败。
38552 SYSFUN模式(由IBM提供)中的函数已异常终止。
可以在消息正文中找到下列原因码之一:

01
数值超出范围
02
被零除
03
算术溢出或下溢
04
日期格式无效
05
时间格式无效
06
时间戳记格式无效
07
时间戳记持续时间的字符表示法无效
08
时间间隔类型无效(必须是1、2、4、8、16、32、64、128、256之一)
09
字符串太长
10
字符串函数中的长度或位置超出范围
11
浮点数的字符表示法无效
38553系统模式中的例程已因错误而终止。
38H01 MQSeries函数未能初始化。
38H02 MQSeries的“应用程序消息传递接口”未能终止会话。
38H03 MQSeries的“应用程序消息传递接口”未能正确地处理消息。
38H04 MQSeries的“应用程序消息传递接口”未能发送消息。
38H05 MQSeries的“应用程序消息传递接口”未能读取/接收消息。
38H06 MQSeries的“应用程序消息传递接口”预订(不预订)请求失败。
38H07 MQSeries的“应用程序消息传递接口”未能落实工作单元。
38H08 MQSeries的“应用程序消息传递接口”策略错误。
38H09 MQSeries XA(两阶段落实)API调用错误。
38H0A MQSeries的“应用程序消息传递接口”未能回滚工作单元。

类代码39外部函数调用异常
表29.类代码39:外部函数调用异常SQLSTATE值  
含义
39001用户定义的函数已返回无效SQLSTATE。
39004不允许IN或INOUT参数为空值。
39501与参数相关联的eye-catcher(引人注目的事物)已被修改。

类代码3B SAVEPOINT无效
表30.类代码3B:SAVEPOINT无效SQLSTATE值  
含义
3B001保存点无效。
3B002已经达到最大保存点数目。
3B501检测到重复的保存点名。
3B502指定了RELEASE或ROLLBACK TO SAVEPOINT,但是保存点不存在。
3B503在触发器或全局事务中不允许SAVEPOINT、RELEASE SAVEPOINT或ROLLBACK TO SAVEPOINT。

类代码40事务回滚
表31.类代码40:事务回滚SQLSTATE值  
含义
40001发生了伴随自动回滚的超时或死锁。
40003语句完整性未知。
40504由于系统错误导致工作单元被回滚。
40506由于SQL错误,当前事务已回滚。
40507由于创建索引时发生故障,因此当前事务已回滚。

类代码42语法错误或访问规则违例
表32.类代码42:语法错误或访问规则违例SQLSTATE值  
含义
42501授权标识不具有对标识对象执行指定操作的特权。
42502授权标识不具有执行指定操作的特权。
42504无法从指定的权限名撤销指定的特权、安全标号或免除凭证。
42506发生所有者授权失败。
42508不能将指定的数据库特权授予PUBLIC。
42509因为STATICRULES选项而未授权SQL语句。
42511未能检索DATALINK值。
42512授权标识对受保护列没有访问权。
42514授权标识不具有对象的所有权需要的特权。
42516用户映射存储库中的认证失败。
42519不允许此授权标识对受保护表执行操作。
42520由于此授权标识没有安全标号,所以无法执行内置函数。
42521无法将权限或特权授予指定的授权标识。
42522此授权标识没有凭证,因此无法保护列或者对该列除去保护。
42601字符、标记或子句无效或丢失。
42602检测到名称中有无效字符。
42603检测到未终止的字符串常量。
42604检测到无效数字或字符串常量。
42605为标量函数指定的参数的数目无效。
42606检测到无效十六进制常数。
42607列函数的操作数无效。
42608在VALUES中使用NULL或DEFAULT是无效的。
42609运算符或谓词的所有操作数都是参数标记。
42610不允许参数标记。
42611列或参数定义无效。
42612语句字符串是一条SQL语句,它在它所出现的上下文中是不可接受的。
42613子句互斥。
42614重复关键字无效。
42615检测到无效备用项。
42616指定了无效的选项。
42617语句字符串是空白或空的。
42618不允许主机变量。
42620对UPDATE子句指定了只读SCROLL。
42621检查约束无效。
42622名称或标号太长。
42623不能指定DEFAULT子句。
42625 CASE表达式无效。
42627必须在使用EXPRESSION AS子句的谓词规范之前指定RETURNS子句。
42628在变换定义中多次定义了TO SQL或FROM SQL变换函数。
42629必须为SQL例程指定参数名。
42630在嵌套复合语句中不能存在SQLSTATE或SQLCODE变量声明。
42631 SQL函数或方法中的RETURN语句必须包括返回值。
42633 XMLATTRIBUTES或XMLFOREST的参数需要AS子句。
42634 XML名称无效。
42635 XML名称空间前缀无效。
42636缺少BY REF子句,或者不正确使用了该子句。
42637无法在DECLARE CURSOR语句中指定XQuery表达式。
42701在插入或更新操作或SET转换变量语句中检测到重复列名。
42702由于名称重复,列引用有歧义。
42703检测到一个未定义的列、属性或参数名。 
42704检测到未定义的对象或约束名。
42705检测到未定义的服务器名。
42707 ORDER BY内的列名不标识结果表中的列。
42709在键列列表中指定了重复的列名。
42710检测到重复的对象或约束名。
42711在对象定义或ALTER语句中检测到重复列名或属性名。
42712在FROM子句中检测到重复的表标志符。
42713在对象列表中检测到重复对象。
42720在节点目录内未找到远程数据库的节点名。
42723模式中已经存在带有相同特征符的函数。
42724不能访问用于用户定义的函数或过程的外部程序。
42725直接引用了例程(不是通过特征符或者通过特定实例名进行引用),但是该例程有多个特定实例。
42726检测到指定的派生表的名称重复。
42727对新表来说,不存在缺省主表空间。
42728在节点组定义中检测到重复节点。
42729节点未定义。
42730容器名已由另一表空间使用。
42731容器名已由该表空间使用。
42732在SET CURRENT PATH语句中检测到重复的模式名。
42734检测到重复的参数名、SQL变量名、游标名、条件名或标号。
42735对缓冲池,未定义表空间的节点组。
42736在LEAVE语句上指定的标号找不到或无效。
42737未定义在处理程序中指定的条件。
42738在FOR语句的DECLARE CURSOR语句中指定了重复的列名或未命名的列。
42739检测到重复的变换。
42740未找到指定类型的变换。未删除任何变换。
42741未对数据类型定义变换组。
42742类型表或带类型视图层次结构中已存在同类子表或子视图。
42743在索引扩展名中未找到搜索方法。 
42744在变换组中未定义TO SQL或FROM SQL变换函数。
42745例程将用现有方法定义覆盖关系。
42746在同一类型层次结构中,方法名不能与结构化类型名相同。
42748存储路径对于数据库来说已存在或者被指定了多次。
42749对于XML模式来说,已经存在具有相同目标名称空间和模式位置的XML模式文档。
4274A在XML模式存储库中未找到XSROBJECT。
4274B在XML模式存储库中未找到唯一的XSROBJECT。
4274F在安全标号组件中未定义组件元素。
4274G在给定安全标号所使用的安全标号策略中未定义安全标号组件。
4274H指定的安全策略不存在指定的访问规则。
4274I指定的安全策略不存在安全标号。
4274J数据库分区组已被此缓冲池使用。
42802插入或更新值的数目与列数不相同。
42803在SELECT或HAVING子句中的列引用无效,因为它不是分组列;或者在GROUP BY子句中的列引用无效。
42804 CASE表达式中的结果表达式不兼容。
42805 ORDER BY子句中的整数不标识结果表中的列。
42806不能将某值赋予某主机变量,因为数据类型不兼容。
42807对该对象不允许执行INSERT、UPDATE或DELETE。
42808插入或更新操作中标识的列不可更新。
42809标识的对象不是语句所应用的对象类型。
42810 FOREIGN KEY子句中没有标识基本表。
42811指定的列数与SELECT子句中的列数不相同。
42813 WITH CHECK OPTION不能用于指定的视图。
42814无法删除该列,因为它是表中唯一的列。
42815数据类型、长度、小数位、值或CCSID无效。
42816表达式中的日期时间值或持续时间无效。
42817由于某个视图或约束依赖于该列,并且指定了RESTRICT,或者由于该列包含在分区键中,或者由于该列是安全标号列,所以无法删除该列。
42818运算符或函数的操作数不兼容或者不可比较。
42819算术运算的操作数或需要数字的函数的操作数不是数字。
42820数字常数太长,或其值不在该数据类型取值范围内。
42821更新或插入值与列不兼容。
42823从仅允许一列的子查询中返回了多列。
42824 LIKE的操作数不是字符串,或第一个操作数不是列。
42825 UNION、INTERSECT、EXCEPT或VALUES的行没有兼容列。
42826 UNION、INTERSECT、EXCEPT或VALUES的行的列数不相同。
42827 UPDATE或DELETE中标识的表与游标指定的表不相同。
42828由UPDATE或DELETE语句的游标指定的表不能修改,或该游标是只读游标。
42829 FOR UPDATE OF无效,因为由该游标指定的结果表不能修改。
42830外键不符合父键的描述。
42831主键或唯一键列不允许空值。
42832不允许对系统对象执行该操作。
42834不能指定SET NULL,因为不能对外键的任何列指定空值。
42835在指定的派生表之间不能指定循环引用。
42836指定的递归派生表的规范无效。
42837不能改变该列,原因是它的属性与当前的列属性不兼容。
42838检测到无效使用了表空间。
42839索引和长列不能处于与该表独立的表空间内。
42840检测到无效使用了AS CAST选项。
42841参数标记不能是用户定义的类型或引用类型。
42842列定义无效,因为指定的选项与列描述不一致。
42845检测到无效使用了VARIANT或EXTERNAL ACTION函数。
42846不支持从源类型到目标类型的强制类型转换。
42849外部例程不支持所指定的选项。
42852在GRANT或REVOKE中指定的特权无效或不一致。(例如,视图上的GRANT ALTER。)
42853指定了选项的两个备用项,或者同一选项被指定了多次。
42854选择列表中的结果列数据类型与在带类型视图或具体化查询表定义中定义的类型不兼容。
42855不允许对此主机变量指定LOB。此游标的LOB值的所有访存的目标主机变量必须是定位器或LOB变量。
42858不能将该操作应用于指定对象。
42863检测到REXX中有未定义的主机变量。
42866在CREATE FUNCTION语句的CAST FROM子句中的RETURNS子句的数据类型对于有源函数或函数体中的RETURN语句返回的数据类型不适合。
42867指定了冲突的选项。
42872 FETCH语句子句与游标定义不兼容。
42875要在CREATE SCHEMA中创建的对象的限定符必须与模式名相同。
42877不能限定该列名。
42878无效的函数或过程名称与EXTERNAL关键字一起使用。
42879在CREATE FUNCTION语句中一个或多个输入参数的数据类型对于源函数中相应的数据类型不适合。
42880 CAST TO和CAST FROM数据类型不兼容,或总会导致固定字符串截断。
42881使用基于行的函数无效。
42882特定实例名限定符与函数名限定符不相同。
42883找不到具有匹配特征符的例程。
42884找不到具有指定名称和兼容参数的任何例程。
42885在CREATE FUNCTION语句中指定的输入参数数目与SOURCE子句中指定的函数所提供的参数数目不匹配。
42886 IN、OUT或INOUT参数属性不匹配。
42887在该函数出现的上下文中该函数无效。
42888表没有主键。
42889该表已有主键。
42890在引用子句中指定了列表,但是标识的父表没有指定列名的唯一约束。
42891重复的UNIQUE约束已存在。
42893无法删除、改变或传输该对象或约束,或者无法从对象中撤销权限,因为还有其他对象依赖于该对象。
42894 DEFAULT值无效。
42895对于静态SQL,不能使用输入主机变量,因为其数据类型与过程或用户定义的函数的参数不兼容。
428A0用户定义的函数所基于的有源函数出错。
428A1不能访问主机文件变量所引用的文件。
428A2表不能指定给多节点节点组,因为它没有分区键。
428A3为事件监视器指定了无效路径。
428A4为事件监视器选项指定了无效值。
428A5在SET INTEGRITY语句中指定的异常表结构不正确,或者已用生成的列、约束或触发器定义了该异常表。
428A6在SET INTEGRITY语句中指定的异常表不能与正在检查的表之一相同。
428A7检查的表数目与在SET INTEGRITY语句中指定的异常表数目不匹配。
428A8在父表或底层的表处于设置完整性暂挂状态时,不能对派生表使用SET INTEGRITY语句复位设置完整性暂挂状态。
428A9节点范围无效。
428AA列名不是事件监视器表的有效列。
428B0在ROLLUP、CUBE或GROUPING SETS中有非法嵌套。
428B1未指定给特定节点的表空间容器的规范数目不正确。
428B2容器的路径名无效。
428B3指定了无效的SQLSTATE。
428B7在SQL语句中指定的编号不在有效范围内。
428BO不能为联合数据源创建方案。
428C0不能删除该节点,因为它是节点组中唯一的节点。
428C1只能为表指定一个ROWID、IDENTITY或安全标号列。
428C2检查函数体指出应已在CREATE FUNCTION语句中指定给出的子句。
428C4谓词运算符两边的元素的数目不相同。
428C5从数据源中找不到数据类型的数据类型映射。
428C9不能将ROWID列指定为INSERT或UPDATE的目标列。
428CA处于追加方式的表不能具有集群索引。
428CB表空间的页大小必须与相关联的缓冲池的页大小相匹配。
428D1不能访问DATALINK值所引用的文件。
428D4在OPEN、CLOSE或FETCH语句中不能引用在FOR语句中指定的游标。
428D5结束标号与开始标号不匹配。
428D6 NOT ATOMIC语句不允许UNDO。
428D7不允许条件值。
428D8 SQLSTATE或SQLCODE变量的声明或使用无效。
428DB作为超类型、超表或超视图,该对象无效。 
428DC对于此类型的变换,该函数或方法无效。
428DD未定义要求的变换。
428DE PAGESIZE值不受支持。
428DF在CREATE CAST中指定的数据类型无效。
428DG在CREATE CAST中指定的函数无效。
428DH操作对于类型表无效。
428DJ不能更改或删除继承列或属性。
428DK已定义引用列的作用域。
428DL外部函数或有源函数的参数已定义了作用域。
428DM作用域表或视图对于引用类

型无效。
428DN未在外部函数的RETURNS子句中指定SCOPE,或在有源函数的RETURN子句中指定了SCOPE。
428DP该类型不是结构化类型。
428DQ子表或子视图的模式名不能与其上一级表或上一级视图的模式名不同。
428DR无法将操作应用于子表或子视图。
428DS不能在子表中定义指定列的索引。 
428DT表达式的操作数不是有效的作用域引用类型。
428DU要求的类型层次结构中不包括的一种类型。 
428DV解析引用运算符的左操作数无效。
428DW不能使用解析引用运算符来引用对象标识列。
428DX对象标识列是定义一个类型表或带类型视图层次结构的根表或根视图所必需的。
428DY不能对目标对象类型更新统计信息。
428DZ不能更新对象标识列。
428E0索引的定义与索引扩展名的定义不匹配。
428E1用于产生范围的表函数的结果与索引扩展名的键变换表函数的结果不一致。
428E2目标键参数的数目或类型与索引扩展名的键变换函数的数目或类型不匹配。
428E3索引扩展名中函数的参数无效。
428E4函数在CREATE INDEX EXTENSION语句中不受支持。
428E5只能用用户定义的谓词来指定SELECTIVITY子句。
428E6用户定义的谓词中的方法的搜索参数与索引扩展名的相应搜索方法的搜索参数不匹配。
428E7用户定义的谓词中跟在比较运算符后的操作数类型与RETURNS数据类型不匹配。
428E8搜索目标或搜索参数参数与正在创建的该函数的参数名不匹配。
428E9在相同的使用规则中参数的参数名不能同时作为搜索目标和搜索参数。
428EA带类型视图中的全查询无效。
428EB当上一级视图中的某一列为可更新时,子视图中相应的列不能是只读的。
428EC为具体化查询表指定的全查询无效。
428ED不能构造具有Datalink或Reference类型属性的结构化类型。
428EE选项对此数据源无效。
428EF该选项的值对此数据源无效。
428EG丢失此数据源所必需的选项。
428EH不能ADD已定义的选项。
428EJ不能SET或DROP尚未添加的选项。
428EK已声明的全局临时表名的限定符必须是SESSION。
428EL变换函数不能与函数或方法一起使用。
428EM TRANSFORM. GROUP子句是必需的。
428EN变换组被指定为未使用。
428EP结构化类型不能直接或间接依赖于它本身。
428EQ例程的返回类型与主题类型不同。
428ER在删除方法主体之前,不能删除方法规范。
428ES方法主体与方法规范的语言类型不对应。
428EU在服务器定义中未指定TYPE或VERSION。
428EV对于该数据源类型,传递(Pass-Through)功能不受支持。
428EW表不能与具体化查询表互相转换。
428EX例程不能用作变换函数,因为它是内置函数或方法。
428EY用户定义的谓词中搜索目标的数据类型与指定索引扩展名的源键的数据类型不匹配。
428EZ OLAP函数的窗口规范无效。
428F0 ROW函数必须包括至少两列。
428F1 SQL TABLE函数必须返回表结果。
428F2 SQL过程中的RETURN语句值的数据类型必须是INTEGER。
428F3 SCROLL与WITH RETURN是互斥的。
428F4在FETCH上指定的SENSITIVITY不允许用于游标。
428F6游标是可滚动的,但结果表涉及来自表函数的输出。
428F7尝试对外部例程进行的操作仅应用于SQL例程。
428F9在此上下文中不能指定序列表达式。
428FA十进制数的小数位必须为零。
428FB序列名不能是由系统为标识列生成的序列。
428FC加密密码的长度无效。
428FD用于解密的密码与加密数据时所使用的密码不匹配。
428FE数据不是ENCRYPT函数的结果。
428FF缓冲池规范无效。
428FG登台表或具体化查询表定义无效。
428FH SET INTEGRITY选项无效
428FI指定了ORDER OF,但表标志符不包含ORDER BY子句。
428FJ视图或具体化查询表的外部全查询不允许使用ORDER BY。
428FL在指定SQL数据更改语句的上下文中,不允许SQL数据更改语句。
428FM SELECT中的INSERT语句指定了一个不是对称视图的视图。
428FP只允许将一个INSTEAD OF触发器用于对主题视图的每种操作。
428FQ INSTEAD OF触发器不能指定使用WITH CHECK OPTION定义的视图、在使用WITH CHECK OPTION定义的另一个视图上定义的视图或者嵌套在使用WITH ROW MOVEMENT子句定义的视图中的视图。
428FT表与指定的数据分区操作不兼容。
428FU从FROM SQL变换函数或方法返回的内置类型与TO SQL变换函数或方法的相应内置类型不匹配。
428FV不能将方法定义为覆盖方法。
428FZ仅为某些操作定义了INSTEAD OF触发器的视图不能在MERGE语句中用作目标。
428G1数据分区数超过了表的表空间数。
428G2无法从表中删除最后一个数据分区。
428G3当全查询中的SQL数据更改语句的目标视图定义了INSTEAD OF触发器时,FINAL TABLE无效。
428G4无效使用了INPUT SEQUENCE排序。
428G5 UPDATE语句的赋值子句必须至少指定不是INCLUDE列的一列。
428G6指定了不能从全查询的FROM子句中的数据更改语句的目标中选择的一列。
428G8不能启用视图以进行查询优化。
428GA不能添加、删除或改变联合选项。
428GD PARTITION BY子句必须指定单个列,并且它必须与ORGANIZE BY子句的第一列相同。
428GE源表无法连接至分区目标表。
428GG无效使用了容许错误的嵌套表表达式。
428GO列选项在透明DDL语句中无效。
428GI XML模式不完整,因为缺少XML模式文档。
428GP无法为类型为ARRAY的组件指定多个元素。
428GR已经将具有相同访问类型(READ或WRITE)的安全标号授予给授权标识。
428GQ安全标号的GRANT与组件的现有已授权的安全标号相冲突。
428GS对该过程指定的选项值与源过程的对应选项不匹配。
428GT表未受安全策略保护。
42901列函数不包括列名。
42903 WHERE子句或SET子句包括无效引用,例如列函数。
42904由于编译错误,未创建SQL过程。
42907字符串太长。
42908语句不包括必需的列表。
42910复合语句中不允许该语句。
42911十进制除法运算无效,因为其结果的小数位为负。
42912列不能更新,因为它未在游标的select语句的UPDATE子句中标识。
42914 DELETE无效,因为子查询中引用的表可能会受该操作影响。
42915检测到无效引用约束。
42916不能创建别名,因为它会导致重复的别名链。
42917不能显式删除或改变该对象。
42918用户定义的数据类型不能用系统定义数据类型名(例如INTEGER)创建。
42919不允许嵌套复合语句。
42921容器不能添加至该表空间。
42925指定的递归派生表不能指定SELECT DISTINCT,而必须指定UNION ALL。
42928不能为该表指定WITH EMPTY TABLE。
42932程序预编译假设不正确。
42939不能使用该名称,因为指定的标识是保留给系统使用的。
42961指定的服务器名与当前服务器不匹配。
42962长列、LOB列、XML列或结构化类型列不能用于索引、键或约束。
42963指定的安全标号列无效。
42968连接失败,因为没有当前软件许可证。
42969未创建程序包。
42972 MERGE语句的连接条件或ON子句中的表达式引用多个操作数表中的列。
42985例程中不允许该语句。
42987不允许此语句出现在过程或触发器中。
42989使用表达式生成的列或者安全标号列不能在前触发器中使用。
42990不允许唯一索引或唯一约束,因为键列不是分区键列的超集。
42991 BOOLEAN、BINARY和VARBINARY数据类型当前仅在内部受支持。
42993定义的列太大而不能记录。
42994不支持原始设备容器。
42995所请求的函数不应用于全局临时表。
42997此版本的DB2应用程序请求器、DB2应用程序服务器或两者的组合不支持该功能。
429A1节点组对于表空间无效。
429A9 SQL语句不能由DataJoiner处理。
429B2为结构化类型或列指定的直接插入长度值太小。
429B3可能未在子表中定义对象。
429B4数据过滤函数不能是LANGUAGE SQL函数。
429B5索引扩展名中实例参数的数据类型无效。
429B8用PARAMETER STYLE. JAVA定义的例程不能具有作为参数类型或返回类型的结构化类型。
429B9在属性赋值中不能使用DEFAULT或NULL。
429BA FEDERATED关键字必须与对联合数据库对象的引用配合使用。
429BB在SQL例程中不支持对参数或变量指定的数据类型。
429BC在ALTER TABLESPACE语句中有多个容器操作。
429BE主键或唯一键是维子句中的列的子集。
429BG范围集群表不支持该函数。
429BH分区表定义包含不受支持的列定义,该列可能是标识列、DATALINK列或XML列。
429BJ在视图中无效使用了WITH ROW MOVEMENT。
429BK由于移动行涉及到基础视图,因此,尝试更新视图无效。
429BL在非法上下文中调用了将修改SQL数据的函数。
429BO不能为联合数据源创建方案。
429BP昵称列表达式无效。
429BS涉及到XMLPATTERN子句或使用数据类型XML定义的列的索引定义无效。
429BT由于存在依赖性而使得转移所有权失败。
429BU无法访问插件的用户映射存储库中的用户映射。
429BZ由于其中一个底层表受保护,所以对UNION ALL视图执行的更新、删除或插入操作失败。
429C0查询必须包含使用了所指示的列的谓词。

类代码44 WITH CHECK OPTION违例
表33.类代码44:WITH CHECK OPTION违例SQLSTATE值  
含义
44000不允许插入或更新操作,因为结果行不满足视图定义。

类代码46 Java DDL
表34.类代码46:Java DDL SQLSTATE值  
含义
46001 Java DDL- 无效URL。
46002 Java DDL- 无效jar名称。
46003 Java DDL- 无效类删除。
46007 Java DDL- 无效特征符。
46008 Java DDL- 无效方法规范。
46103 Java例程遇到了ClassNotFound异常。
46501 Java DDL- 未实现可选组件。

类代码51无效应用程序状态
表35.类代码51:无效应用程序状态SQLSTATE值  
含义
51002未找到与SQL语句执行请求相对应的程序包。
51003一致性标记不匹配。
51004 SQLDA中的地址无效。
51005上一系统错误已禁用此函数。
51008预编译的程序的发行版号无效。
51015尝试执行在绑定时发现有错的节。
51017用户没有登录。
51021在应用程序进程执行了回滚操作之后才能执行SQL语句。
51022当CONNECT语句中指定的服务器已存在连接(不论处于当前状态还是休眠状态)时,指定权限名称的CONNECT无效。
51023该数据库已由数据库管理器的另一实例使用。
51024不能使用视图,因为它已被标记为不可操作。
51025在XA事务处理环境中的应用程序未用SYNCPOINT TWOPHASE绑定。
51026无法打开事件监视器,因为它的目标路径已由另一事件监视器使用。
51027因为表是用户维护的具体化查询表或未处于设置完整性暂挂状态,所以SET INTEGRITY语句的IMMEDIATE CHECKED选项无效。
51028不能使用程序包,因为它被标记为不可操作。
51030在应用程序进程中尚未调用ALLOCATE CURSOR或ASSOCIATE LOCATORS语句中所引用的过程。
51034使用MODIFIES SQL DATA定义的例程在调用它的上下文中无效。
51035不能使用PREVVAL表达式,原因是在此会话中还没有为序列生成值。
51038 SQL语句可能不再由例程发出。
51039未设置ENCRYPTION PASSWORD值。
51040编译环境无效。

类代码53无效操作数或不一致的规范
表36.类代码53:无效操作数或不一致的规范SQLSTATE值  
含义
53038键限制值的数目为零或者大于键中的列数。
53040不能像指定的那样更改缓冲池。
53045键限制常量的数据类型与列的数据类型不相同。
53090同一条SQL语句中只能引用具有一种编码方案(ASCII、EBCDIC或Unicode)的数据。
53091指定的编码方案与当前用于包含对象的编码方案不相同。

类代码54超过SQL或产品限制
表37.类代码54:超过SQL限制或产品限制SQLSTATE值  
含义
54001语句太长或者太复杂。
54002字符串常量太长。
54004语句中SELECT或INSERT列表中的项或表名太多。
54006并置的结果太长。
54008键太长,键的列太长,或者键的列数太多。
54010表的记录长度太长。
54011为表或视图指定了太多列。
54023用于函数或过程的参数或自变量数目超出限制。
54028已达到并发LOB句柄最大数。
54029已达到打开目录扫描最大数。
54030活动事件监视器已达最大数。
54031已对事件监视器分配了最大文件数。
54032已达到表的最大大小。
54033已达到分区映射最大数。
54034表空间的所有容器名的组合长度太长。
54035已超过内部对象限制。
54036容器或存储路径的路径名太长。
54037表空间的容器映射太复杂。
54038超出了嵌套例程或触发器的最大深度。
54045已超出类型层次结构的最大级别。
54046索引扩展名中已超出允许的参数的最大值。
54047已超出表空间的最大大小。
54048具有足够页大小的临时表空间不存在。
54049结构化类型的实例的长度超过了系统限制。
54050在结构化类型中超过了允许的最大属性数目。
54052缓冲池的块页数对缓冲池对于缓冲池的大小来说太大了。
54053为BLOCKSIZE指定的值不在有效范围内。
54054超过了分区数或者超过了表空间分区数与分区限制键的相应长度的组合。
54057 XML元素名称、属性名称、名称空间前缀或URI太长。
54058 XML路径的内部表示太长。
54059只具有空格字符的文本节点字符串值太长,无法进行STRIP WHITESPACE处理。
54061对安全标号组件指定了太多元素。
54062已经超过了安全策略中的最大组件数。

类代码55对象不处于先决条件状态
表38.类代码55:对象不处于先决条件状态。SQLSTATE值  
含义
55001数据库必须迁移。
55002未正确定义解释表。
55006对象不能删除,因为它当前正由同一应用程序进程使用。
55007不能改变对象,因为它当前正由同一应用程序进程使用。
55009系统尝试对只读文件或写保护软盘进行写入。
55012在表中已存在一个集群索引。
55019表的状态对于该操作无效。
55022未向此数据库注册文件服务器。
55023调用例程时发生错误。
55024表空间不能删除,因为与表相关的数据也在另一表空间中。
55025必须重新启动数据库。
55026不能删除临时表空间。
55031错误映射文件的格式不正确。
55032 CONNECT语句无效,因为在该应用程序启动后,数据库管理器停止。
55033事件监视器不能在创建它或修改它所处的同一工作单元内激活。
55034事件监视器处于无效的操作状态。
55035不能删除该表,因为它是受保护的。
55036不能删除该节点,因为它未从该分区映射除去。
55037不能删除该分区键,因为该表在多节点节点组内。
55038该节点组不能使用,因为它正在进行重新平衡。
55039不允许访问或状态转换,因为该表空间未处于适当状态。
55041在进行重新平衡时,不能将容器添加至表空间。
55043当基于该类型的类型表或带类型视图存在时,不能改变结构化类型的属性。
55045不能为该例程创建“SQL归档”(SAR)文件,因为服务器上未提供所需组件。
55046指定的SQL归档与目标环境不匹配。
55047外部函数或方法尝试访问联合对象。
55048不能再加密已加密的数据。
55049未正确定义事件监视器表。
55051 ALTER BUFFERPOOL语句当前正在处理中。
55054不能将方法定义为覆盖方法。
55056由于未启用数据库进行联合,因此不能更新昵称统计信息。
55057不允许使用该语句,因为它将使增量维护某些从属表失效。
55060还没有为数据库定义自动存储器。
55061无法对自动存储器表空间更改表空间存储器。
55062因为没有对数据库启用自动存储器,所以不能提供存储路径。
55063对于该操作来说,XML模式未处于正确状态。
55064无法将基于标号的访问控制应用于列,因为表没有安全策略。
55065一个表最多只能有一种安全策略。
55066表不能分配新页,因为索引尚不支持大型RID。
55067表不能生成受保护的表,因为MQT或登台表依赖于它。

类代码56其他SQL或产品错误
表39.类代码56:其他SQL或产品错误SQLSTATE值  
含义
56016为数据分区指定了无效范围。
56031子句或标量函数无效,因为该系统不支持混合数据和DBCS数据。
56033长字符串列的插入值或更新值必须是主机变量或NULL。
56038此环境不支持请求的功能部件。
56072由于低级别服务器不支持函数,所以执行失败,这不会影响后续SQL语句的执行。
56084在DRDA中不支持LOB数据。
56091执行复合SQL语句时发生多个错误。
56092权限类型不能确定,因为权限名称既是用户标识又是组标识。
56095绑定选项无效。
56097在DEVICE上构建的TABLESPACE中不允许LONG VARCHAR和LONG VARGRAPHIC字段。
56098在隐式重新绑定或预编译期间出错。
56099目标数据库不支持REAL数据类型。
560A0对LOB值的操作失败。
560AA只有Unicode数据库图形数据才支持使用此子句或标量函数。
560AC包装器定义不能用于指定类型或版本的数据源。
560AF当使用网关集中器时,PREPARE语句不受支持。
560B0调整的新表空间或表空间容器大小值无效。
560B1存储过程中有无效的游标规范。
560B7对于多行INSERT,对于每一行,序列表达式的用法都必须相同。
560BB对于动态预编译的CALL语句中的INOUT参数,必须在USING和INTO子句中使用相同的主机变量。
560BC访问文件时发生错误。
560BD联合服务器从数据源中接收到意外的错误代码。
560BF加密工具不可用。
560C0不能在SQL函数或SQL方法中使用以Unicod

e编码方案创建的表。
560C1以Unicode编码方案创建的表不能是类型表或者包含图形类型或用户定义的类型。
560C2为已删除表写历史记录文件条目失败。
560C3后触发器不能修改为INSERT语句插入的一行。
560C6引用约束不能修改由全查询内的SQL数据更改语句修改的行。
560C8不能更新某些昵称统计信息。
560C9不能说明指定的语句。
560CB联合服务器从Web Service数据源中接收到SOAP故障。
560CD在检索警报配置设置时指定的一个或多个值无效。
560CE由于最近的落实或回滚操作,使得SQL变量不可供引用。
560CF无法将表空间转换为大型表空间。
560CG XML值包含一些XML节点的组合,该组合导致超过了内部标识限制。
560CH超过了XML值中XML节点的子节点的最大数目。
560CI指定要返回给客户机的结果集无效。
560CJ必须在IBMCATGROUP数据库分区组中创建表空间。

类代码57资源不可用或操作员干预
表40.类代码57:资源不可用或操作员干预SQLSTATE值  
含义
57001表不可用,因为它没有主索引。
57003尚未激活指定的缓冲池。
57007对象不能使用,因为DROP或ALTER处于暂挂状态。
57009虚拟存储器或数据库资源暂时不可用。
57011虚拟存储器或数据库资源不可用。
57012非数据库资源不可用。这不会影响后续语句的成功执行。
57013非数据库资源不可用。这将影响后继语句的成功执行。
57014按照请求取消了处理。
57016因为表不活动,所以不能访问它。
57017未定义字符转换。
57019该语句因资源问题未成功。
57020包含数据库的驱动器被锁定。
57021软盘驱动器门是打开的。
57022不能创建表,因为语句的授权标识不拥有任何合适的dbspaces。
57030与应用程序服务器的连接超出安装定义的限制。
tp57032已启动最大并发数据库数。
57033发生死锁或超时,而没有自动回滚。
57036事务日志不属于当前的数据库。
57046不能启动新的事务,因为数据库或实例被停顿。
57047不能创建内部数据库文件,因为该目录不可访问。
57048访问表空间的容器时发生错误。
57049已达到操作系统进程界限。
57050文件服务器当前不可用。 
57051估计的CPU成本超出了资源限制。
57052节点不可用,因为它所含有的容器不足以满足所有的临时表空间。
57053因为冲突操作,所以不能对表执行操作。
57055带有足够页大小的临时表空间不可用。 
57056程序包不可用,因为数据库处于NO PACKAGE LOCK方式。
57057由于SQL语句的DRDA链中的优先条件,不能执行该SQL语句。
57059表空间中没有足够的空间用于执行指定的操作。

类代码58系统错误
表41.类代码58:系统错误SQLSTATE值  
含义
58004发生系统错误(它不一定阻止后续SQL语句的成功执行)。
58005发生系统错误(它阻止后续SQL语句的成功执行)。
58008由于分发协议错误致使执行失败,它不影响后续DDM命令或SQL语句的成功执行。
58009由于分发协议错误致使执行失败,它导致对话的释放。
58010由于分发协议错误致使执行失败,它将影响后续DDM命令或SQL语句的成功执行。
58011进行绑定时DDM命令无效。
58012具有指定程序包名和一致性标记的绑定进程不活动。
58014 DDM命令不受支持。
58015 DDM对象不受支持。
58016 DDM参数不受支持。
58017 DDM参数值不受支持。
58018不支持DDM应答消息。
58023系统错误导致当前程序被取消。
58030发生I/O错误。
58031连接因系统错误而未成功。
58032不能将该进程用于设防方式的用户定义的函数。
58034尝试在DMS表空间中寻找对象的页时检测到错误。
58035尝试在DMS表空间中释放对象的页时检测到错误。
58036指定的内部表空间标识不存在。

类代码5U实用程序
表42.类代码5U:实用程序SQLSTATE值  
含义
5U001指定的函数或功能部件不受支持。
5U002指定的应用程序当前不存在。
5U003找不到活动监控器报告。
5U004保存监视任务时所提供的一个或多个值无效。
5U005指定的操作方式无效。
5U006未打开必需的监视开关。
5U007返回了CLP错误。有关详细信息,请参阅CLP消息文档。
5U008实用程序操作标识无效。
5U009已达到存储路径的最大数目。
5U010对非目录数据库分区执行的复原操作不能指定自动存储路径。
5U011复原操作必须指定自动存储路径。
5U012路径中的数据库分区表达式无效或者不正确地使用了它。
5U013不能继续进行复原,因为数据库分区不可用。
5U014授权标识没有对表运行LOAD命令所必需的LBAC凭证。
5U0ZZ例程遇到了错误。参阅SQLCODE以获取详细信息。
ZZZZZ占位符sqlstate仅供开发使用。在交付代码之前必须更改它。

  • 1
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值