Tang Cheng | 37650ea | 2014-10-20 16:14:41 +0800 | [diff] [blame^] | 1 | /* |
| 2 | * $Header: sqlca.h 24-apr-2003.12:50:58 mkandarp Exp $ sqlca.h |
| 3 | */ |
| 4 | |
| 5 | /* Copyright (c) 1985, 2003, Oracle Corporation. All rights reserved. */ |
| 6 | |
| 7 | /* |
| 8 | NAME |
| 9 | SQLCA : SQL Communications Area. |
| 10 | FUNCTION |
| 11 | Contains no code. Oracle fills in the SQLCA with status info |
| 12 | during the execution of a SQL stmt. |
| 13 | NOTES |
| 14 | ************************************************************** |
| 15 | *** *** |
| 16 | *** This file is SOSD. Porters must change the data types *** |
| 17 | *** appropriately on their platform. See notes/pcport.doc *** |
| 18 | *** for more information. *** |
| 19 | *** *** |
| 20 | ************************************************************** |
| 21 | |
| 22 | If the symbol SQLCA_STORAGE_CLASS is defined, then the SQLCA |
| 23 | will be defined to have this storage class. For example: |
| 24 | |
| 25 | #define SQLCA_STORAGE_CLASS extern |
| 26 | |
| 27 | will define the SQLCA as an extern. |
| 28 | |
| 29 | If the symbol SQLCA_INIT is defined, then the SQLCA will be |
| 30 | statically initialized. Although this is not necessary in order |
| 31 | to use the SQLCA, it is a good pgming practice not to have |
| 32 | unitialized variables. However, some C compilers/OS's don't |
| 33 | allow automatic variables to be init'd in this manner. Therefore, |
| 34 | if you are INCLUDE'ing the SQLCA in a place where it would be |
| 35 | an automatic AND your C compiler/OS doesn't allow this style |
| 36 | of initialization, then SQLCA_INIT should be left undefined -- |
| 37 | all others can define SQLCA_INIT if they wish. |
| 38 | |
| 39 | If the symbol SQLCA_NONE is defined, then the SQLCA variable will |
| 40 | not be defined at all. The symbol SQLCA_NONE should not be defined |
| 41 | in source modules that have embedded SQL. However, source modules |
| 42 | that have no embedded SQL, but need to manipulate a sqlca struct |
| 43 | passed in as a parameter, can set the SQLCA_NONE symbol to avoid |
| 44 | creation of an extraneous sqlca variable. |
| 45 | |
| 46 | MODIFIED |
| 47 | lvbcheng 07/31/98 - long to int |
| 48 | jbasu 12/12/94 - Bug 217878: note this is an SOSD file |
| 49 | losborne 08/11/92 - No sqlca var if SQLCA_NONE macro set |
| 50 | Clare 12/06/84 - Ch SQLCA to not be an extern. |
| 51 | Clare 10/21/85 - Add initialization. |
| 52 | Bradbury 01/05/86 - Only initialize when SQLCA_INIT set |
| 53 | Clare 06/12/86 - Add SQLCA_STORAGE_CLASS option. |
| 54 | */ |
| 55 | |
| 56 | #ifndef SQLCA |
| 57 | #define SQLCA 1 |
| 58 | |
| 59 | struct sqlca |
| 60 | { |
| 61 | /* ub1 */ char sqlcaid[8]; |
| 62 | /* b4 */ int sqlabc; |
| 63 | /* b4 */ int sqlcode; |
| 64 | struct |
| 65 | { |
| 66 | /* ub2 */ unsigned short sqlerrml; |
| 67 | /* ub1 */ char sqlerrmc[70]; |
| 68 | } sqlerrm; |
| 69 | /* ub1 */ char sqlerrp[8]; |
| 70 | /* b4 */ int sqlerrd[6]; |
| 71 | /* ub1 */ char sqlwarn[8]; |
| 72 | /* ub1 */ char sqlext[8]; |
| 73 | }; |
| 74 | |
| 75 | #ifndef SQLCA_NONE |
| 76 | #ifdef SQLCA_STORAGE_CLASS |
| 77 | SQLCA_STORAGE_CLASS struct sqlca sqlca |
| 78 | #else |
| 79 | struct sqlca sqlca |
| 80 | #endif |
| 81 | |
| 82 | #ifdef SQLCA_INIT |
| 83 | = { |
| 84 | {'S', 'Q', 'L', 'C', 'A', ' ', ' ', ' '}, |
| 85 | sizeof(struct sqlca), |
| 86 | 0, |
| 87 | { 0, {0}}, |
| 88 | {'N', 'O', 'T', ' ', 'S', 'E', 'T', ' '}, |
| 89 | {0, 0, 0, 0, 0, 0}, |
| 90 | {0, 0, 0, 0, 0, 0, 0, 0}, |
| 91 | {0, 0, 0, 0, 0, 0, 0, 0} |
| 92 | } |
| 93 | #endif |
| 94 | ; |
| 95 | #endif |
| 96 | |
| 97 | #endif |
| 98 | |
| 99 | /* end SQLCA */ |