Success (0) and warning (+) SQL codes
SQL return codes that are preceded by a plus sign (+) indicate that the SQL statement execution was successful.
Some interfaces that return SQL conditions, such as SPUFI, might return the final SQLCODE condition first, followed by any prior SQLCODE conditions incurred as a SQL statement was executed. If the final SQLCODE is an error, most prior SQLCODE warning conditions can be ignored.
SQLCODE values
The SQLCODE value is set by Db2 after each statement is executed, as shown in the following table.
SQLCODE value | Meaning | SQLCODE descriptions |
---|---|---|
SQLCODE = 0 | Successful execution, if SQLWARN0 is blank. If SQLWARN0 = 'W', successful execution with warning. |
000 |
SQLCODE = 100 | No data was found. For example, a FETCH statement returned no data because the cursor was positioned after the last row of the result table. | +100 |
SQLCODE > 0 and not = 100 | Successful execution with a warning. | +sqlcode-num |
SQLCODE < 0 | Execution was not successful. | -sqlcode-num |
For PDF format descriptions of the SQL codes that Db2 12 might issue, see Codes.
Successful SQL execution codes for Java programs
For information on SQL execution codes in the range +4200 to +4299, and +4450 to +4499, see Error codes issued by the IBM Data Server Driver for JDBC and SQLJ.
List of success and warning SQL codes
The following SQL codes indicate successful execution of the SQL statement or successful execution with a warning.