blob: 5f49c94719a7cccf5a36f1588740b4db2981ede5 [file] [log] [blame]
Tang Cheng37650ea2014-10-20 16:14:41 +08001/*
2 * $Header: oraca.h 24-apr-2003.12:50:59 mkandarp Exp $ oraca.h
3 */
4
5/* Copyright (c) 1985, 2003, Oracle Corporation. All rights reserved. */
6
7/*
8NAME
9 ORACA : Oracle Communications Area.
10FUNCTION
11 Contains no code. Provides supplementary communications to/from
12 Oracle (in addition to standard SQLCA).
13NOTES
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 oracchf : Check cursor cache consistency flag. If set AND oradbgf
23 is set, then directs SQLLIB to perform cursor cache
24 consistency checks before every cursor operation
25 (OPEN, FETCH, SELECT, INSERT, etc.).
26 oradbgf : Master DEBUG flag. Used to turn all DEBUG options
27 on or off.
28 orahchf : Check Heap consistency flag. If set AND oradbgf is set,
29 then directs SQLLIB to perform heap consistency checks
30 everytime memory is dynamically allocated/free'd via
31 sqlalc/sqlfre/sqlrlc. MUST BE SET BEFORE 1ST CONNECT
32 and once set cannot be cleared (subsequent requests
33 to change it are ignored).
34 orastxtf: Save SQL stmt text flag. If set, then directs SQLLIB
35 to save the text of the current SQL stmt in orastxt
36 (in VARCHAR format).
37 orastxt : Saved len and text of current SQL stmt (in VARCHAR
38 format).
39 orasfnm : Saved len and text of filename containing current SQL
40 stmt (in VARCHAR format).
41 oraslnr : Saved line nr within orasfnm of current SQL stmt.
42
43 Cursor cache statistics. Set after COMMIT or ROLLBACK. Each
44 CONNECT'd DATABASE has its own set of statistics.
45
46 orahoc : Highest Max Open OraCursors requested. Highest value
47 for MAXOPENCURSORS by any CONNECT to this DATABASE.
48 oramoc : Max Open OraCursors required. Specifies the max nr
49 of OraCursors required to run this pgm. Can be higher
50 than orahoc if working set (MAXOPENCURSORS) was set
51 too low, thus forcing the PCC to expand the cache.
52 oracoc : Current nr of OraCursors used.
53 oranor : Nr of OraCursor cache reassignments. Can show the
54 degree of "thrashing" in the cache. Optimally, this
55 nr should be kept as low as possible (time vs space
56 optimization).
57 oranpr : Nr of SQL stmt "parses".
58 oranex : Nr of SQL stmt "executes". Optimally, the relation-
59 ship of oranex to oranpr should be kept as high as
60 possible.
61
62
63 If the symbol ORACA_NONE is defined, then there will be no ORACA
64 *variable*, although there will still be a struct defined. This
65 macro should not normally be defined in application code.
66
67 If the symbol ORACA_INIT is defined, then the ORACA will be
68 statically initialized. Although this is not necessary in order
69 to use the ORACA, it is a good pgming practice not to have
70 unitialized variables. However, some C compilers/OS's don't
71 allow automatic variables to be init'd in this manner. Therefore,
72 if you are INCLUDE'ing the ORACA in a place where it would be
73 an automatic AND your C compiler/OS doesn't allow this style
74 of initialization, then ORACA_INIT should be left undefined --
75 all others can define ORACA_INIT if they wish.
76
77OWNER
78 Clare
79DATE
80 10/19/85
81MODIFIED
82 apopat 05/08/02 - [2362423] MVS PE to make lines shorter than 79
83 apopat 07/31/99 - [707588] TAB to blanks for OCCS
84 lvbcheng 10/27/98 - change long to int for oraca
85 pccint 10/03/96 - Add IS_OSD for linting
86 jbasu 12/12/94 - Bug 217878: note this is an SOSD file
87 losborne 09/04/92 - Make oraca variable optional
88 Osborne 05/24/90 - Add ORACA_STORAGE_CLASS construct
89 Clare 02/20/86 - PCC [10101l] Feature: Heap consistency check.
90 Clare 03/04/86 - PCC [10101r] Port: ORACA init ifdef.
91 Clare 03/12/86 - PCC [10101ab] Feature: ORACA cuc statistics.
92*/
93/* IS_OSD */
94#ifndef ORACA
95#define ORACA 1
96
97struct oraca
98 {
99 /* text */ char oracaid[8]; /* Reserved */
100 /* ub4 */ int oracabc; /* Reserved */
101
102 /* Flags which are setable by User. */
103
104 /* ub4 */ int oracchf; /* <> 0 if "check cur cache consistncy"*/
105 /* ub4 */ int oradbgf; /* <> 0 if "do DEBUG mode checking" */
106 /* ub4 */ int orahchf; /* <> 0 if "do Heap consistency check" */
107 /* ub4 */ int orastxtf; /* SQL stmt text flag */
108#define ORASTFNON 0 /* = don't save text of SQL stmt */
109#define ORASTFERR 1 /* = only save on SQLERROR */
110#define ORASTFWRN 2 /* = only save on SQLWARNING/SQLERROR */
111#define ORASTFANY 3 /* = always save */
112 struct
113 {
114 /* ub2 */ unsigned short orastxtl;
115 /* text */ char orastxtc[70];
116 } orastxt; /* text of last SQL stmt */
117 struct
118 {
119 /* ub2 */ unsigned short orasfnml;
120 /* text */ char orasfnmc[70];
121 } orasfnm; /* name of file containing SQL stmt */
122 /* ub4 */ int oraslnr; /* line nr-within-file of SQL stmt */
123
124 /* ub4 */ int orahoc; /* highest max open OraCurs requested */
125 /* ub4 */ int oramoc; /* max open OraCursors required */
126 /* ub4 */ int oracoc; /* current OraCursors open */
127 /* ub4 */ int oranor; /* nr of OraCursor re-assignments */
128 /* ub4 */ int oranpr; /* nr of parses */
129 /* ub4 */ int oranex; /* nr of executes */
130 };
131
132#ifndef ORACA_NONE
133
134#ifdef ORACA_STORAGE_CLASS
135ORACA_STORAGE_CLASS struct oraca oraca
136#else
137struct oraca oraca
138#endif
139#ifdef ORACA_INIT
140 =
141 {
142 {'O','R','A','C','A',' ',' ',' '},
143 sizeof(struct oraca),
144 0,0,0,0,
145 {0,{0}},
146 {0,{0}},
147 0,
148 0,0,0,0,0,0
149 }
150#endif
151 ;
152
153#endif
154
155#endif
156/* end oraca.h */