Английская Википедия:DB2 SQL return codes

Материал из Онлайн справочника
Перейти к навигацииПерейти к поиску

Шаблон:Short description SQL Return Codes are used on a day-to-day basis for the diagnosis of programming failures as a result of SQL calls by IBM Db2 programs. An important feature of IBM Db2 programs is the error processing. The error diagnostic containing the SQL Return Code is held in the field SQLCODE within the Db2 SQLCA block.

SQLCODE is no longer part of the SQL-standard. The SQL-standard replaced SQLCODE by the more detailed SQLSTATE.

SQLCA

The SQL communications area (SQLCA) structure is used within the IBM Db2 program to return feedback to the application program.

SQLCODE

The SQLCODE field contains the SQL return code. The code can be zero (0), negative or positive:

  • 0 means that the execution was successful.
  • Negative values indicate an unsuccessful execution with an error.
    An example is Шаблон:Val, which means that a timeout has occurred with a rollback.
  • Positive value mean a successful execution with a warning.
    An example is Шаблон:Val, which means that no matching rows were found or that the cursor has reached the end of the table.

Here is a more comprehensive list of the SQLCODEs for DB2. Note that this list is not exhaustive. Also note that some SQLCODEs may only occur in specific Db2 products; e.g., only on Db2 z/OS, only on Db2 LUW, or only on Db2 for IBM i.

Шаблон:Rh colspan="2" |

Zero (Successful)

Шаблон:Mono Successful
Шаблон:Rh colspan="2" |

Negative values (Errors)

