After each embedded SQL statement is executed, error and status information is returned in the SQL Communications Area (SQLCA).
Oracle, Sybase and Informix all have different versions of the SQLCA. The Oracle, Sybase and Informix SQLCA's all have a SQLCODE, SQLERRML, SQLERRMC and a SQLWARN. The sizes and the positions of these fields can differ between the precompilers.
For details of the layout of the SQLCA data structure, see the topic The SQLCA Data Structure.
The SQLCA contains two variables (SQLCODE and SQLSTATE) plus a number of warning flags which are used to indicate whether an error has occurred in the most recently executed SQL statement.
COBSQL
For COBSQL, SQLSTATE is a separate data item. For the currently supported versions of Oracle and Sybase, the SQLCA should be used in preference to the SQLSTATE variable. The SQLSTATE variable will eventually supersede the SQLCA as the preferred method of passing data between the database and the client application, but this is not yet the case.