SQLCODE field
The SQLCODE field is the primary return code of the database server. After every SQL statement, SQLCODE is set to an integer value as the following table shows. When that value is zero, the statement is performed without error. In particular, when a statement is supposed to return data into a host variable, a code of zero means that the data has been returned and can be used. Any nonzero code means the opposite. No useful data was returned to host variables.
Return value | Interpretation |
---|---|
value < 0 | Specifies an error code. |
value = 0 | Indicates success. |
0 < value < 100 | After a DESCRIBE statement, an integer value that represents the type of SQL statement that is described. |
100 | After a successful query that returns no rows, indicates the NOT FOUND condition. NOT FOUND can also occur in an ANSI-compliant database after an INSERT INTO/SELECT, UPDATE, DELETE, or SELECT... INTO TEMP statement fails to access any rows. |