Шаблон:Mono The specified 'character' is not a valid character in SQL statements.
Шаблон:Mono THE string constant beginning with string is not terminated properly.
Шаблон:Mono INTO Clause required.
Шаблон:Mono INVALID type SPECIFICATION : spec
Шаблон:Mono Unacceptable SQL statement.
Шаблон:Mono The statement is too long or too complex.
Шаблон:Mono String constant is too long.
Шаблон:Mono String constant is too long. Max is 128 characters.
Шаблон:Mono Illegal symbol encountered in the SQL statement.
Шаблон:Mono String constant is too long.
Шаблон:Mono The number of values in the INSERT does not match the number of columns.
Шаблон:Mono Error in GROUP BY or HAVING clause.
Шаблон:Mono Column or Expression in the Select List is not valid
Шаблон:Mono Invalid syntax near keyword.
Шаблон:Mono Bad data in Date/Time/Timestamp.
Шаблон:Mono Bad data in Date/Time/Timestamp.
Шаблон:Mono The host variable in a DESCRIBE statement is not a valid string representation of a name.
Шаблон:Mono Illegal use of the specified keyword.
Шаблон:Mono A REFERENCE TO COLUMN column-name IS AMBIGUOUS
Шаблон:Mono Object not defined to Db2.
Шаблон:Mono Column name not in table.
Шаблон:Mono Column does not exist in any table of the SELECT.
Шаблон:Mono Invalid column name.
Шаблон:Mono THE ORDER BY CLAUSE IS INVALID BECAUSE COLUMN column-name IS NOT PART OF THE RESULT TABLE
Шаблон:Mono Ambiguous column name
Шаблон:Mono Not the same number of expressions on both sides of the comparison in a SELECT.
Шаблон:Mono FETCH cannot make an INSENSITIVE cursor SENSITIVE.
Шаблон:Mono The locale specified in a SET LOCALE statement was not found.
Шаблон:Mono Implicit conversion in datatype is not allowed.
Шаблон:Mono Db2 is running out of space in tablespace
Шаблон:Mono THE VALUE OF INPUT VARIABLE OR PARAMETER NUMBER position-number IS INVALID OR TOO LARGE FOR THE TARGET COLUMN OR THE TARGET VALUE
Шаблон:Mono A VALUE CANNOT BE ASSIGNED TO OUTPUT HOST VARIABLE NUMBER position-number BECAUSE THE DATA TYPES ARE NOT COMPARABLE
Шаблон:Mono Null indicator needed.
Шаблон:Mono The value of a decimal is null
Шаблон:Mono Varchar, insert or update. -LEN field with the right data length not set.
Шаблон:Mono The number of host variables specified is not equal to the number of parameter markers.
Шаблон:Mono The data types of the operands of an operation are not compatible.
Шаблон:Mono The Sql Statement specified contains a String that is too long.
Шаблон:Mono AN UPDATE, INSERT, OR SET VALUE IS NULL, BUT THE OBJECT COLUMN column-name CANNOT CONTAIN NULL VALUES
Шаблон:Mono A value is not compatible with the data type of its assignment target. Target name is "<name>". (***OBS: Para alguns casos o CAST resolve )
Шаблон:Mono Overflow occurred during numeric data type conversion.
Шаблон:Mono A like predicate is invalid because the first operand is not a string.
Шаблон:Mono The corresponding columns, column-number, of the operands of a set operator are not compatible.
Шаблон:Mono Use of parameter marker not valid.
Шаблон:Mono The value of a string argument was not acceptable to the 'function-name' function
Шаблон:Mono THE OPERANDS OF A UNION OR UNION ALL DO NOT HAVE THE SAME NUMBER OF COLUMNS
Шаблон:Mono The data is too large
Шаблон:Mono Application raised error with diagnostic text: text
Шаблон:Mono Routine &1 in &2 not found with specified parameters.A function or procedure with the specified name and compatible arguments was not found.[1]
Шаблон:Mono The procedure returned no locators.
Шаблон:Mono Cursor not open on FETCH.
Шаблон:Mono Opening cursor that is already open.
Шаблон:Mono Updating column needs to be specified.
Шаблон:Mono Cursor name not declared.
Шаблон:Mono The Table designated by the cursor of the Update or Delete statement cannot be modified.
Шаблон:Mono Referential integrity preventing the INSERT/UPDATE
Шаблон:Mono Referential integrity (DELETE RESTRICT rule) preventing the DELETE.
Шаблон:Mono Referential integrity (DELETE RESTRICT rule) preventing the DELETE.
Шаблон:Mono Check constraint preventing the INSERT/UPDATE.
Шаблон:Mono Authorization failure.
Шаблон:Mono An authorization ID or a role cannot GRANT a privilege to itself.
Шаблон:Mono You tried to create an object that already exists
Шаблон:Mono Too many columns specified in a create index.
Шаблон:Mono a unique index cannot be created because the table contains rows which are duplicates with respect to the values of the identified columns and periods
Шаблон:Mono a data type definition specifies an invalid length, precision, or scale attribute
Шаблон:Mono operation or option operation is not defined for this object
Шаблон:Mono warning: a create/alter on object has placed object in pending
Шаблон:Mono only lockmax 0 can be specified when the lock size of the tablespace is tablespace or table
Шаблон:Mono identifier is a duplicate name
Шаблон:Mono the primary key or a hash key or a unique constraint is too long or has too many columns and periods
Шаблон:Mono the index cannot be created or altered, or the length of a column cannot be changed because the sum of the internal lengths of the columns for the index is greater than the allowable maximum
Шаблон:Mono operation-type is not allowed on a package in use
Шаблон:Mono obj-type1 obj-name1 cannot be dropped because it is referenced by obj-type2 obj-name2
Шаблон:Mono a type 1 index is not valid for table
Шаблон:Mono operation operation is not allowed on system databases
Шаблон:Mono operation disallowed because the database is not stopped
Шаблон:Mono keyword keyword in stmt-type statement is not permitted for a space-type space in the database-type database
Шаблон:Mono duplicate dbid dbid was detected and previously assigned to database-name
Шаблон:Mono for mixed data is invalid because the mixed data install option is no
Шаблон:Mono cluster is not valid for table-name
Шаблон:Mono table table-name already has a primary key or unique constraint with specified columns and periods
Шаблон:Mono table table-name does not have an index to enforce the uniqueness of the primary or unique key
Шаблон:Mono warning: the definition of table has been changed to incomplete
Шаблон:Mono the alter statement is not executable because the page set is not stopped
Шаблон:Mono the alter statement is invalid because the table space or index has user-managed data sets
Шаблон:Mono the clauses are mutually exclusive
Шаблон:Mono set null cannot be specified because foreign key name cannot contain null values
Шаблон:Mono error: the WHERE NOT NULL specification is invalid for type 1 indexes
Шаблон:Mono foreign key name is too long or has too many columns
Шаблон:Mono the table cannot be defined as a dependent of table-name because of DELETE rule restrictions
Шаблон:Mono the DELETE rule must be DELETE-rule
Шаблон:Mono the DELETE rule must not be cascade
Шаблон:Mono the DELETE rules cannot be different or cannot be set null
Шаблон:Mono ranges specified for partition part-num are not valid
Шаблон:Mono duplicate keyword-name keyword or clause
Шаблон:Mono table table-name cannot be created because column definition is missing
Шаблон:Mono a nullable column of a foreign key with a DELETE rule of set null cannot be a column of the key of a partitioned index
Шаблон:Mono locksize row cannot be specified because table in this tablespace has type 1 index
Шаблон:Mono too many columns in unique constraints
Шаблон:Mono a check constraint or the value of an expression for a column of an index exceeds the maximum allowable length key expression
Шаблон:Mono invalid value specified for keyword or clause keyword-or-clause in statement stmt-type
Шаблон:Mono WHERE NOT NULL is ignored because the index key cannot contain null values
Шаблон:Mono table table-name cannot be created in specified table space table-space-name because it already contains a table
Шаблон:Mono bufferpool bp-name for implicit or explicit tablespace or indexspace name has not been activated
Шаблон:Mono the alter statement cannot be executed, reason reason-code copyright 2014 TheAmericanProgrammer.com Unauthorized copying prohibited
Шаблон:Mono table description exceeds maximum size of object descriptor.
Шаблон:Mono violation of installation defined edit or validation procedure proc-name
Шаблон:Mono table table-name in partitioned table space tspace-name is not available because its partitioned index has not been created
Шаблон:Mono the create or alter stogroup is invalid because the storage group would have both specific and non-specific volume ids
Шаблон:Mono a object-type cannot be dropped using the statement statement
Шаблон:Mono index index-name cannot be created or altered on partitioned table space tspace-name because key limits are not specified
Шаблон:Mono object-type object-name cannot be created on partitioned table space tspace-name because the number of partition specifications is not equal to the number of partitions of the table space
Шаблон:Mono a partitioned index cannot be created on a table space, or a table space cannot be index-controlled. table space tspace-name, reason reason-code
Шаблон:Mono the number of key limit values is either zero, or greater than the number of columns in the key of index index-name
Шаблон:Mono the internal length of the limit-key fields for the partitioned index exceeds the length imposed by the index manager
Шаблон:Mono the partition clause of an alter statement is omitted or invalid
Шаблон:Mono stmt-verb object cannot be executed because function is in progress
Шаблон:Mono the clustering index for a partitioned table space cannot be explicitly dropped
Шаблон:Mono the column cannot be added to the table because the table has an edit procedure defined with row attribute sensitivity
Шаблон:Mono the object cannot be explicitly dropped. reason reason-code
Шаблон:Mono the record length of the table exceeds the page size limit
Шаблон:Mono the bufferpool attribute of the table space cannot be altered as specified because it would change the page size of the table space
Шаблон:Mono operation drop not allowed on table table_name
Шаблон:Mono the physical characteristics of the index are incompatible with respect to the specified statement. the statement has failed. reason reason-code
Шаблон:Mono insufficient virtual storage for bufferpool expansion
Шаблон:Mono the constant specified for the index limit key must conform to the data type data-type of the corresponding column column-name
Шаблон:Mono the object name cannot be created because a drop is pending on the object
Шаблон:Mono too many columns specified for a table, view or table function
Шаблон:Mono column column-name in violation of installation defined field procedure. rt: return-code, rs: reason-code, msg: message-token
Шаблон:Mono field procedure procedure-name could not be loaded
Шаблон:Mono the specification for column, distinct type, function, or procedure data-item contains incompatible clauses
Шаблон:Mono the length of constant list beginning string is too long
Шаблон:Mono invalid field type, column-name
Шаблон:Mono column defined with a field procedure can not compare with another column with different field procedure
Шаблон:Mono field types incomparable
Шаблон:Mono incorrect data returned from field procedure, column-name, msgno
Шаблон:Mono too many columns defined for a dependent table
Шаблон:Mono the statement is rejected by data definition control support. reason reason-code
Шаблон:Mono the required registration table table-name does not exist
Шаблон:Mono the required unique index index-name for ddl registration table table-name does not exist
Шаблон:Mono the column column-name in ddl registration table or index name is not defined properly
Шаблон:Mono the schema statement cannot be executed because a drop is pending on the ddl registration table table-name
Шаблон:Mono the ddl statement cannot be executed because a drop is pending on the ddl registration table
Шаблон:Mono invalid value seclabel specified for security label column of table table-name
Шаблон:Mono the definition of trigger trigger-name includes an invalid use of correlation name or transition table name name. reason code=reason-code
Шаблон:Mono old or new correlation names are not allowed in a trigger defined with the for each statement clause. old_table or new_table names are not allowed in a trigger with the before clause.
Шаблон:Mono The table is not available.
Шаблон:Mono Duplicate key on insert or update.
Шаблон:Mono Error in input parameters for the SQL statement.
Шаблон:Mono DBRM or package not found in plan.
Шаблон:Mono More than one row retrieved in SELECT INTO.
Шаблон:Mono Plan and program: timestamp mismatch.
Шаблон:Mono Pointer to Essential Control Block(RDA/CT) has value 0, Rebind Required. This may also occur if one of the DB volumes is still present, but inaccessible.
Шаблон:Mono Unavailable resource. Someone else is locking your data.
Шаблон:Mono Deadlock or timeout. Rollback has been done.
Шаблон:Mono Deadlock or timeout. No rollback.
Шаблон:Mono Authorization needed.
Шаблон:Mono Db2 Connection internal error.
Шаблон:Mono The language interface was called but no connection had been made.
Шаблон:Mono Sort memory cannot be allocated to process the statement.
Шаблон:Mono The transaction log space is depleted or temporary increase in the number of active transactions.
Шаблон:Mono wrong (also missing) permissions on Db2 file systems / Db2 filesystems owned by root.
Шаблон:Mono Error occurred during transaction or heuristic processing.
   
