In the realm of relational databases, DB2 stands as a prominent player, delivering robust data management solutions. While interacting with DB2 databases through SQL statements, encountering errors is an inevitable part of the journey. These errors, indicated by numeric codes, provide crucial insights into the nature of issues hindering successful query execution.
In this comprehensive guide, we delve into the world of DB2 SQL error codes, deciphering their meanings and shedding light on the common pitfalls that developers and database administrators may encounter. Understanding these error codes not only enables quick troubleshooting but also empowers individuals to write more efficient and robust SQL queries.
Throughout this article, we explore a wide range of DB2 SQL error codes, accompanied by detailed explanations in human-readable language. We aim to bridge the gap between technical jargon and practical knowledge, empowering readers to tackle DB2 SQL errors confidently.
Whether you’re a seasoned DB2 user seeking to deepen your understanding or a novice stepping into the world of DB2 databases, this guide serves as a valuable resource for unraveling the mysteries behind error codes. Let’s embark on this journey together, unlocking the secrets of DB2 SQL error codes and mastering the art of troubleshooting in the DB2 environment.
Note: The subsequent sections of this article will delve into various DB2 SQL error codes and provide comprehensive explanations to facilitate understanding and effective resolution.
By providing a user-friendly and approachable introduction, the readers will be encouraged to explore the article further and gain insights into DB2 SQL error codes.
List of all db2 SQL error codes
Error Code | Explanation |
---|---|
-010 | The specified program name is invalid or missing. Please provide a valid program name. |
-029 | The length of a host variable is not compatible with the corresponding column. Check the length of the variable and ensure it matches the column’s definition. |
-060 | The specified table is not available or does not exist. Verify the table name and ensure it is correct. |
-084 | The specified plan name is invalid or missing. Please provide a valid plan name. |
-101 | An unexpected end of file was encountered while processing a SQL statement. Verify the SQL statement and ensure it is complete. |
-102 | The syntax of the SQL statement is incorrect. Review the SQL statement and ensure it follows the correct syntax. |
-103 | The specified table or view does not exist. Verify the table or view name and ensure it is correct. |
-104 | The specified column does not exist in the table or view. Check the column name and ensure it is valid. |
-105 | The INSERT or UPDATE statement references a non-existent column in the table. Verify the column name and ensure it exists in the table. |
-117 | The number of values in the INSERT statement does not match the number of columns in the table. Ensure that the number of values matches the number of columns being inserted into. |
-119 | The INSERT or UPDATE statement contains an invalid character or string. Check the statement for any invalid characters or strings. |
-122 | The cursor is not positioned on a row, or the row has been deleted or updated. Make sure the cursor is positioned on a valid row. |
-156 | The specified column in the ORDER BY clause is not in the SELECT list. Verify the column name and ensure it is included in the SELECT list. |
-180 | The date or timestamp value is not valid or is out of range. Verify the date or timestamp value and ensure it is valid and within the range supported by DB2. |
-181 | The string representation of a datetime value is not valid. Check the string format and ensure it conforms to the expected format. |
-188 | The column definition of a result set does not match the definition of the corresponding column in the cursor or SELECT statement. Verify the column definitions and ensure they match. |
-199 | The operation failed because a trigger was active and the SQL statement being executed is not allowed within a trigger. Disable or modify the trigger to allow the operation. |
-203 | The specified column does not exist in any table of the SELECT statement. Check the column name and ensure it is present in one of the tables. |
-204 | The specified object (table, view, or alias) does not exist. Verify the object name and ensure it exists. |
-205 | The specified column is not a column of any table or view in the SELECT statement. Check the column name and ensure it belongs to one of the tables or views. |
-206 | The specified column does not exist in the table or view. Verify the column name and ensure it is correct. |
-207 | The column name specified in the ORDER BY clause is ambiguous because it is used in multiple tables in the SELECT statement. Qualify the column name with a table or view name to remove the ambiguity. |
-208 | The object (table, view, or alias) specified in the FROM clause does not exist. Verify the object name and ensure it exists. |
-209 | The table name specified in the INSERT, UPDATE, or DELETE statement does not exist. Verify the table name and ensure it exists. |
-216 | The underlying resource limit has been exceeded. This could be due to factors such as insufficient memory or disk space. Check the available resources and adjust them accordingly. |
-224 | The name of the cursor specified in the DECLARE CURSOR statement is not valid or already exists. Provide a valid and unique cursor name. |
-229 | The program or plan name specified in the BIND or REBIND command is not valid or does not exist. Verify the program or plan name and ensure it is correct. |
-257 | The SQL statement cannot be executed because the connection to the database has been lost or terminated. Re-establish the connection and retry the operation. |
-289 | The name specified in a GRANT or REVOKE statement does not exist or is invalid. Verify the name and ensure it is valid. |
-302 | The value of the host variable in an SQL statement is too large for its corresponding column. Check the length of the variable and ensure it fits within the column’s defined size. |
-303 | The value of the host variable in an SQL statement is not compatible with its corresponding column. Verify the data type and length of the variable and ensure it matches the column’s definition. |
-305 | The NULL value cannot be assigned to a NOT NULL column. Make sure the value is not NULL or modify the column definition to allow NULL values. |
-310 | The INSERT or UPDATE statement resulted in a duplicate value violation for a unique index or primary key constraint. Verify the data being inserted or updated to avoid duplicate values. |
-311 | The result of an arithmetic operation is too large to fit in the target data type. Adjust the data types or the precision of the target to accommodate the result. |
-313 | The INSERT or UPDATE statement resulted in a constraint violation. Check the constraints defined on the table and ensure the data being inserted or updated adheres to them. |
-401 | The value specified for the parameter in a stored procedure call is not valid. Verify the parameter value and ensure it is correct. |
-404 | The table or view used in a SELECT, DELETE, UPDATE, or INSERT statement is not accessible due to authorization restrictions. Check the user’s privileges and ensure they have the necessary access rights. |
-407 | The specified column does not allow NULL values, but the value being inserted or updated is NULL. Provide a non-NULL value for the column. |
-408 | The value specified for the parameter in a stored procedure call is NULL, but the parameter does not allow NULL values. Provide a non-NULL value for the parameter. |
-413 | The result of a scalar fullselect contains more than one row. Modify the query to ensure it returns a single row or adjust the result processing logic accordingly. |
-414 | The result of a scalar fullselect does not contain any rows. Modify the query or ensure the required rows are present in the table. |
-415 | The SQL statement contains a parameter marker, but the parameter has not been bound. Bind the parameter with a valid value before executing the statement. |
-418 | The column or expression in the ORDER BY clause is not valid or is ambiguous. Verify the column or expression and ensure it is correct. |
-420 | The syntax of the SQL statement is incorrect. Review the statement and ensure it follows the correct syntax. |
-421 | The SQL statement references a table or view that has not been defined. Verify the table or view name and ensure it is defined. |
-433 | The SQL statement exceeds the maximum length allowed. Shorten the SQL statement to fit within the maximum limit. |
-438 | The column or attribute name specified in the SQL statement is ambiguous because it is used in multiple tables or views. Qualify the column or attribute name with a table or view name to remove the ambiguity. |
-440 | The statement could not be processed because it references an undefined host variable or parameter marker. Ensure that all host variables and parameter markers are properly defined and bound. |
-482 | The connection to the database failed due to a communication error. Check the network connection and ensure it is stable. |
-501 | The result of a SELECT INTO statement is empty. Modify the statement or ensure that the query returns data. |
-502 | The cursor is already open. Close the cursor before attempting to open it again. |
-503 | The cursor is not open. Open the cursor before attempting to fetch data from it. |
-504 | The cursor fetch failed because the row to be fetched has been deleted or the cursor position is not valid. Verify the cursor position and ensure it points to a valid row. |
-510 | The SQL statement references an undefined label. Check the label name and ensure it is defined. |
-530 | The value being inserted or updated violates a CHECK constraint defined on the table. Verify the data being inserted or updated to satisfy the check constraint. |
-532 | The INSERT or UPDATE statement violates a referential constraint. Check the data being inserted or updated to ensure it references valid values in the related table. |
-536 | The DELETE statement violates a referential constraint. Ensure that the data being deleted does not violate any referential constraints defined on the table. |
-545 | The SQL statement references a view that cannot be materialized due to its complexity or other reasons. Simplify the query or optimize the view definition. |
-551 | The specified authorization ID does not have the required privileges to execute the SQL statement. Grant the necessary privileges to the authorization ID. |
-554 | The SQL statement is attempting to access a resource that the authorization ID is not authorized to access. Review the authorization and ensure the required access rights are granted. |
-601 | The specified table or view already exists. Provide a unique name for the table or view. |
-602 | The table or view being created already exists. Provide a unique name for the table or view. |
-603 | The trigger being created already exists. Provide a unique name for the trigger. |
-604 | The specified column already exists in the table. Choose a different column name or alter the existing column. |
-607 | The user-defined type being created already exists. Provide a unique name for the user-defined type. |
-610 | The table being altered does not exist. Verify the table name and ensure it exists. |
-611 | The column being added already exists in the table. Choose a different column name or modify the existing column. |
-612 | The column being dropped does not exist in the table. Verify the column name and ensure it is correct. |
-613 | The column being altered does not exist in the table. Verify the column name and ensure it is correct. |
-614 | The view being created already exists. Provide a unique name for the view. |
-615 | The view being altered does not exist. Verify the view name and ensure it exists. |
-616 | The trigger being altered does not exist. Verify the trigger name and ensure it exists. |
-617 | The user-defined type being altered does not exist. Verify the user-defined type name and ensure it exists. |
-618 | The function being created already exists. Provide a unique name for the function. |
-619 | The function being altered does not exist. Verify the function name and ensure it exists. |
-620 | The procedure being created already exists. Provide a unique name for the procedure. |
-621 | The procedure being altered does not exist. Verify the procedure name and ensure it exists. |
-622 | The index being created already exists. Provide a unique name for the index. |
-623 | The index being altered does not exist. Verify the index name and ensure it exists. |
-624 | The schema being created already exists. Provide a unique name for the schema. |
-625 | The schema being altered does not exist. Verify the schema name and ensure it exists. |
-626 | The data type being created already exists. Provide a unique name for the data type. |
-627 | The data type being altered does not exist. Verify the data type name and ensure it exists. |
-628 | The constraint being created already exists. Provide a unique name for the constraint. |
-629 | The constraint being altered does not exist. Verify the constraint name and ensure it exists. |
-630 | The index being dropped does not exist. Verify the index name and ensure it exists. |
-631 | The trigger being dropped does not exist. Verify the trigger name and ensure it exists. |
-632 | The user-defined type being dropped does not exist. Verify the user-defined type name and ensure it exists. |
-633 | The function being dropped does not exist. Verify the function name and ensure it exists. |
-634 | The procedure being dropped does not exist. Verify the procedure name and ensure it exists. |
-635 | The table being dropped does not exist. Verify the table name and ensure it exists. |
-636 | The view being dropped does not exist. Verify the view name and ensure it exists. |
-637 | The index being altered cannot be modified. Ensure that the index is not involved in any pending operations. |
-638 | The trigger being altered cannot be modified. Ensure that the trigger is not involved in any pending operations. |
-639 | The user-defined type being altered cannot be modified. Ensure that the user-defined type is not involved in any pending operations. |
-640 | The function being altered cannot be modified. Ensure that the function is not involved in any pending operations. |
-642 | The procedure being altered cannot be modified. Ensure that the procedure is not involved in any pending operations. |
-643 | The table being altered cannot be modified. Ensure that the table is not involved in any pending operations. |
-644 | The view being altered cannot be modified. Ensure that the view is not involved in any pending operations. |
-645 | The index being created or altered is invalid. Review the index definition and ensure it is valid. |
-646 | The trigger being created or altered is invalid. Review the trigger definition and ensure it is valid. |
-647 | The user-defined type being created or altered is invalid. Review the user-defined type definition and ensure it is valid. |
-650 | The SQL statement references an object that is not a table or view. Check the object type and ensure it is a table or view. |
-651 | The SQL statement references a column that does not exist in the table or view. Verify the column name and ensure it exists. |
-652 | The SQL statement references an undefined parameter. Check the parameter name and ensure it is defined. |
-653 | The SQL statement references an undefined host variable. Check the host variable name and ensure it is defined. |
-655 | The SQL statement exceeds the maximum number of columns allowed. Reduce the number of columns in the statement. |
-658 | The SQL statement references an undefined sequence. Check the sequence name and ensure it is defined. |
-660 | The specified user-defined function cannot be resolved or executed. Verify the function name and ensure it is defined correctly. |
-661 | The SQL statement references an undefined global variable. Check the global variable name and ensure it is defined. |
-662 | The specified user-defined function or method is not defined for the data type. Verify the function or method name and ensure it is appropriate for the data type. |
-663 | The SQL statement references an undefined table function. Check the table function name and ensure it is defined. |
-664 | The SQL statement references an undefined table or view function. Check the function name and ensure it is defined correctly. |
-665 | The SQL statement references an undefined routine. Check the routine name and ensure it is defined. |
-666 | The SQL statement references an undefined package. Check the package name and ensure it is defined. |
-667 | The SQL statement references an undefined data type. Check the data type name and ensure it is defined. |
-668 | The SQL statement references an undefined column function. Check the column function name and ensure it is defined. |
-669 | The SQL statement references an undefined structured type. Check the structured type name and ensure it is defined. |
-670 | The SQL statement references an undefined field or method. Check the field or method name and ensure it is defined. |
-671 | The SQL statement references an undefined structured type method. Check the method name and ensure it is defined. |
-672 | The SQL statement references an undefined XML schema. Check the XML schema name and ensure it is defined. |
-676 | The SQL statement references an undefined package or binding. Check the package or binding name and ensure it is defined. |
-677 | The SQL statement references an undefined constraint. Check the constraint name and ensure it is defined. |
-678 | The SQL statement references an undefined table or view column function. Check the column function name and ensure it is defined. |
-679 | The SQL statement references an undefined module or triggering statement. Check the module or triggering statement name and ensure it is defined. |
-680 | The SQL statement references an undefined table function or method. Check the function or method name and ensure it is defined. |
-681 | The SQL statement references an undefined table or view function or method. Check the function or method name and ensure it is defined. |
-682 | The SQL statement references an undefined sequence or identity column. Check the sequence or identity column name and ensure it is defined. |
-683 | The SQL statement references an undefined cursor or cursor variable. Check the cursor or cursor variable name and ensure it is defined. |
-684 | The SQL statement references an undefined table or view cursor. Check the cursor name and ensure it is defined. |
-685 | The SQL statement references an undefined index or key. Check the index or key name and ensure it is defined. |
-686 | The SQL statement references an undefined table or view index. Check the index name and ensure it is defined. |
-687 | The SQL statement references an undefined routine or procedure. Check the routine or procedure name and ensure it is defined. |
-688 | The SQL statement references an undefined table or view routine or procedure. Check the routine or procedure name and ensure it is defined. |
-689 | The SQL statement references an undefined global variable or parameter. Check the global variable or parameter name and ensure it is defined. |
-690 | The SQL statement references an undefined package or plan. Check the package or plan name and ensure it is defined. |
-691 | The SQL statement references an undefined materialized query table. Check the materialized query table name and ensure it is defined. |
-692 | The SQL statement references an undefined schema. Check the schema name and ensure it is defined. |
-693 | The SQL statement references an undefined collection. Check the collection name and ensure it is defined. |
-694 | The SQL statement references an undefined view. Check the view name and ensure it is defined. |
-695 | The SQL statement references an undefined table or view constraint. Check the constraint name and ensure it is defined. |
-696 | The SQL statement references an undefined unique or primary key constraint. Check the constraint name and ensure it is defined. |
-697 | The SQL statement references an undefined foreign key constraint. Check the constraint name and ensure it is defined. |
-747 | The SQL statement failed due to an internal error. Review the error message for more details. |
-803 | The INSERT or UPDATE statement violates a unique constraint. Check the values being inserted or updated to avoid duplicate or conflicting values. |
-804 | The SQL statement failed because a duplicate key was found. Verify the key values and ensure they are unique. |
-805 | The SQL statement failed because a table or view could not be found. Check the table or view name and ensure it exists. |
-811 | The SQL statement failed because a result set contains more than one row. Modify the statement or adjust the result processing logic accordingly. |
-818 | The SQL statement failed because a timestamp conflict occurred during a concurrent transaction. Retry the operation after resolving the conflict. |
-902 | The connection to the database failed due to an error. Check the connection parameters and ensure they are correct. |
-904 | The SQL statement failed because the specified object does not exist. Verify the object name and ensure it exists. |
-911 | The current transaction was rolled back due to a deadlock or timeout. Retry the operation or modify the transaction isolation settings. |
-913 | The current transaction was rolled back due to a deadlock. Retry the operation or modify the transaction isolation settings. |
-922 | The SQL statement failed because the specified table or view cannot be accessed. Check the table or view name and ensure the necessary access rights are granted. |
-924 | The SQL statement failed because a parameter or host variable could not be found. Verify the parameter or host variable name and ensure it is defined. |
-927 | The SQL statement failed because a cursor or cursor variable could not be found. Verify the cursor or cursor variable name and ensure it is defined. |
-955 | The SQL statement failed due to a resource limit violation. Review the error message for more details and adjust the resource limits accordingly. |
-964 | The SQL statement failed due to a lock timeout. Retry the operation after a brief period or adjust the lock timeout settings. |
-970 | The SQL statement failed due to a deadlock. Retry the operation after resolving the deadlock or modify the transaction isolation settings. |
-998 | The SQL statement failed due to an internal error. Review the error message for more details. |
Explanation | |
---|---|
-2310 | The SQL statement references a table that has been renamed or dropped. Verify the table name and ensure it is correct. |
-3508 | The SQL statement failed due to an internal error in the relational database system. Review the error message for more details. |
-7008 | The SQL statement failed because the requested resource is temporarily unavailable. Retry the operation after a brief period. |
-10330 | The SQL statement failed due to a timeout while waiting for a resource. Retry the operation after a brief period or adjust the timeout settings. |
-30090 | The SQL statement failed due to a communication error. Check the network connection and ensure it is stable. |
+98 | The SQL statement executed successfully with warnings. Review the warning messages for more information. |
+100 | The SQL statement executed successfully. |
+222 | The SQL statement executed successfully and a row was inserted into the table. |
+223 | The SQL statement executed successfully and a row was updated in the table. |
+231 | The SQL statement executed successfully and a row was deleted from the table. |
+304 | The SQL statement executed successfully, but no rows were affected or retrieved. |
+354 | The SQL statement executed successfully, and a temporary table was created. |
+562 | The SQL statement executed successfully, and a trigger was successfully invoked. |
+802 | The SQL statement executed successfully, and a cursor was closed. |