DB2 10.5 for Linux, UNIX, and Windows

Oracle-DB2 error mapping (PL/SQL)

PL/SQL error codes and exception names have corresponding DB2® error codes and SQLSTATE values.

These error codes, exception names, and SQLSTATE values are summarized in Table 1.

Table 1. Mapping of PL/SQL error codes and exception names to DB2 data server error codes and SQLSTATE values
plsqlCode plsqlName db2Code db2State
-1 DUP_VAL_ON_INDEX -803 23505
+100 NO_DATA_FOUND +100 02000
-1012 NOT_LOGGED_ON -1024 08003
-1017 LOGIN_DENIED -30082 08001
-1476 ZERO_DIVIDE -801 22012
-1722 INVALID_NUMBER -420 22018
-1001 INVALID_CURSOR -501 24501
-1422 TOO_MANY_ROWS -811 21000
-6502 VALUE_ERROR -433 22001
-6511 CURSOR_ALREADY_OPEN -502 24502
-6532 SUBSCRIPT_OUTSIDE_LIMIT -20439 428H1
-6533 SUBSCRIPT_BEYOND_COUNT -20439 2202E
-6592 CASE_NOT_FOUND -773 20000
-54   -904 57011
-60   -911 40001
-310   -206 42703
-595   -390 42887
-597   -303 42806
-598   -407 23502
-600   -30071 58015
-603   -119 42803
-604   -119 42803
-610   -20500 428HR
-611   -117 42802
-612   -117 42802
-613   -811 21000
-615   -420 22018
-616   -420 22018
-617   -418 42610
-618   -420 22018
-619   -418 42610
-620   -171 42815
-622   -304 22003
-623   -604 42611
-904   -206 42703
-911   -7 42601
-942   -204 42704
-955   -601 42710
-996   -1022 57011
-1119   -292 57047
-1002   +231 02000
-1403   -100 02000
-1430   -612 42711
-1436   -20451 560CO
-1438   -413 22003
-1450   -614 54008
-1578   -1007 58034
-2112   -811 21000
-2261   +605 01550
-2291   -530 23503
-2292   -532 23001
-3113   -30081 08001
-3114   -1024 08003
-3214   -20170 57059
-3297   -20170 57059
-4061   -727 56098
-4063   -727 56098
-4091   -723 09000
-6502   -304 22003
-6508   -440 42884
-6550   -104 42601
-6553   -104 42601
-14028   -538 42830
-19567   -1523 55039
-30006   -904 57011
-30041   -1139 54047