DB2 SQL Error Codes For Job Interviews

Below is the list of DB2 SQL Errors codes. Useful as a quick reference for Developers and Testers.


SQL error codes

+000
00000
The SQL statement finished successfully.

+100
02000
No rows found to satisfy the SQL statement.

+117
01525
Number of values being inserted does not equal number of columns in the table.

-101
54001
SQL statement is too complex.

DB2: SQL Errors For Job Interviews
DB2 SQL Error Codes For Job Interviews

-104
42601
Illegal symbol encountered in SQL statement. Usually, this means you have a syntax error somewhere in your SQL statement.

-122
42803
Column function used illegally; all columns not applied to the column function must be in the GROUP BY.

-150
4
2807
Invalid view UPDATE requested; or an invalid INSERT, UPDATE, or DELETE was requested on a transition table during a triggered action.

-305
22002
A null was returned but no indicator variable is available to assign null to the host variable.

-501
24501
Must open a cursor before attempting to fetch from it or close it.

-502
24502
Cannot open a cursor twice without first closing it.

-510
42828
The table specified by the cursor of the UPDATE or DELETE statement cannot be modified as requested.

-530
23503
Invalid foreign key value supplied for the specified constraint name.

-532
23504
Deletion violates the named referential constraint.

-545
23513
INSERT or UPDATE caused a check constraint violation.

-552
42502
User is attempting to perform an operation for which he or she is not authorized.

-803
23505
Insert violates uniqueness constraint.

Bonus: What is Ambiguous Column in SQL and How to Resolve it, useful solution to fix this error quickly.

-805
51002
The DBRM or package name was not found in the plan.

-811
21000
Must use a cursor when more than one row is returned as the result of an embedded SELECT statement.

-818
51003
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.

-904
57011
The specified resource is unavailable. Determine why, and retry the request.

-911
40001
The current unit of work has been rolled back.

-913
57033
Unsuccessful execution caused by deadlock or timeout.

-922
42505
The user is not authorized to perform the task

Related Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.