📄 ocilib_types.h
字号:
ub4 nbelem; /* PL/SQL tables number of elements */
OCI_TypeInfo *typinf; /* for object, collection and ref */
ub1 type; /* internal datatype */
ub1 subtype; /* internal subtype */
ub2 code; /* SQL datatype code */
ub1 alloc; /* is buffer allocated or mapped to input */
};
/*
* OCI_Define : Internal Resultset column data implementation
*
*/
struct OCI_Define
{
OCI_Resultset *rs; /* pointer to resultset object */
void *obj; /* current OCILIB object instance */
OCI_Column col; /* column object */
OCI_Buffer buf; /* placeholder */
};
typedef struct OCI_Define OCI_Define;
/*
* Resultset object
*
*/
struct OCI_Resultset
{
OCI_Statement *stmt; /* pointer to statement object */
OCI_HashTable *map; /* hash table handle for mapping name/index */
OCI_Define *defs; /* array of define objects */
ub4 nb_defs; /* number of elements */
ub4 row_cur; /* actual position in the array of rows */
ub4 row_abs; /* absolute position in the resultset */
ub4 row_count; /* number of rows fetched so far */
ub4 row_fetched; /* rows fetched by last call (scrollable) */
boolean eof; /* end of resultset reached ? */
boolean bof; /* beginning of resultset reached ? */
ub4 fetch_size; /* internal array size */
sword fetch_status; /* internal fetch status */
};
/*
* Statement object
*
*/
struct OCI_Statement
{
OCIStmt *stmt; /* OCI statement handle */
ub4 hstate; /* object variable state */
OCI_Resultset **rsts; /* pointer to resultset list */
OCI_Connection *con; /* pointer to connection object */
mtext *sql; /* SQL statement */
OCI_Bind **ubinds; /* array of user bind objects */
OCI_Bind **rbinds; /* array of register bind objects */
OCI_HashTable *map; /* hash table handle for mapping bind name/index */
ub2 nb_ubinds; /* number of elements in the bind array */
ub2 nb_rbinds; /* number of output binds */
boolean bind_reuse; /* rebind data allowed ? */
unsigned int bind_mode; /* type of binding */
ub4 exec_mode; /* type of execution */
ub4 fetch_size; /* fetch array size */
ub4 prefetch_size; /* pre-fetch size */
ub4 prefetch_mem; /* pre-fetch memory */
ub4 long_size; /* default size for LONG columns */
ub1 long_mode; /* LONG datatype handling mode */
ub1 status; /* statement status */
ub2 type; /* type of SQL statement */
ub4 nb_iters; /* number of iterations for execution */
ub4 nb_rs; /* number of resultsets */
ub2 cur_rs; /* index of the current resultset */
ub2 dynidx; /* bind index counter for dynamic exec */
ub2 err_pos; /* error position in sql statement */
ub2 bind_array; /* has array binds ? */
};
/*
* Internal Large object
*
*/
struct OCI_Lob
{
OCILobLocator *handle; /* OCI handle */
ub4 hstate; /* object variable state */
OCI_Connection *con; /* pointer to connection object */
ub4 type; /* type of lob */
big_uint offset; /* current offset for R/W */
};
/*
* External Large object
*
*/
struct OCI_File
{
OCILobLocator *handle; /* OCI handle */
ub4 hstate; /* object variable state */
OCI_Connection *con; /* pointer to connection object */
mtext *dir; /* directory name */
mtext *name; /* file name */
ub4 type; /* type of file */
big_uint offset; /* current offset for read */
};
/*
* Long object
*
*/
struct OCI_Long
{
OCI_Statement *stmt; /* pointer to statement object */
ub4 hstate; /* object variable state */
OCI_Define *def; /* pointer to resultset define object */
ub4 size; /* size of the buffer read / written */
unsigned int type; /* type of long */
ub4 offset; /* current offset for R/W */
ub4 piecesize; /* size of current fetched piece */
ub4 maxsize; /* current offset for R/W */
ub1 *buffer; /* fetched buffer */
};
/*
* Date object
*
*/
struct OCI_Date
{
OCIDate *handle; /* OCI handle */
ub4 hstate; /* object variable state */
OCI_Connection *con; /* pointer to connection object */
OCIError *err; /* OCI context handle */
ub4 allocated; /* is handle allocated ? */
};
/*
* Timestamp object
*
*/
struct OCI_Timestamp
{
#if OCI_VERSION_COMPILE >= OCI_9
OCIDateTime *handle; /* OCI handle */
#else
void *handle; /* fake handle for alignment */
#endif
ub4 hstate; /* object variable state */
OCI_Connection *con; /* pointer to connection object */
OCIError *err; /* OCI context handle */
ub4 type; /* sub type */
};
/*
* Interval object
*
*/
struct OCI_Interval
{
#if OCI_VERSION_COMPILE >= OCI_9
OCIInterval *handle; /* OCI handle */
#else
void *handle; /* fake handle for alignment */
#endif
ub4 hstate; /* object variable state */
OCI_Connection *con; /* pointer to connection object */
OCIError *err; /* OCI context handle */
ub4 type; /* sub type */
};
/*
* Oracle Named type object
*
*/
struct OCI_Object
{
void *handle; /* OCI handle */
ub4 hstate; /* object variable state */
OCI_Connection *con; /* pointer to connection object */
OCI_TypeInfo *typinf; /* pointer to type info object */
void **objs; /* array of OCILIB sub objects */
void *buf; /* buffer to store converted out string attribute */
int buflen; /* buffer length */
sb2 *tab_ind; /* indicators for root instance */
ub2 idx_ind; /* instance indicator offset / indicator table */
OCIObjectLifetime type; /* object type */
};
/*
* Oracle Collection Item object
*
*/
struct OCI_Elem
{
void *handle; /* OCI handle */
ub4 hstate; /* object variable state */
OCI_Connection *con; /* pointer to connection object */
void *obj; /* OCILIB sub object */
void *buf; /* buffer to store converted out string attribute */
int buflen; /* buffer length */
boolean init; /* underlying object has been initialized ? */
OCI_TypeInfo *typinf; /* object type information */
OCIInd *ind; /* data state indicator */
};
/*
* Oracle Collection object
*
*/
struct OCI_Coll
{
OCIColl *handle; /* OCI handle */
ub4 hstate; /* object variable state */
OCI_Connection *con; /* pointer to connection object */
OCI_TypeInfo *typinf; /* pointer to type info object */
OCI_Elem *elem; /* item object */
sb4 size; /* collection size */
};
/*
* Oracle Iterator object
*
*/
struct OCI_Iter
{
OCIIter *handle; /* OCI handle */
OCI_Coll *coll; /* pointer to connection object */
OCI_Elem *elem; /* item object */
boolean eoc; /* end of collection */
boolean boc; /* beginning of collection */
};
/*
* Oracle REF object
*
*/
struct OCI_Ref
{
OCIRef *handle; /* OCI handle */
ub4 hstate; /* object variable state */
OCI_Connection *con; /* pointer to connection object */
OCI_TypeInfo *typinf; /* pointer to type info object */
OCI_Object *obj; /* Pinned object */
boolean pinned; /* is the reference pinned */
};
/*
* Type info object
*
*/
struct OCI_TypeInfo
{
OCI_Connection *con; /* pointer to connection object */
mtext *name; /* name of the type info object */
mtext *schema; /* owner of the type info object */
unsigned int type; /* type of type info handle */
OCIType *tdo; /* datatype object type */
ub2 tcode; /* Oracle type code */
ub2 ccode; /* Oracle collection code */
OCI_Column *cols; /* array of column datatype info */
ub2 nb_cols; /* number of columns */
ub2 refcount; /* reference counter */
};
/*
* OCI_DirPathColumn : Internal Direct Path column object
*
*/
struct OCI_DirPathColumn
{
ub4 format_size; /* size of the column format */
mtext *format; /* date or numeric format */
ub2 maxsize; /* input max size */
ub2 type; /* column type */
ub2 sqlcode; /* sql type */
ub1 *data; /* array of data */
ub1 *flags; /* array of row flags */
ub4 *lens; /* array of lengths */
ub2 bufsize; /* buffer size */
ub2 index; /* ref index in the type info columns list */
};
typedef struct OCI_DirPathColumn OCI_DirPathColumn;
/*
* Oracle Direct Path column object
*
*/
struct OCI_DirPath
{
OCI_Connection *con; /* pointer to connection object */
OCI_TypeInfo *typinf; /* type info about table to load */
OCIDirPathCtx *ctx; /* OCI DP context handle */
OCIDirPathColArray *arr; /* OCI DP column array handle */
OCIDirPathStream *strm; /* OCI DP stream handle */
OCI_DirPathColumn *cols; /* array of column info */
ub4 nb_cols; /* number of columns to load */
ub4 nb_rows; /* maximum number of row to load per stream */
ub4 nb_cur; /* current number of row to load per stream */
ub4 nb_loaded; /* number of row loaded so far */
ub4 nb_prcsd; /* number of row processed at last call */
sb2 err_col; /* index of the column not processed at last call */
sb2 err_row; /* index of the row not processed at last call */
ub4 status; /* internal status */
};
/*
* Hash table object
*
*/
struct OCI_HashTable
{
OCI_HashEntry **items; /* array of slots */
unsigned int size; /* size of the slots array */
unsigned int count; /* number of used slots */
unsigned int type; /* type of data */
};
/*
* OCI_Datatype : fake dummy structure for casting object with
* handles for more compact code
*
*/
struct OCI_Datatype
{
void *handle; /* OCI handle */
ub4 hstate; /* object variable state */
};
typedef struct OCI_Datatype OCI_Datatype;
/* static and unique OCI_Library object */
extern OCI_Library OCILib;
#endif /* OCILIB_OCILIB_TYPES_H_INCLUDED */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -