SQLCA Structure For C

Restriction: This topic applies to Windows environments only.

The structure of the SQLCA is defined in the include file SQLCA.H. It must be included in every C program that contains embedded SQL.

#ifndef SQLCODE
struct sqlca
{
  unsigned char  sqlcaid[8];
  long      sqlcabc;
  long      sqlcode;
  short      sqlerrml;
  unsigned char  sqlerrmc[70];
  unsigned char  sqlerrp[8];
  long      sqlerrd[6];
  unsigned char  sqlwarn[11];
  unsigned char  sqlstate[5];
};
#define SQLCODE  sqlca.sqlcode
#define SQLWARN0  sqlca.sqlwarn[0]
#define SQLWARN1  sqlca.sqlwarn[1]
#define SQLWARN2  sqlca.sqlwarn[2]
#define SQLWARN3  sqlca.sqlwarn[3]
#define SQLWARN4  sqlca.sqlwarn[4]
#define SQLWARN5  sqlca.sqlwarn[5]
#define SQLWARN6  sqlca.sqlwarn[6]
#define SQLWARN7  sqlca.sqlwarn[7]
#define SQLWARN8  sqlca.sqlwarn[8]
#define SQLWARN9  sqlca.sqlwarn[9]
#define SQLWARNA  sqlca.sqlwarn[10]
#define SQLSTATE  sqlca.sqlstate
#endif
struct sqlca sqlca;