C:/Users/vincent/Data/Perso/dev/ocilib/ocilib/src/ocilib_types.h

00001 /*
00002    +----------------------------------------------------------------------+
00003    |                                                                      |
00004    |                     OCILIB - C Driver for Oracle                     |
00005    |                                                                      |
00006    |                      (C Wrapper for Oracle OCI)                      |
00007    |                                                                      |
00008    +----------------------------------------------------------------------+
00009    |                      Website : http://www.ocilib.net                 |
00010    +----------------------------------------------------------------------+
00011    |               Copyright (c) 2007-2009 Vincent ROGIER                 |
00012    +----------------------------------------------------------------------+
00013    | This library is free software; you can redistribute it and/or        |
00014    | modify it under the terms of the GNU Lesser General Public           |
00015    | License as published by the Free Software Foundation; either         |
00016    | version 2 of the License, or (at your option) any later version.     |
00017    |                                                                      |
00018    | This library is distributed in the hope that it will be useful,      |
00019    | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
00020    | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU    |
00021    | Lesser General Public License for more details.                      |
00022    |                                                                      |
00023    | You should have received a copy of the GNU Lesser General Public     |
00024    | License along with this library; if not, write to the Free           |
00025    | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.   |
00026    +----------------------------------------------------------------------+
00027    |          Author: Vincent ROGIER <vince.rogier@gmail.com>             |
00028    +----------------------------------------------------------------------+
00029 */
00030 
00031 /* ------------------------------------------------------------------------ *
00032  * $Id: ocilib_types.h, v 3.4.0 2009-07-30 17:40 Vince $
00033  * ------------------------------------------------------------------------ */
00034 
00035 
00036 #ifndef OCILIB_OCILIB_TYPES_H_INCLUDED
00037 #define OCILIB_OCILIB_TYPES_H_INCLUDED
00038 
00039 #include "ocilib_defs.h"
00040 
00041 /* ************************************************************************ *
00042  *                             PRIVATE TYPES
00043  * ************************************************************************ */
00044 
00045 /*
00046  * OCI_Item : Internal list entry.
00047  *
00048  * The library needs to manage internal list of objects in order to be able to
00049  * free them if the application doest not.
00050  *
00051  * @note
00052  * Internal lists are using mutexes for resource locking in multithreaded
00053  * environments
00054  *
00055  */
00056 
00057 struct OCI_Item
00058 {
00059    void             *data; /* pointer to external data */
00060    struct OCI_Item  *next; /* next element in list */
00061 };
00062 
00063 typedef struct OCI_Item OCI_Item;
00064 
00065 /*
00066  * OCI_List : Internal list object.
00067  *
00068  * The OCI_List object is used to maintain a collection of handles allocated
00069  * by user programs.
00070  *
00071  * Those handles are freed when the collection owner is destroyed.
00072  * So, we make sure that if OCI_Cleanup() is called, all allocated handles will
00073  * be destroyed even if the program does not free them.
00074  *
00075  */
00076 
00077 struct OCI_List
00078 {
00079     OCI_Item    *head;   /* pointer to first item */
00080     OCI_Mutex   *mutex;  /* mutex handle */
00081     ub4          count;  /* number of elements in list */
00082     int          type;   /* type of list item */
00083 };
00084 
00085 typedef struct OCI_List OCI_List;
00086 
00087 /*
00088  * Server output object used to retrieve server dbms.output buffers
00089  *
00090  */
00091 
00092 struct OCI_ServerOutput
00093 {
00094     ub1                *arrbuf;    /* array buffer */
00095     unsigned int        arrsize;   /* array size */
00096     unsigned int        cursize;   /* number of filled items in the array */
00097     unsigned int        curpos;    /* current position in the array */
00098     unsigned int        lnsize;    /* line size */
00099     OCI_Statement      *stmt;      /* pointer to statement object (dbms_output calls) */
00100 };
00101 
00102 typedef struct OCI_ServerOutput OCI_ServerOutput;
00103 
00104 /*
00105  * Connection trace information
00106  *
00107  */
00108 
00109 struct OCI_TraceInfo
00110 {
00111     mtext identifier[OCI_SIZE_TRACE_ID+1];
00112     mtext module[OCI_SIZE_TRACE_MODULE+1];
00113     mtext action[OCI_SIZE_TRACE_ACTION+1];
00114     mtext info[OCI_SIZE_TRACE_INF0+1];
00115 };
00116 
00117 typedef struct OCI_TraceInfo OCI_TraceInfo;
00118 
00119 /* ************************************************************************ *
00120  *                             PUBLIC TYPES
00121  * ************************************************************************ */
00122 
00123 /*
00124  * Error object
00125  *
00126  */
00127 
00128 struct OCI_Error
00129 {
00130     boolean          raise;                   /* Error flag */
00131     boolean          active;                  /* to avoid recursive exceptions */
00132     OCI_Connection  *con;                     /* pointer to connection object */
00133     OCI_Statement   *stmt;                    /* pointer to statement object */
00134     sb4              ocode;                   /* Oracle OCI error code */
00135     int              icode;                   /* OCILIB internal error code */
00136     mtext            str[OCI_ERR_MSG_SIZE+1]; /* error message */
00137     unsigned int     type;                    /* OCILIB error type */
00138     ub4              row;                     /* Error row offset (array DML) */
00139 };
00140 
00141 /*
00142  * Mutex object
00143  *
00144  * Mutexes have their own error handle to avoid conflict using OCIErrorGet()
00145  * from different threads
00146  *
00147  */
00148 
00149 struct OCI_Mutex
00150 {
00151     OCIThreadMutex  *handle;  /* OCI Mutex handle */
00152     OCIError        *err;     /* OCI Error handle */
00153 };
00154 
00155 /*
00156  * Thread object
00157  *
00158  * Threads have their own error handle to avoid conflict using OCIErrorGet()
00159  *
00160  */
00161 
00162 struct OCI_Thread
00163 {
00164     OCIThreadHandle *handle;    /* OCI Thread handle */
00165     OCIThreadId     *id;        /* OCI Thread ID */
00166     OCIError        *err;       /* OCI Error handle */
00167     void            *arg;       /* thread routine argument */
00168     POCI_THREAD      proc;      /* thread routine */
00169 };
00170 
00171 /*
00172  * Thread key object
00173  *
00174  * Thread keys have their own error handle to avoid conflict using OCIErrorGet()
00175  * from differents threads
00176  *
00177  */
00178 
00179 struct OCI_ThreadKey
00180 {
00181     OCIThreadKey    *handle;  /* OCI Thread key handle */
00182     OCIError        *err;     /* OCI Error handle */
00183 };
00184 
00185 typedef struct OCI_ThreadKey OCI_ThreadKey;
00186 
00187 /*
00188  * OCI_Library : Internal OCILIB library encapsulation.
00189  *
00190  * It's a static, local and unique object that collects all the global variables
00191  * needed by the library
00192  *
00193  */
00194 
00195 struct OCI_Library
00196 {
00197     OCI_List       *cons;                   /* list of connection objects */
00198     OCI_List       *pools;                  /* list of pools objects */
00199     OCIEnv         *env;                    /* OCI environment handle */
00200     OCIError       *err;                    /* OCI error handle */
00201     POCI_ERROR      error_handler;          /* user defined error handler */
00202     unsigned int    version_compile;        /* OCI version used at compile time */
00203     unsigned int    version_runtime;        /* OCI version used at runtime */
00204     ub1             use_lob_ub8;            /* use 64 bits integers for lobs ? */
00205     ub1             use_scrollable_cursors; /* use Oracle 9i fetch API */
00206     ub4             env_mode;               /* default environment mode */
00207     boolean         loaded;                 /* OCILIB correctly loaded ? */
00208     OCI_Error       lib_err;                /* Error used when OCILIB is not loaded */
00209     OCI_HashTable  *key_map;                /* hash table for mapping name/key */
00210     OCI_ThreadKey  *key_errs;               /* Thread key to store thread errors */
00211     unsigned int    nb_hndlp;               /* number of OCI handles allocated */
00212     unsigned int    nb_descp;               /* number of OCI descriptors allocated */
00213     unsigned int    nb_objinst;             /* number of OCI objects allocated */
00214     OCI_HashTable  *sql_funcs;              /* hash table handle for sql function names */
00215 #ifdef OCI_IMPORT_RUNTIME
00216     LIB_HANDLE      lib_handle;             /* handle of runtime shared library */
00217 #endif
00218 };
00219 
00220 typedef struct OCI_Library OCI_Library;
00221 
00222 /*
00223  * Connection Pool object
00224  *
00225  */
00226 
00227 struct OCI_ConnPool
00228 {
00229     OCI_List        *cons;      /* list of connection objects */
00230 #if OCI_VERSION_COMPILE >= OCI_9_0
00231     OCICPool        *handle;    /* OCI pool handle */
00232 #else
00233     void            *handle;    /* fake handle for alignment */
00234 #endif
00235     OCIError        *err;       /* OCI context handle */
00236     mtext           *name;      /* pool name */
00237     mtext           *db;        /* database */
00238     mtext           *user;      /* user */
00239     mtext           *pwd;       /* password */
00240     OCI_Mutex       *mutex;     /* mutex handle */
00241     ub4              mode;      /* session mode */
00242     ub4              min;       /* minimum of connections */
00243     ub4              max;       /* maximum of connections */
00244     ub4              incr;      /* increment step of connections */
00245     unsigned int     nb_busy;   /* number of busy connections */
00246     unsigned int     nb_opened; /* number of opened connections */
00247     unsigned int     timeout;   /* connection idle timeout */
00248     boolean          nowait;    /* wait for new connection */
00249 };
00250 
00251 /*
00252  * Connection object
00253  *
00254  */
00255 
00256 struct OCI_Connection
00257 {
00258     mtext              *db;        /* database */
00259     mtext              *user;      /* user */
00260     mtext              *pwd;       /* password */
00261     OCI_List           *stmts;     /* list of statements */
00262     OCI_List           *trsns;     /* list of transactions */
00263     OCI_List           *tinfs;     /* list of type info objects */
00264     OCI_Transaction    *trs;       /* pointer to current transaction object */
00265     OCI_ConnPool       *pool;      /* pointer to connection pool parent */
00266     OCI_ServerOutput   *svopt;     /* Pointer to server output object */
00267     OCIServer          *svr;       /* OCI server handle */
00268     OCIError           *err;       /* OCI context handle */
00269     OCISession         *ses;       /* OCI session handle */
00270     OCISvcCtx          *cxt;       /* OCI context handle */
00271     boolean             autocom;   /* auto commit mode */
00272     unsigned int        nb_files;  /* number of OCI_File opened by the connection */
00273     unsigned int        mode;      /* session mode */
00274     int                 cstate;    /* connection state */
00275     void               *usrdata;   /* user data */
00276     mtext              *fmt_date;  /* date string format for conversion */
00277     mtext              *fmt_num;   /* numeric string format for conversion */
00278     mtext              *ver_str;   /* string  server version*/
00279     unsigned int        ver_num;   /* numeric server version */
00280     OCI_TraceInfo      *trace;     /* trace information */
00281 };
00282 
00283 /*
00284  * Transaction object
00285  *
00286  */
00287 
00288 struct OCI_Transaction
00289 {
00290     OCI_Connection  *con;       /* pointer to connection object */
00291     OCITrans        *htr;       /* OCI transaction handle */
00292     unsigned int     timeout;   /* timeout */
00293     unsigned int     mode;      /* transaction mode */
00294     boolean          local;     /* is local transaction ? */
00295     OCI_XID          xid;       /* global transaction identifier */
00296 };
00297 
00298 /*
00299  * Column object
00300  *
00301  */
00302 
00303 struct OCI_Column
00304 {
00305     /* 0racle infos */
00306     ub2              ocode;     /* Oracle SQL code */
00307     ub2              tcode;     /* Oracle type code */
00308     ub2              icode;     /* Internal translated Oracle SQL code */
00309     ub2              size;      /* SQL Size */
00310     sb2              prec;      /* SQL precision 1 (number prec, leading prec) */
00311     sb2              prec2;     /* SQL precision 2 (fractional prec) */
00312     sb1              scale;     /* SQL scale */
00313     ub1              type;      /* internal datatype */
00314     ub1              null;      /* is nullable */
00315     ub1              charused;  /* is column size expressed in characters */
00316     mtext           *name;      /* column name */
00317     ub2              charsize;  /* SQL Size in character */
00318     ub1              csfrm;     /* charset form */
00319     ub1              dtype;     /* oracle handle type */
00320 
00321     /* OCILIB infos */
00322     ub4              bufsize;   /* element size */
00323     OCI_TypeInfo    *typinf;    /* user type descriptor */
00324     ub4              subtype;   /* object type */
00325 };
00326 
00327 /*
00328  * OCI_Buffer : Internal input/output buffer
00329  *
00330  */
00331 
00332 struct OCI_Buffer
00333 {
00334     void            *handle;   /* OCI handle (bind or define) */
00335     void           **data;     /* data / array of data */
00336     void            *inds;     /* array of indicators */
00337     void            *lens;     /* array of lengths */
00338     dtext           *temp;     /* temporary buffer for string conversion */
00339     ub4              count;    /* number of elements in the buffer */
00340     int              sizelen;  /* size of an element in the lens array */
00341 };
00342 
00343 typedef struct OCI_Buffer OCI_Buffer;
00344 
00345 /*
00346  * OCI_Bind object
00347  *
00348  */
00349 
00350 struct OCI_Bind
00351 {
00352     OCI_Statement   *stmt;      /* pointer to statement object */
00353     void           **input;     /* input values */
00354     mtext           *name;      /* name of the bind */
00355     sb4              size;      /* data size */
00356     OCI_Buffer       buf;       /* place holder */
00357     ub2              dynpos;    /* index of the bind for dynamic binds */
00358     ub2             *plrcds;    /* PL/SQL tables return codes */
00359     ub4              nbelem;    /* PL/SQL tables number of elements */
00360     OCI_TypeInfo    *typinf;    /* for object, collection and ref */
00361     ub1              type;      /* internal datatype */
00362     ub1              subtype;   /* internal subtype */
00363     ub2              code;      /* SQL datatype code */
00364     ub1              alloc;     /* is buffer allocated or mapped to input */
00365 };
00366 
00367 /*
00368  * OCI_Define : Internal Resultset column data implementation
00369  *
00370  */
00371 
00372 struct OCI_Define
00373 {
00374     OCI_Resultset   *rs;           /* pointer to resultset object */
00375     void            *obj;          /* current OCILIB object instance */
00376     OCI_Column       col;          /* column object */
00377     OCI_Buffer       buf;          /* placeholder */
00378 };
00379 
00380 typedef struct OCI_Define OCI_Define;
00381 
00382 /*
00383  * Resultset object
00384  *
00385  */
00386 
00387 struct OCI_Resultset
00388 {
00389     OCI_Statement   *stmt;          /* pointer to statement object */
00390     OCI_HashTable   *map;           /* hash table handle for mapping name/index */
00391     OCI_Define      *defs;          /* array of define objects */
00392     ub4              nb_defs;       /* number of elements */
00393     ub4              row_cur;       /* actual position in the array of rows */
00394     ub4              row_abs;       /* absolute position in the resultset */
00395     ub4              row_count;     /* number of rows fetched so far */
00396     ub4              row_fetched;   /* rows fetched by last call (scrollable) */
00397     boolean          eof;           /* end of resultset reached ?  */
00398     boolean          bof;           /* beginning of resultset reached ?  */
00399     ub4              fetch_size;    /* internal array size */
00400     sword            fetch_status;  /* internal fetch status */
00401 
00402 };
00403 
00404 /*
00405  * OCI_Define : Internal Resultset column data implementation
00406  *
00407  */
00408 
00409 struct OCI_BatchErrors
00410 {
00411     OCI_Error       *errs;         /* sub array of OCILIB errors(array DML) */
00412     ub4              cur;          /* current sub error index (array DML) */
00413     ub4              count;        /* number of errors (array DML) */
00414 };
00415 
00416 typedef struct OCI_BatchErrors OCI_BatchErrors;
00417 
00418 /*
00419  * Statement object
00420  *
00421  */
00422 
00423 struct OCI_Statement
00424 {
00425     OCIStmt         *stmt;          /* OCI statement handle */
00426     ub4              hstate;        /* object variable state */
00427     OCI_Resultset  **rsts;          /* pointer to resultset list */
00428     OCI_Connection  *con;           /* pointer to connection object */
00429     mtext           *sql;           /* SQL statement */
00430     OCI_Bind       **ubinds;        /* array of user bind objects */
00431     OCI_Bind       **rbinds;        /* array of register bind objects */
00432     OCI_HashTable   *map;           /* hash table handle for mapping bind name/index */
00433     ub2              nb_ubinds;     /* number of elements in the bind array */
00434     ub2              nb_rbinds;     /* number of output binds */
00435     boolean          bind_reuse;    /* rebind data allowed ? */
00436     unsigned int     bind_mode;     /* type of binding */
00437     ub4              exec_mode;     /* type of execution */
00438     ub4              fetch_size;    /* fetch array size */
00439     ub4              prefetch_size; /* pre-fetch size */
00440     ub4              prefetch_mem;  /* pre-fetch memory */
00441     ub4              long_size;     /* default size for LONG columns */
00442     ub1              long_mode;     /* LONG datatype handling mode */
00443     ub1              status;        /* statement status */
00444     ub2              type;          /* type of SQL statement */
00445     ub4              nb_iters;      /* number of iterations for execution */
00446     ub4              nb_rs;         /* number of resultsets */
00447     ub2              cur_rs;        /* index of the current resultset */
00448     ub2              dynidx;        /* bind index counter for dynamic exec */
00449     ub2              err_pos;       /* error position in sql statement */
00450     ub2              bind_array;    /* has array binds ? */
00451     OCI_BatchErrors *batch;         /* error handling for array DML */
00452 };
00453 
00454 /*
00455  * Internal Large object
00456  *
00457  */
00458 
00459 struct OCI_Lob
00460 {
00461     OCILobLocator   *handle;    /* OCI handle */
00462     ub4              hstate;    /* object variable state */
00463     OCI_Connection  *con;       /* pointer to connection object */
00464     ub4              type;      /* type of lob */
00465     big_uint         offset;    /* current offset for R/W */
00466 };
00467 
00468 /*
00469  * External Large object
00470  *
00471  */
00472 
00473 struct OCI_File
00474 {
00475     OCILobLocator   *handle;    /* OCI handle */
00476     ub4              hstate;    /* object variable state */
00477     OCI_Connection  *con;       /* pointer to connection object */
00478     mtext           *dir;       /* directory name */
00479     mtext           *name;      /* file name */
00480     ub4              type;      /* type of file */
00481     big_uint         offset;    /* current offset for read */
00482 };
00483 
00484 /*
00485  * Long object
00486  *
00487  */
00488 
00489 struct OCI_Long
00490 {
00491     OCI_Statement   *stmt;      /* pointer to statement object */
00492     ub4              hstate;    /* object variable state */
00493     OCI_Define      *def;       /* pointer to resultset define object */
00494     ub4              size;      /* size of the buffer read / written */
00495     unsigned int     type;      /* type of long */
00496     ub4              offset;    /* current offset for R/W */
00497     ub4              piecesize; /* size of current fetched piece */
00498     ub4              maxsize;   /* current offset for R/W */
00499     ub1             *buffer;    /* fetched buffer */
00500 };
00501 
00502 /*
00503  * Date object
00504  *
00505  */
00506 
00507 struct OCI_Date
00508 {
00509     OCIDate         *handle;    /* OCI handle */
00510     ub4              hstate;    /* object variable state */
00511     OCI_Connection  *con;       /* pointer to connection object */
00512     OCIError        *err;       /* OCI context handle */
00513     ub4              allocated; /* is handle allocated ? */
00514 };
00515 
00516 /*
00517  * Timestamp object
00518  *
00519  */
00520 
00521 struct OCI_Timestamp
00522 {
00523 #if OCI_VERSION_COMPILE >= OCI_9_0
00524     OCIDateTime     *handle;    /* OCI handle */
00525 #else
00526     void            *handle;    /* fake handle for alignment */
00527 #endif
00528     ub4              hstate;    /* object variable state */
00529     OCI_Connection  *con;       /* pointer to connection object */
00530     OCIError        *err;       /* OCI context handle */
00531     ub4              type;      /* sub type */
00532 };
00533 
00534 /*
00535  * Interval object
00536  *
00537  */
00538 
00539 struct OCI_Interval
00540 {
00541 #if OCI_VERSION_COMPILE >= OCI_9_0
00542     OCIInterval     *handle;    /* OCI handle */
00543 #else
00544     void            *handle;    /* fake handle for alignment */
00545 #endif
00546     ub4              hstate;    /* object variable state */
00547     OCI_Connection  *con;       /* pointer to connection object */
00548     OCIError        *err;       /* OCI context handle */
00549     ub4              type;      /* sub type */
00550 };
00551 
00552 /*
00553  * Oracle Named type object
00554  *
00555  */
00556 
00557 struct OCI_Object
00558 {
00559     void             *handle;   /* OCI handle */
00560     ub4               hstate;   /* object variable state */
00561     OCI_Connection   *con;      /* pointer to connection object */
00562     OCI_TypeInfo     *typinf;   /* pointer to type info object */
00563     void            **objs;     /* array of OCILIB sub objects */
00564     void             *buf;      /* buffer to store converted out string attribute */
00565     int               buflen;   /* buffer length */
00566     sb2              *tab_ind;  /* indicators for root instance */
00567     ub2               idx_ind;  /* instance indicator offset / indicator table */
00568     OCIObjectLifetime type;     /* object type */
00569 };
00570 
00571 /*
00572  * Oracle Collection Item object
00573  *
00574  */
00575 
00576 struct OCI_Elem
00577 {
00578     void            *handle;   /* OCI handle */
00579     ub4              hstate;   /* object variable state */
00580     OCI_Connection  *con;      /* pointer to connection object */
00581     void            *obj;      /* OCILIB sub object */
00582     void            *buf;      /* buffer to store converted out string attribute */
00583     int              buflen;   /* buffer length */
00584     boolean          init;     /* underlying object has been initialized ? */
00585     OCI_TypeInfo    *typinf;   /* object type information */
00586     OCIInd          *pind;     /* indicator  pointer */
00587     OCIInd           ind;      /* internal temporary data state indicator */
00588 };
00589 
00590 /*
00591  * Oracle Collection object
00592  *
00593  */
00594 
00595 struct OCI_Coll
00596 {
00597     OCIColl           *handle;   /* OCI handle */
00598     ub4                hstate;   /* object variable state */
00599     OCI_Connection    *con;      /* pointer to connection object */
00600     OCI_TypeInfo      *typinf;   /* pointer to type info object */
00601     OCI_Elem          *elem;     /* item object */
00602 };
00603 
00604 /*
00605  * Oracle Iterator object
00606  *
00607  */
00608 
00609 struct OCI_Iter
00610 {
00611     OCIIter           *handle;   /* OCI handle */
00612     OCI_Coll          *coll;     /* pointer to connection object */
00613     OCI_Elem          *elem;     /* item object */
00614     boolean            eoc;      /* end of collection */
00615     boolean            boc;      /* beginning of collection */
00616 };
00617 
00618 /*
00619  * Oracle REF object
00620  *
00621  */
00622 
00623 struct OCI_Ref
00624 {
00625     OCIRef            *handle;   /* OCI handle */
00626     ub4                hstate;   /* object variable state */
00627     OCI_Connection    *con;      /* pointer to connection object */
00628     OCI_TypeInfo      *typinf;   /* pointer to type info object */
00629     OCI_Object        *obj;      /* Pinned object */
00630     boolean            pinned;   /* is the reference pinned */
00631 };
00632 
00633 /*
00634  * Type info object
00635  *
00636  */
00637 
00638 struct OCI_TypeInfo
00639 {
00640     OCI_Connection  *con;        /* pointer to connection object */
00641     mtext           *name;       /* name of the type info object */
00642     mtext           *schema;     /* owner of the type info object */
00643     unsigned int     type;       /* type of type info handle */
00644     OCIType         *tdo;        /* datatype object type */
00645     ub2              tcode;      /* Oracle type code */
00646     ub2              ccode;      /* Oracle collection code */
00647     OCI_Column      *cols;       /* array of column datatype info */
00648     ub2              nb_cols;    /* number of columns */
00649     ub2              refcount;   /* reference counter */
00650 };
00651 
00652 /*
00653  * OCI_DirPathColumn : Internal Direct Path column object
00654  *
00655  */
00656 
00657 struct OCI_DirPathColumn
00658 {
00659     ub4              format_size; /* size of the column format */
00660     mtext           *format;      /* date or numeric format */
00661     ub2              maxsize;     /* input max size */
00662     ub2              type;        /* column type */
00663     ub2              sqlcode;     /* sql type */
00664     ub1             *data;        /* array of data */
00665     ub1             *flags;       /* array of row flags */
00666     ub4             *lens;        /* array of lengths */
00667     ub2              bufsize;     /* buffer size */
00668     ub2              index;       /* ref index in the type info columns list */
00669 };
00670 
00671 typedef struct OCI_DirPathColumn OCI_DirPathColumn;
00672 
00673 /*
00674  * Oracle Direct Path column object
00675  *
00676  */
00677 
00678 struct OCI_DirPath
00679 {
00680     OCI_Connection      *con;       /* pointer to connection object */
00681     OCI_TypeInfo        *typinf;    /* type info about table to load */
00682     OCIDirPathCtx       *ctx;       /* OCI DP context handle */
00683     OCIDirPathColArray  *arr;       /* OCI DP column array handle */
00684     OCIDirPathStream    *strm;      /* OCI DP stream handle */
00685     OCI_DirPathColumn   *cols;      /* array of column info */
00686     ub4                  nb_cols;   /* number of columns to load */
00687     ub4                  nb_rows;   /* maximum number of row to load per stream */
00688     ub4                  nb_cur;    /* current number of row to load per stream */
00689     ub4                  nb_loaded; /* number of row loaded so far */
00690     ub4                  nb_prcsd;  /* number of row processed at last call */
00691     sb2                  err_col;   /* index of the column not processed at last call */
00692     sb2                  err_row;   /* index of the row not processed at last call */
00693     ub4                  status;    /* internal status */
00694 };
00695 
00696 /*
00697  * Hash table object
00698  *
00699  */
00700 
00701 struct OCI_HashTable
00702 {
00703     OCI_HashEntry    **items;     /* array of slots */
00704     unsigned int       size;      /* size of the slots array */
00705     unsigned int       count;     /* number of used slots */
00706     unsigned int       type;      /* type of data */
00707 };
00708 
00709 /*
00710  * OCI_Datatype : fake dummy structure for casting object with
00711  * handles for more compact code
00712  *
00713  */
00714 
00715  struct OCI_Datatype
00716 {
00717     void *handle;   /* OCI handle */
00718     ub4   hstate;   /* object variable state */
00719 };
00720 
00721 typedef struct OCI_Datatype OCI_Datatype;
00722 
00723 
00724 /*
00725  * OCI_SQLCmdInfo : Oracle SQL commands code and verbs
00726  *
00727  */
00728 
00729  struct OCI_SQLCmdInfo
00730 {
00731     unsigned int code; /* SQL command code */
00732     mtext *verb;       /* SQL command verb */
00733 };
00734 
00735 typedef struct OCI_SQLCmdInfo OCI_SQLCmdInfo;
00736 
00737 /* static and unique OCI_Library object */
00738 
00739 extern OCI_Library OCILib;
00740 extern OCI_SQLCmdInfo SQLCmds[];
00741 
00742 #endif /* OCILIB_OCILIB_TYPES_H_INCLUDED */
00743 

Generated on Thu Jul 30 17:41:53 2009 for OCILIB (C Driver for Oracle) by  doxygen 1.5.4