List of All db2 SQL Error Codes – Explained!

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 CodeExplanation
-010The specified program name is invalid or missing. Please provide a valid program name.
-029The 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.
-060The specified table is not available or does not exist. Verify the table name and ensure it is correct.
-084The specified plan name is invalid or missing. Please provide a valid plan name.
-101An unexpected end of file was encountered while processing a SQL statement. Verify the SQL statement and ensure it is complete.
-102The syntax of the SQL statement is incorrect. Review the SQL statement and ensure it follows the correct syntax.
-103The specified table or view does not exist. Verify the table or view name and ensure it is correct.
-104The specified column does not exist in the table or view. Check the column name and ensure it is valid.
-105The INSERT or UPDATE statement references a non-existent column in the table. Verify the column name and ensure it exists in the table.
-117The 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.
-119The INSERT or UPDATE statement contains an invalid character or string. Check the statement for any invalid characters or strings.
-122The 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.
-156The 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.
-180The 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.
-181The string representation of a datetime value is not valid. Check the string format and ensure it conforms to the expected format.
-188The 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.
-199The 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.
-203The 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.
-204The specified object (table, view, or alias) does not exist. Verify the object name and ensure it exists.
-205The 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.
-206The specified column does not exist in the table or view. Verify the column name and ensure it is correct.
-207The 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.
-208The object (table, view, or alias) specified in the FROM clause does not exist. Verify the object name and ensure it exists.
-209The table name specified in the INSERT, UPDATE, or DELETE statement does not exist. Verify the table name and ensure it exists.
-216The 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.
-224The name of the cursor specified in the DECLARE CURSOR statement is not valid or already exists. Provide a valid and unique cursor name.
-229The 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.
-257The SQL statement cannot be executed because the connection to the database has been lost or terminated. Re-establish the connection and retry the operation.
-289The name specified in a GRANT or REVOKE statement does not exist or is invalid. Verify the name and ensure it is valid.
-302The 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.
-303The 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.
-305The 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.
-310The 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.
-311The 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.
-313The 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.
-401The value specified for the parameter in a stored procedure call is not valid. Verify the parameter value and ensure it is correct.
-404The 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.
-407The specified column does not allow NULL values, but the value being inserted or updated is NULL. Provide a non-NULL value for the column.
-408The 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.
-413The 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.
-414The result of a scalar fullselect does not contain any rows. Modify the query or ensure the required rows are present in the table.
-415The SQL statement contains a parameter marker, but the parameter has not been bound. Bind the parameter with a valid value before executing the statement.
-418The column or expression in the ORDER BY clause is not valid or is ambiguous. Verify the column or expression and ensure it is correct.
-420The syntax of the SQL statement is incorrect. Review the statement and ensure it follows the correct syntax.
-421The SQL statement references a table or view that has not been defined. Verify the table or view name and ensure it is defined.
-433The SQL statement exceeds the maximum length allowed. Shorten the SQL statement to fit within the maximum limit.
-438The 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.
-440The 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.
-482The connection to the database failed due to a communication error. Check the network connection and ensure it is stable.
-501The result of a SELECT INTO statement is empty. Modify the statement or ensure that the query returns data.
-502The cursor is already open. Close the cursor before attempting to open it again.
-503The cursor is not open. Open the cursor before attempting to fetch data from it.
-504The 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.
-510The SQL statement references an undefined label. Check the label name and ensure it is defined.
-530The 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.
-532The 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.
-536The DELETE statement violates a referential constraint. Ensure that the data being deleted does not violate any referential constraints defined on the table.
-545The SQL statement references a view that cannot be materialized due to its complexity or other reasons. Simplify the query or optimize the view definition.
-551The specified authorization ID does not have the required privileges to execute the SQL statement. Grant the necessary privileges to the authorization ID.
-554The 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.
-601The specified table or view already exists. Provide a unique name for the table or view.
-602The table or view being created already exists. Provide a unique name for the table or view.
-603The trigger being created already exists. Provide a unique name for the trigger.
-604The specified column already exists in the table. Choose a different column name or alter the existing column.
-607The user-defined type being created already exists. Provide a unique name for the user-defined type.
-610The table being altered does not exist. Verify the table name and ensure it exists.
-611The column being added already exists in the table. Choose a different column name or modify the existing column.
-612The column being dropped does not exist in the table. Verify the column name and ensure it is correct.
-613The column being altered does not exist in the table. Verify the column name and ensure it is correct.
-614The view being created already exists. Provide a unique name for the view.
-615The view being altered does not exist. Verify the view name and ensure it exists.
-616The trigger being altered does not exist. Verify the trigger name and ensure it exists.
-617The user-defined type being altered does not exist. Verify the user-defined type name and ensure it exists.
-618The function being created already exists. Provide a unique name for the function.
-619The function being altered does not exist. Verify the function name and ensure it exists.
-620The procedure being created already exists. Provide a unique name for the procedure.
-621The procedure being altered does not exist. Verify the procedure name and ensure it exists.
-622The index being created already exists. Provide a unique name for the index.
-623The index being altered does not exist. Verify the index name and ensure it exists.
-624The schema being created already exists. Provide a unique name for the schema.
-625The schema being altered does not exist. Verify the schema name and ensure it exists.
-626The data type being created already exists. Provide a unique name for the data type.
-627The data type being altered does not exist. Verify the data type name and ensure it exists.
-628The constraint being created already exists. Provide a unique name for the constraint.
-629The constraint being altered does not exist. Verify the constraint name and ensure it exists.
-630The index being dropped does not exist. Verify the index name and ensure it exists.
-631The trigger being dropped does not exist. Verify the trigger name and ensure it exists.
-632The user-defined type being dropped does not exist. Verify the user-defined type name and ensure it exists.
-633The function being dropped does not exist. Verify the function name and ensure it exists.
-634The procedure being dropped does not exist. Verify the procedure name and ensure it exists.
-635The table being dropped does not exist. Verify the table name and ensure it exists.
-636The view being dropped does not exist. Verify the view name and ensure it exists.
-637The index being altered cannot be modified. Ensure that the index is not involved in any pending operations.
-638The trigger being altered cannot be modified. Ensure that the trigger is not involved in any pending operations.
-639The user-defined type being altered cannot be modified. Ensure that the user-defined type is not involved in any pending operations.
-640The function being altered cannot be modified. Ensure that the function is not involved in any pending operations.
-642The procedure being altered cannot be modified. Ensure that the procedure is not involved in any pending operations.
-643The table being altered cannot be modified. Ensure that the table is not involved in any pending operations.
-644The view being altered cannot be modified. Ensure that the view is not involved in any pending operations.
-645The index being created or altered is invalid. Review the index definition and ensure it is valid.
-646The trigger being created or altered is invalid. Review the trigger definition and ensure it is valid.
-647The user-defined type being created or altered is invalid. Review the user-defined type definition and ensure it is valid.
-650The SQL statement references an object that is not a table or view. Check the object type and ensure it is a table or view.
-651The SQL statement references a column that does not exist in the table or view. Verify the column name and ensure it exists.
-652The SQL statement references an undefined parameter. Check the parameter name and ensure it is defined.
-653The SQL statement references an undefined host variable. Check the host variable name and ensure it is defined.
-655The SQL statement exceeds the maximum number of columns allowed. Reduce the number of columns in the statement.
-658The SQL statement references an undefined sequence. Check the sequence name and ensure it is defined.
-660The specified user-defined function cannot be resolved or executed. Verify the function name and ensure it is defined correctly.
-661The SQL statement references an undefined global variable. Check the global variable name and ensure it is defined.
-662The 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.
-663The SQL statement references an undefined table function. Check the table function name and ensure it is defined.
-664The SQL statement references an undefined table or view function. Check the function name and ensure it is defined correctly.
-665The SQL statement references an undefined routine. Check the routine name and ensure it is defined.
-666The SQL statement references an undefined package. Check the package name and ensure it is defined.
-667The SQL statement references an undefined data type. Check the data type name and ensure it is defined.
-668The SQL statement references an undefined column function. Check the column function name and ensure it is defined.
-669The SQL statement references an undefined structured type. Check the structured type name and ensure it is defined.
-670The SQL statement references an undefined field or method. Check the field or method name and ensure it is defined.
-671The SQL statement references an undefined structured type method. Check the method name and ensure it is defined.
-672The SQL statement references an undefined XML schema. Check the XML schema name and ensure it is defined.
-676The SQL statement references an undefined package or binding. Check the package or binding name and ensure it is defined.
-677The SQL statement references an undefined constraint. Check the constraint name and ensure it is defined.
-678The SQL statement references an undefined table or view column function. Check the column function name and ensure it is defined.
-679The SQL statement references an undefined module or triggering statement. Check the module or triggering statement name and ensure it is defined.
-680The SQL statement references an undefined table function or method. Check the function or method name and ensure it is defined.
-681The SQL statement references an undefined table or view function or method. Check the function or method name and ensure it is defined.
-682The SQL statement references an undefined sequence or identity column. Check the sequence or identity column name and ensure it is defined.
-683The SQL statement references an undefined cursor or cursor variable. Check the cursor or cursor variable name and ensure it is defined.
-684The SQL statement references an undefined table or view cursor. Check the cursor name and ensure it is defined.
-685The SQL statement references an undefined index or key. Check the index or key name and ensure it is defined.
-686The SQL statement references an undefined table or view index. Check the index name and ensure it is defined.
-687The SQL statement references an undefined routine or procedure. Check the routine or procedure name and ensure it is defined.
-688The SQL statement references an undefined table or view routine or procedure. Check the routine or procedure name and ensure it is defined.
-689The SQL statement references an undefined global variable or parameter. Check the global variable or parameter name and ensure it is defined.
-690The SQL statement references an undefined package or plan. Check the package or plan name and ensure it is defined.
-691The SQL statement references an undefined materialized query table. Check the materialized query table name and ensure it is defined.
-692The SQL statement references an undefined schema. Check the schema name and ensure it is defined.
-693The SQL statement references an undefined collection. Check the collection name and ensure it is defined.
-694The SQL statement references an undefined view. Check the view name and ensure it is defined.
-695The SQL statement references an undefined table or view constraint. Check the constraint name and ensure it is defined.
-696The SQL statement references an undefined unique or primary key constraint. Check the constraint name and ensure it is defined.
-697The SQL statement references an undefined foreign key constraint. Check the constraint name and ensure it is defined.
-747The SQL statement failed due to an internal error. Review the error message for more details.
-803The INSERT or UPDATE statement violates a unique constraint. Check the values being inserted or updated to avoid duplicate or conflicting values.
-804The SQL statement failed because a duplicate key was found. Verify the key values and ensure they are unique.
-805The SQL statement failed because a table or view could not be found. Check the table or view name and ensure it exists.
-811The SQL statement failed because a result set contains more than one row. Modify the statement or adjust the result processing logic accordingly.
-818The SQL statement failed because a timestamp conflict occurred during a concurrent transaction. Retry the operation after resolving the conflict.
-902The connection to the database failed due to an error. Check the connection parameters and ensure they are correct.
-904The SQL statement failed because the specified object does not exist. Verify the object name and ensure it exists.
-911The current transaction was rolled back due to a deadlock or timeout. Retry the operation or modify the transaction isolation settings.
-913The current transaction was rolled back due to a deadlock. Retry the operation or modify the transaction isolation settings.
-922The 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.
-924The 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.
-927The 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.
-955The SQL statement failed due to a resource limit violation. Review the error message for more details and adjust the resource limits accordingly.
-964The SQL statement failed due to a lock timeout. Retry the operation after a brief period or adjust the lock timeout settings.
-970The SQL statement failed due to a deadlock. Retry the operation after resolving the deadlock or modify the transaction isolation settings.
-998The SQL statement failed due to an internal error. Review the error message for more details.
Explanation
-2310The SQL statement references a table that has been renamed or dropped. Verify the table name and ensure it is correct.
-3508The SQL statement failed due to an internal error in the relational database system. Review the error message for more details.
-7008The SQL statement failed because the requested resource is temporarily unavailable. Retry the operation after a brief period.
-10330The SQL statement failed due to a timeout while waiting for a resource. Retry the operation after a brief period or adjust the timeout settings.
-30090The SQL statement failed due to a communication error. Check the network connection and ensure it is stable.
+98The SQL statement executed successfully with warnings. Review the warning messages for more information.
+100The SQL statement executed successfully.
+222The SQL statement executed successfully and a row was inserted into the table.
+223The SQL statement executed successfully and a row was updated in the table.
+231The SQL statement executed successfully and a row was deleted from the table.
+304The SQL statement executed successfully, but no rows were affected or retrieved.
+354The SQL statement executed successfully, and a temporary table was created.
+562The SQL statement executed successfully, and a trigger was successfully invoked.
+802The SQL statement executed successfully, and a cursor was closed.

Related Posts

  • Best Programming Languages for Mobile Apps – Explained!

  • List of the 120+ Most Popular Programming Certifications – Explained!

  • List of Kotlin Exceptions – Explained!

  • List of 100+ Rust Error Messages – Explained!

  • List of Ruby Error Codes & Messages – Explained!

  • List of 42 PHP Errors – Explained!