Below is the list of DB2 SQL Errors codes. Useful as a quick reference for Developers and Testers.
The SQL statement finished successfully.
No rows found to satisfy the SQL statement.
Number of values being inserted does not equal number of columns in the table.
SQL statement is too complex.
Illegal symbol encountered in SQL statement. Usually, this means you have a syntax error somewhere in your SQL statement.
Column function used illegally; all columns not applied to the column function must be in the GROUP BY.
Invalid view UPDATE requested; or an invalid INSERT, UPDATE, or DELETE was requested on a transition table during a triggered action.
A null was returned but no indicator variable is available to assign null to the host variable.
Must open a cursor before attempting to fetch from it or close it.
Bonus: 8 Top Rules on How to Write an Updatable-view, useful to write SQL query quickly.
Cannot open a cursor twice without first closing it.
The table specified by the cursor of the UPDATE or DELETE statement cannot be modified as requested.
Invalid foreign key value supplied for the specified constraint name.
Deletion violates the named referential constraint.
INSERT or UPDATE caused a check constraint violation.
User is attempting to perform an operation for which he or she is not authorized.
Insert violates uniqueness constraint.
Bonus: What is Ambiguous Column in SQL and How to Resolve it, useful solution to fix this error quickly.
The DBRM or package name was not found in the plan.
Must use a cursor when more than one row is returned as the result of an embedded SELECT statement.
Plan/Package vs. load module timestamp mismatch. The DBRM in the executing plan or package was not created from the same precompilation as the load module.
The specified resource is unavailable. Determine why, and retry the request.
The current unit of work has been rolled back.
Unsuccessful execution caused by deadlock or timeout.
The user is not authorized to perform the task