SQLCODE Values

The possible values for SQLCODE are:

Value Meaning
0 The statement ran without error.
1 The statement ran, but a warning was generated. The values of the SQLWARN flags should be checked to determine the type of error.
100 Data matching the query was not found or the end of the results set has been reached. No rows were processed.
< 0 (negative) The statement did not run due to an application, database, system, or network error.

OpenESQL

If you are using OpenESQL, the following error codes are defined for SQLCODE

SQLCODE Message Meaning
0 Mismatch between number of parameter markers and host variables/user sqldas Only used for special Embedded SQL statements, such as CONENCT.
1 NULL value returned but no indicator variable supplied  
-1 Autoconnect failure SQL(INIT) was used, and automatic CONNECT failed. Programs which use SQL(INIT) need to check SQLCODE immediately on startup.
-10000 <The first error message returned by the ODBC call SQLError after the OpenESQL run-time module detected an error>

or

See your ODBC driver documentation, or other ODBC reference documents for details of ODBC error messages. SQLSTATE will contain a unique code for each ODBC error condition.
  Unable to retrieve ODBC error An ODBC error occurred, but no more details are available. This usually indicates a serious run-time condition, such as severe memory shortage.
-19085 Invalid ODBC catalog query This is caused by invalid parameters to a QUERY ODBC statement.
-19101 Statement too long  
-19199 ESQL Keyword(s) detected in PREPARE/EXECUTE IMMEDIATE statement  
-19313 Too few host variables  
-19413 Data overflow occurred during decimal data conversion  
-19501 No cursor declared  
-19514 Cursor is not prepared  
-19701 NULL connection name

or

Connection name not found

These two errors (-19701 and -19702) occur when a program refers to a connection which does not exist. The most likely cause is attempting to execute an Embedded SQL statement before a CONNECT has executed successfully, or after all connections have been disconnected.
-19702 Connection name not found

or

Attempt to close non-existent connection

-19703 Could not make connection.  
-19707 Duplicate connection name.  
-19822 Improperly initialized User SQLDA  
-19957 Statement text not found or empty  
-20000 Unimplemented embedded SQL feature The COBOL compiler may accept some Embedded SQL syntax which is not yet supported by the OpenESQL run-time module. If an attempt is made to execute such a statement, this condition will result.