home *** CD-ROM | disk | FTP | other *** search
- /* Copyright (c) 1985,1986 by Oracle Corporation. */
-
- /*
- NAME
- SQLCA : SQL Communications Area.
- FUNCTION
- Contains no code. Oracle fills in the SQLCA with status info
- during the execution of a SQL stmt.
- NOTES
- If the symbol SQLCA_STORAGE_CLASS is defined, then the SQLCA
- will be defined to have this storage class. For example:
-
- #define SQLCA_STORAGE_CLASS extern
-
- will define the SQLCA as an extern.
-
- If the symbol SQLCA_INIT is defined, then the SQLCA will be
- statically initialized. Although this is not necessary in order
- to use the SQLCA, it is a good pgming practice not to have
- unitialized variables. However, some C compilers/OS's don't
- allow automatic variables to be init'd in this manner. Therefore,
- if you are INCLUDE'ing the SQLCA in a place where it would be
- an automatic AND your C compiler/OS doesn't allow this style
- of initialization, then SQLCA_INIT should be left undefined --
- all others can define SQLCA_INIT if they wish.
-
- New rules for defining SQLCA_INIT, SQLCA_STORAGE_CLASS, and DLL in OS/2:
- Users should not define SQLCA_STORAGE_CLASS if defining DLL.
- SQLCA_STORAGE_CLASS is primarily used for single-threaded programs
- and for internal development.
-
- MODIFIED
- Okamura 08/15/89 - OS/2: users must define SQLMT for multi-threaded case
- Okamura 06/23/89 - OS/2: modify for multi-threaded case
- Clare 12/06/84 - Ch SQLCA to not be an extern.
- Clare 10/21/85 - Add initialization.
- Bradbury 01/05/86 - Only initialize when SQLCA_INIT set
- Clare 06/12/86 - Add SQLCA_STORAGE_CLASS option.
- */
-
- #ifndef SQLCA
- #define SQLCA 1
-
- struct sqlca
- {
- /* ub1 */ char sqlcaid[8];
- /* b4 */ long sqlabc;
- /* b4 */ long sqlcode;
- struct
- {
- /* ub2 */ unsigned short sqlerrml;
- /* ub1 */ char sqlerrmc[70];
- } sqlerrm;
- /* ub1 */ char sqlerrp[8];
- /* b4 */ long sqlerrd[6];
- /* ub1 */ char sqlwarn[8];
- /* ub1 */ char sqlext[8];
- };
-
- #ifdef SQLMT
- extern struct sqlca *sqlcamt(); /* For multi-threaded version */
- # define sqlca (*sqlcamt())
- #else /* SQLMT */
-
- #ifdef SQLCA_STORAGE_CLASS
- SQLCA_STORAGE_CLASS struct sqlca sqlca
- # ifdef SQLCA_INIT
- = {
- {'S', 'Q', 'L', 'C', 'A', ' ', ' ', ' '},
- sizeof(struct sqlca),
- 0,
- { 0, {0}},
- {'N', 'O', 'T', ' ', 'S', 'E', 'T', ' '},
- {0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0}
- }
- # endif /* SQLCA_INIT */
- ;
-
- #else /* SQLCA_STORAGE_CLASS */
- struct sqlca sqlca /* For single-threaded version */
-
- # ifdef SQLCA_INIT
- = {
- {'S', 'Q', 'L', 'C', 'A', ' ', ' ', ' '},
- sizeof(struct sqlca),
- 0,
- { 0, {0}},
- {'N', 'O', 'T', ' ', 'S', 'E', 'T', ' '},
- {0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0}
- }
- # endif /* SQLCA_INIT */
- ;
- #endif /* SQLCA_STORAGE_CLASS */
-
- #endif /* SQLMT */
-
- /* end SQLCA */
- #endif /* SQLCA */