struct sqlca
{
char sqlcaid[8];
long sqlabc;
long sqlcode;
struct
{
unsigned short sqlerrml;
char sqlerrmc[70];
} sqlerrm;
char sqlerrp[8];
long sqlerrd[6];
char sqlwarn[8];
char sqlext[8];
};
The values of the structure are updated by Oracle after every SQL statement. The variable which we will find most useful in the SQLCA structure is sqlca.sqlcode (not the same as the SQLCODE status variable), which holds function return status information. After a function call, if sqlca.sqlcode is:
Other SQLCA variables
A few more structures exist in the SQLCA structure that are of less importance, but may help in debugging:
- sqlca.sqlerrd[2] - indicates the number of rows processed by the most recent SQL statement
- sqlca.sqlwarn - a set of 8 flags numbered 0 to 7, each of which is turned on by setting its value to 'W'
- sqlca.sqlwarn[0] - at least one warning was encountered (not necessarily fatal)
- sqlca.sqlwarn[1] - character data was truncated because the host variable's width was not large enough
- sqlca.sqlwarn[2] - NULL values ignored in a computation such as SUM and AVG
- sqlca.sqlwarn[3] - the number of columns SELECTed does not match the number in the INTO clause
- sqlca.sqlwarn[4] - an unconditional UPDATE or DELETE was performed (i.e., no WHERE clause was used)
- sqlca.sqlwarn[5] - unused
- sqlca.sqlwarn[6] - an implicit ROLLBACK WORK was issued. For example, a deadlock occurred.
- sqlca.sqlwarn[7] - during a SELECT, data has lost its consistency