Шаблон:Mono The utility could not generate statistics
Шаблон:Mono Load Error accessing scratch space. Error in accessing a file or path of type "TEMP_FILE" during load or load query. The scratch directory where the msg files in a load job are stored does not have the required permissions.
Шаблон:Mono The object that is specified is not valid for the requested operation.
Шаблон:Mono Permission denied to change database. Contact system administrator.
Шаблон:Mono Remote operation invalid for application execution environment.
Шаблон:Rh colspan="2" |

Positive Values (Warnings)

  +98 A dynamic SQL statement ends with a semicolon
Шаблон:Mono Row not found or end of cursor.
Шаблон:Mono Trying to fetch a row within a DELETE statement.
Шаблон:Mono Trying to fetch a row within an UPDATE statement.
Шаблон:Mono FETCH after a BEFORE or AFTER but not on a valid row.
Шаблон:Mono A value with data type (data type 1) cannot be assigned to a host variable because the value is not within the range of the host variable in position (position number) with data type (data type 2)
Шаблон:Mono A rowset fetch statement may have returned one or more rows of data. however, one or more warning conditions were also encountered. use the get diagnostics statement for more information regarding the conditions that were encountered
+466 The stored procedure named by proc completed normally. The procedure returned the number of SQL query result sets specified in num.
Шаблон:Mono A grant of a privilege was ignored because the grantee already has the privilege from the grantor.
Шаблон:Mono The null indicator was set to -2 as an arithmetic.

[1]

References

Шаблон:Reflist

Шаблон:IBM Db2 product family