00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __AW_ORA__
00022 #define __AW_ORA__
00023
00024 #include "awdb.h"
00025
00026 #include "monitor.h"
00027
00028 #include "wire.h"
00029
00030 #include "regexmatch.h"
00031
00032 #include <oratypes.h>
00033
00034 #include <ocidfn.h>
00035 #include <ociapr.h>
00036
00037
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #define MAX_ITEM_BUFFER_SIZE 33
00056 #define MAX_SELECT_LIST_SIZE 12
00057 #define MAX_SQL_IDENTIFIER 31
00058
00059
00060 #define VARCHAR2_TYPE 1
00061 #define NUMBER_TYPE 2
00062 #define INT_TYPE 3
00063 #define FLOAT_TYPE 4
00064 #define STRING_TYPE 5
00065 #define ROWID_TYPE 11
00066 #define DATE_TYPE 12
00067
00068
00069 #define VAR_NOT_IN_LIST 1007
00070 #ifndef NO_DATA_FOUND
00071 # define NO_DATA_FOUND 1403
00072 #endif
00073 #define NULL_VALUE_RETURNED 1405
00074
00075
00076 #define FT_INSERT 3
00077 #define FT_SELECT 4
00078 #define FT_UPDATE 5
00079 #define FT_DELETE 9
00080
00081 #define FC_OOPEN 14
00082
00083 #define PARSE_NO_DEFER 0
00084 #define PARSE_V7_LNG 2
00085
00086
00087 struct describe
00088 {
00089 sb4 dbsize;
00090 sb2 dbtype;
00091 sb1 buf[MAX_ITEM_BUFFER_SIZE];
00092 sb4 buflen;
00093 sb4 dsize;
00094 sb2 precision;
00095 sb2 scale;
00096 sb2 nullok;
00097 };
00098
00099 struct define
00100 {
00101 ub1 buf[MAX_ITEM_BUFFER_SIZE];
00102 float flt_buf;
00103 sword int_buf;
00104 sb2 indp;
00105 ub2 col_retlen, col_retcode;
00106 };
00107
00108
00109
00110
00114 typedef struct {
00115
00116 byte_t
00117 *user,
00118 *passwd,
00119 *db;
00120
00121 } aw_ora_cinfo_t ;
00122
00126 typedef struct {
00127
00128
00129 Lda_Def
00130 lda;
00131 ub4
00132 hda[HDA_SIZE/sizeof(ub4)];
00133 Cda_Def
00134 cda;
00135 struct describe
00136 desc[MAX_SELECT_LIST_SIZE];
00137 struct define
00138 def[MAX_SELECT_LIST_SIZE];
00139
00140 } aw_ora_conn_t;
00141
00145 typedef struct {
00146
00147 int32_t
00148 prev_connected,
00149 connected;
00150
00151 u_int32_t
00152 connection_attempts;
00153
00154 aw_ora_conn_t
00155 *conn;
00156
00157
00158
00159 u_int32_t
00160 *match_markers;
00161
00162 } aw_ora_state_t ;
00163
00167 byte_t *aw_ora_error(Lda_Def *lda, Cda_Def *cursor, text *msg, sword msgsize);
00168
00172 void aw_ora_init(void);
00173
00177 int32_t aw_ora_initialized(void);
00178
00186 void aw_ora_disconnect(aw_ora_cinfo_t *cinfo, aw_ora_state_t *state, aw_logger_t *logger, int32_t close);
00187
00194 void aw_ora_disconnect_all(aw_ora_cinfo_t *cinfo, aw_ora_state_t *state, aw_logger_t *logger);
00195
00202 void aw_ora_connect(aw_ora_cinfo_t *cinfo, aw_ora_state_t *state, aw_logger_t *logger);
00203
00207 sword aw_ora_describe_define(Lda_Def *lda, Cda_Def *cda, struct describe *desc, struct define *def);
00208
00209 #endif
00210