SQLSTATE Values (sorted by DB2 Code)

The following table describes the ANSI equivalents to an XDB mode error codes. The ANSI error value is stored in the SQLSTATE element of the SQLCA.

DB2 SQLCODE XDB mode SQLCODE ANSI SQLSTATE
N/A -811 21000
N/A -803 23505
N/A +100 02000
N/A 0 00000
N/A -305 22002
-10 -7 37503
-84 -20 37512
-101 -19 54001
-102 -6 54002
-104 -212 37501
-107 -47 54003
-107 -87 54003
-107 -88 54003
-107 -119 54003
-107 -177 54003
-107 -279 54003
-112 -72 37507
-117 -54 53002
-117 -57 53002
-118 -244 56002
-119 -103 53003
-121 -55 52001
-122 -73 53003
-122 -75 53003
-125 -66 53005
-126 -185 53029
-127 -80 56005
-129 -26 54004
-150 -79 56013
-153 -108 56008
-155 -106 N/A
-156 -138 53009
-159 -28 52004
-160 -140 53013
-161 -141 23501
-181 -247 22007
-198 -2 37517
-199 -291 37501
-204 -280 52004
-206 -9 52003
-302 -23 22001
-305 -188 22002
-401 -11 53018
-401 -12 53018
-402 -43 53019
-404 -59 22001
-405 -4 53020
-407 -86 23502
-408 -58 53021
-412 -71 53023
-414 -127 53024
-415 -83 53025
-421 -82 53026
-501 -16 24501
-501 -215 24501
-502 -214 24502
-510 -231 53028
-512 -288 56023
-513 -287 56024
-514 -125 26501
-530 -229 23503
-531 -227 23504
-532 -228 23504
-534 -246 21502
-551 -91 42501
-551 -277 42501
-553 -278 42503
-601 -48 52010
-601 -56 52010
-601 -118 52010
-601 -174 52010
-601 -281 52010
-602 -46 54008
-603 -51 22515
-604 -179 37511
-607 -104 53032
-607 -124 53032
-614 -50 N/A
-616 -146 23503
-637 -284 37514
-644 -289 37515
-652 -144 23501
-680 -61 54011
-685 -44 58002
-803 -18 23505
-803 -40 23505
-911 -156 40000
-913 -32 40502
-913 -35 40502
-913 -76 40502
-913 -153 40502
-913 -154 40502
-913 -155 40502
-913 -157 40502
-913 -158 40502
-913 -159 40502
-913 -160 40502
-925 -343 56201
-926 -344 40502