Testing the value of
SQLCODE is the most common way of determining the success or failure of an embedded SQL statement.
For details of SQLCODE values, see the topic
For DB2, it is possible to get other positive values. This means that the SQL statement has executed but produced a warning.
For COBSQL, it is possible to get other positive values. This means that the SQL statement has executed but produced a warning.
- For details about the range of positive values that SQLCODE can be set to, consult your Oracle, Sybase or Informix Error Messages
manual. The above SQLCODES are produced by OpenESQL. The values for SQLCODE and the errors reported by Oracle, Sybase and
Informix are all different. Please refer to
Informix Error Messages manuals for more information on the errors returned.
- The value +100 is the ANSI standard for 'data not found'. Oracle can return another value for 'data not found'. To get Oracle
to return the value +100 for 'data not found', either of the Oracle precompiler directives MODE=ANSI or END_OF_FETCH=100 must
be set. This will affect other aspects of the way the Oracle precompiler handles SQL statements. For more details on the Oracle
precompiler MODE or END_OF_FETCH=+100 directives, refer to the
Programmer's Guide to the ORACLE Precompilers.
- Even when SQLCODE contains zero, a warning may have been generated. The values of the sqlwarn flags should be checked to determine
the type of warning. For Oracle, Sybase and Informix, sqlwarn0 will always be set when the database server has sent a warning
back to the application.