C:/Users/vincent/Data/Perso/dev/ocilib/ocilib/src/oci_defs.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    |                          IMPORTANT NOTICE                            |
00032    +----------------------------------------------------------------------+
00033    |                                                                      |
00034    | THIS FILE CONTAINS CONSTANTS AND STRUCTURES DECLARATIONS THAT WERE   |
00035    | PICKED UP FROM ORACLE PUBLIC HEADER FILES.                           |
00036    |                                                                      |
00037    | SO THE CONTENT OF THIS FILE IS UNDER ORACLE COPYRIGHT AND THE        |
00038    | DECLARATIONS REPRODUCED HERE ARE ORIGINALLY WRITTEN BY ORACLE        | 
00039    | CORPORATION.                                                         |
00040    |                                                                      |
00041    | THE AUTHOR OF OCILIB LIBRARY HAS NOT WRITTEN THE CONTENT OF THIS     |
00042    | FILE AND HAS PARTIALLY INTEGRATED SOME ORACLE OCI DEFINITONS TO      |
00043    | ALLOW COMPILATION OF THIS OPEN SOURCE LIBRARY WITHOUT HAVING         |
00044    | ORACLE PRODUCTS INSTALLED ON DEVELOPMENT ENVIRONMENTS                |
00045    |                                                                      |
00046    +----------------------------------------------------------------------+
00047 */
00048 
00049 /* ------------------------------------------------------------------------ *
00050  * $Id: oci_defs.h, v 3.4.0 2009-07-30 17:40 Vince $
00051  * ------------------------------------------------------------------------ */
00052 
00053 #ifndef OCILIB_OCI_DEFS_H_INCLUDED 
00054 #define OCILIB_OCI_DEFS_H_INCLUDED 
00055 
00056 #include "oci_types.h"
00057 
00058 /*--------------------------------------------------------------------------- 
00059                      PUBLIC TYPES AND CONSTANTS 
00060   ---------------------------------------------------------------------------*/
00061 
00062 /* input data types */
00063 
00064 #define SQLT_CHR  1                        /* (ORANET TYPE) character string */
00065 #define SQLT_NUM  2                          /* (ORANET TYPE) oracle numeric */
00066 #define SQLT_INT  3                                 /* (ORANET TYPE) integer */
00067 #define SQLT_FLT  4                   /* (ORANET TYPE) Floating point number */
00068 #define SQLT_STR  5                                /* zero terminated string */
00069 #define SQLT_VNU  6                        /* NUM with preceding length byte */
00070 #define SQLT_PDN  7                  /* (ORANET TYPE) Packed Decimal Numeric */
00071 #define SQLT_LNG  8                                                  /* long */
00072 #define SQLT_VCS  9                             /* Variable character string */
00073 #define SQLT_NON  10                      /* Null/empty PCC Descriptor entry */
00074 #define SQLT_RID  11                                                /* rowid */
00075 #define SQLT_DAT  12                                /* date in oracle format */
00076 #define SQLT_VBI  15                                 /* binary in VCS format */
00077 #define SQLT_BFLOAT 21                                /* Native Binary float*/
00078 #define SQLT_BDOUBLE 22                             /* NAtive binary double */
00079 #define SQLT_BIN  23                                  /* binary data(DTYBIN) */
00080 #define SQLT_LBI  24                                          /* long binary */
00081 #define SQLT_UIN  68                                     /* unsigned integer */
00082 #define SQLT_SLS  91                        /* Display sign leading separate */
00083 #define SQLT_LVC  94                                  /* Longer longs (char) */
00084 #define SQLT_LVB  95                                   /* Longer long binary */ 
00085 #define SQLT_AFC  96                                      /* Ansi fixed char */
00086 #define SQLT_AVC  97                                        /* Ansi Var char */
00087 #define SQLT_IBFLOAT  100                          /* binary float canonical */
00088 #define SQLT_IBDOUBLE 101                         /* binary double canonical */
00089 #define SQLT_CUR  102                                        /* cursor  type */
00090 #define SQLT_RDD  104                                    /* rowid descriptor */
00091 #define SQLT_LAB  105                                          /* label type */
00092 #define SQLT_OSL  106                                        /* oslabel type */
00093 
00094 #define SQLT_NTY  108                                   /* named object type */
00095 #define SQLT_REF  110                                            /* ref type */
00096 #define SQLT_CLOB 112                                       /* character lob */
00097 #define SQLT_BLOB 113                                          /* binary lob */
00098 #define SQLT_BFILEE 114                                   /* binary file lob */
00099 #define SQLT_CFILEE 115                                /* character file lob */
00100 #define SQLT_RSET 116                                     /* result set type */
00101 #define SQLT_NCO  122      /* named collection type (varray or nested table) */
00102 #define SQLT_VST  155                                      /* OCIString type */
00103 #define SQLT_ODT  156                                        /* OCIDate type */
00104 
00105 /* datetimes and intervals */
00106 #define SQLT_DATE                      184                      /* ANSI Date */
00107 #define SQLT_TIME                      185                           /* TIME */
00108 #define SQLT_TIME_TZ                   186            /* TIME WITH TIME ZONE */
00109 #define SQLT_TIMESTAMP                 187                      /* TIMESTAMP */
00110 #define SQLT_TIMESTAMP_TZ              188       /* TIMESTAMP WITH TIME ZONE */
00111 #define SQLT_INTERVAL_YM               189         /* INTERVAL YEAR TO MONTH */
00112 #define SQLT_INTERVAL_DS               190         /* INTERVAL DAY TO SECOND */
00113 #define SQLT_TIMESTAMP_LTZ             232        /* TIMESTAMP WITH LOCAL TZ */
00114 
00115 /* cxcheng: this has been added for backward compatibility -
00116    it needs to be here because ocidfn.h can get included ahead of sqldef.h */
00117 #define SQLT_FILE SQLT_BFILEE                              /* binary file lob */
00118 #define SQLT_CFILE SQLT_CFILEE
00119 #define SQLT_BFILE SQLT_BFILEE
00120 
00121 #define SQLT_PNTY   241               /* pl/sql representation of named types */
00122 
00123 
00124 /* CHAR/NCHAR/VARCHAR2/NVARCHAR2/CLOB/NCLOB char set "form" information */
00125 #define SQLCS_IMPLICIT 1     /* for CHAR, VARCHAR2, CLOB w/o a specified set */
00126 #define SQLCS_NCHAR    2                  /* for NCHAR, NCHAR VARYING, NCLOB */
00127 #define SQLCS_EXPLICIT 3   /* for CHAR, etc, with "CHARACTER SET ..." syntax */
00128 #define SQLCS_FLEXIBLE 4                 /* for PL/SQL "flexible" parameters */
00129 #define SQLCS_LIT_NULL 5      /* for typecheck of NULL and empty_clob() lits */
00130 
00131 
00132 /*-----------------------------Handle Types----------------------------------*/
00133                                            /* handle types range from 1 - 49 */
00134 #define OCI_HTYPE_FIRST          1             /* start value of handle type */
00135 #define OCI_HTYPE_ENV            1                     /* environment handle */
00136 #define OCI_HTYPE_ERROR          2                           /* error handle */
00137 #define OCI_HTYPE_SVCCTX         3                         /* service handle */
00138 #define OCI_HTYPE_STMT           4                       /* statement handle */
00139 #define OCI_HTYPE_BIND           5                            /* bind handle */
00140 #define OCI_HTYPE_DEFINE         6                          /* define handle */
00141 #define OCI_HTYPE_DESCRIBE       7                        /* describe handle */
00142 #define OCI_HTYPE_SERVER         8                          /* server handle */
00143 #define OCI_HTYPE_SESSION        9                  /* authentication handle */
00144 #define OCI_HTYPE_AUTHINFO      OCI_HTYPE_SESSION  /* SessionGet auth handle */
00145 #define OCI_HTYPE_DIRPATH_CTX   14                    /* direct path context */
00146 #define OCI_HTYPE_DIRPATH_COLUMN_ARRAY 15        /* direct path column array */
00147 #define OCI_HTYPE_DIRPATH_STREAM       16              /* direct path stream */
00148 #define OCI_HTYPE_TRANS         10                     /* transaction handle */
00149 #define OCI_HTYPE_CPOOL         26                 /* connection pool handle */
00150 #define OCI_HTYPE_ADMIN         28                           /* admin handle */
00151 
00152 /*-------------------------Descriptor Types----------------------------------*/
00153 
00154 #define OCI_DTYPE_LOB 50                                     /* lob  locator */
00155 #define OCI_DTYPE_PARAM 53  /* a parameter descriptor obtained from ocigparm */
00156 #define OCI_DTYPE_FILE 56                                /* File Lob locator */
00157 #define OCI_DTYPE_INTERVAL_YM 62                      /* Interval year month */
00158 #define OCI_DTYPE_INTERVAL_DS 63                      /* Interval day second */
00159 #define OCI_DTYPE_DATE 65                                            /* Date */
00160 #define OCI_DTYPE_TIME 66                                            /* Time */
00161 #define OCI_DTYPE_TIME_TZ 67                           /* Time with timezone */
00162 #define OCI_DTYPE_TIMESTAMP 68                                  /* Timestamp */
00163 #define OCI_DTYPE_TIMESTAMP_TZ 69                 /* Timestamp with timezone */
00164 #define OCI_DTYPE_TIMESTAMP_LTZ 70                /* Timestamp with local tz */
00165 #
00166 /*---------------------------------------------------------------------------*/
00167 
00168 /*--------------------------------LOB types ---------------------------------*/
00169 #define OCI_TEMP_BLOB 1                /* LOB type - BLOB ------------------ */
00170 #define OCI_TEMP_CLOB 2                /* LOB type - CLOB ------------------ */
00171 /*---------------------------------------------------------------------------*/
00172 
00173 /*--------------------------Attribute Types----------------------------------*/
00174 
00175 
00176 #define OCI_ATTR_OBJECT   2 /* is the environment initialized in object mode */
00177 #define OCI_ATTR_SQLCODE  4                                  /* the SQL verb */
00178 #define OCI_ATTR_ENV  5                            /* the environment handle */
00179 #define OCI_ATTR_SERVER 6                               /* the server handle */
00180 #define OCI_ATTR_SESSION 7                        /* the user session handle */
00181 #define OCI_ATTR_TRANS   8                         /* the transaction handle */
00182 #define OCI_ATTR_ROW_COUNT   9                  /* the rows processed so far */
00183 #define OCI_ATTR_SQLFNCODE 10               /* the SQL verb of the statement */
00184 #define OCI_ATTR_PREFETCH_ROWS  11    /* sets the number of rows to prefetch */
00185 #define OCI_ATTR_NESTED_PREFETCH_ROWS 12 /* the prefetch rows of nested table*/
00186 #define OCI_ATTR_PREFETCH_MEMORY 13         /* memory limit for rows fetched */
00187 #define OCI_ATTR_NESTED_PREFETCH_MEMORY 14   /* memory limit for nested rows */
00188 #define OCI_ATTR_PDSCL          16                   /* packed decimal scale */
00189 #define OCI_ATTR_FSPRECISION OCI_ATTR_PDSCL   
00190                                           /* fs prec for datetime data types */
00191 #define OCI_ATTR_PDPRC          17                  /* packed decimal format */
00192 #define OCI_ATTR_LFPRECISION OCI_ATTR_PDPRC 
00193                                           /* fs prec for datetime data types */
00194 
00195 #define OCI_ATTR_PARAM_COUNT 18       /* number of column in the select list */
00196 #define OCI_ATTR_ROWID   19                                     /* the rowid */
00197 #define OCI_ATTR_CHARSET  20                      /* the character set value */
00198 #define OCI_ATTR_USERNAME 22                           /* username attribute */
00199 #define OCI_ATTR_PASSWORD 23                           /* password attribute */
00200 #define OCI_ATTR_STMT_TYPE   24                            /* statement type */
00201 #define OCI_ATTR_XID     27           /* XOPEN defined global transaction id */
00202 #define OCI_ATTR_CHARSET_ID 31                           /* Character Set ID */
00203 #define OCI_ATTR_CHARSET_FORM 32                       /* Character Set Form */
00204 #define OCI_ATTR_MAXDATA_SIZE 33       /* Maximumsize of data on the server  */
00205 #define OCI_ATTR_ROWS_RETURNED 42
00206                /* Number of rows returned in current iter - for Bind handles */
00207 
00208 #define OCI_ATTR_LOBEMPTY               45                    /* empty lob ? */
00209 
00210 #define OCI_ATTR_NUM_DML_ERRORS         73       /* num of errs in array DML */
00211 #define OCI_ATTR_DML_ROW_OFFSET         74        /* row offset in the array */
00212 
00213 #define OCI_ATTR_DATEFORMAT             75     /* default date format string */
00214 #define OCI_ATTR_BUF_ADDR               76                 /* buffer address */
00215 #define OCI_ATTR_BUF_SIZE               77                    /* buffer size */
00216 #define OCI_ATTR_NUM_ROWS               81 /* number of rows in column array */                                 
00217 #define OCI_ATTR_COL_COUNT              82 /* columns of column array
00218                                                      processed so far.       */
00219 #define OCI_ATTR_NUM_COLS              102              /* number of columns */
00220 #define OCI_ATTR_LIST_COLUMNS          103   /* parameter of the column list */
00221 
00222 #define OCI_ATTR_PARAM                 124           /* parameter descriptor */
00223 #define OCI_ATTR_PARSE_ERROR_OFFSET    129             /* Parse Error offset */
00224 
00225 #define OCI_ATTR_SERVER_STATUS             143        /* state of the server hdl */
00226 
00227 #define OCI_ATTR_CURRENT_POSITION      164      /* for scrollable result sets*/
00228 #define OCI_ATTR_STMTCACHESIZE         176         /* size of the stmt cache */
00229 
00230 #define OCI_ATTR_CONN_NOWAIT           178
00231 #define OCI_ATTR_CONN_BUSY_COUNT       179
00232 #define OCI_ATTR_CONN_OPEN_COUNT       180
00233 #define OCI_ATTR_CONN_TIMEOUT          181
00234 #define OCI_ATTR_STMT_STATE            182
00235 #define OCI_ATTR_CONN_MIN              183
00236 #define OCI_ATTR_CONN_MAX              184
00237 #define OCI_ATTR_CONN_INCR             185
00238 #define OCI_ATTR_ROWS_FETCHED          197      /* rows fetched in last call */
00239 
00240 #define OCI_ATTR_TYPECODE              216           /* object or collection */
00241 #define OCI_ATTR_COLLECTION_TYPECODE   217         /* varray or nested table */
00242 
00243 #define OCI_ATTR_COLLECTION_ELEMENT    227     /* has a collection attribute */
00244 #define OCI_ATTR_NUM_TYPE_ATTRS        228      /* number of attribute types */
00245 #define OCI_ATTR_LIST_TYPE_ATTRS       229        /* list of type attributes */
00246 
00247 #define OCI_ATTR_CLIENT_IDENTIFIER     278       /* value of client id to set*/
00248 
00249 #define OCI_ATTR_CHAR_USED             285          /* char length semantics */
00250 #define OCI_ATTR_CHAR_SIZE             286                    /* char length */
00251 
00252 #define OCI_ATTR_ADMIN_PFILE           389         /* client-side param file */
00253 
00254 #define OCI_ATTR_MODULE                366             /* module for tracing */
00255 #define OCI_ATTR_ACTION                367             /* action for tracing */
00256 #define OCI_ATTR_CLIENT_INFO           368                    /* client info */
00257 
00258 #define OCI_ATTR_DRIVER_NAME           424                    /* Driver Name */
00259 
00260 /*------- Temporary attribute value for UCS2/UTF16 character set ID -------- */ 
00261 
00262 #define OCI_UCS2ID                     1000               /* UCS2 charset ID */
00263 #define OCI_UTF16ID                    1000              /* UTF16 charset ID */
00264 
00265 /*-------------------------Credential Types----------------------------------*/
00266 
00267 #define OCI_CRED_RDBMS      1                  /* database username/password */
00268 #define OCI_CRED_EXT        2             /* externally provided credentials */
00269 #define OCI_CRED_PROXY      3                        /* proxy authentication */
00270 
00271 /*------------------------Error Return Values--------------------------------*/
00272 
00273 #define OCI_SUCCESS 0                      /* maps to SQL_SUCCESS of SAG CLI */
00274 #define OCI_SUCCESS_WITH_INFO 1             /* maps to SQL_SUCCESS_WITH_INFO */
00275 #define OCI_NO_DATA 100                               /* maps to SQL_NO_DATA */
00276 #define OCI_ERROR -1                                    /* maps to SQL_ERROR */
00277 #define OCI_INVALID_HANDLE -2                  /* maps to SQL_INVALID_HANDLE */
00278 #define OCI_NEED_DATA 99                            /* maps to SQL_NEED_DATA */
00279 #define OCI_STILL_EXECUTING -3123                   /* OCI would block error */
00280 
00281 /*---------------- Server Handle Attribute Values ---------------------------*/
00282 
00283 #define OCI_SERVER_NOT_CONNECTED        0x0 
00284 #define OCI_SERVER_NORMAL               0x1 
00285 
00286 /*--------------------- User Callback Return Values -------------------------*/
00287 #define OCI_CONTINUE -24200    /* Continue with the body of the OCI function */
00288 
00289 /*------------------------Attach Modes---------------------------------------*/
00290 
00291 #define OCI_CPOOL            0x0200  /* Attach using server handle from pool */
00292 
00293 /*------------------DateTime and Interval check Error codes------------------*/
00294 
00295 #define   OCI_DT_INVALID_DAY         0x1                          /* Bad day */
00296 #define   OCI_DT_DAY_BELOW_VALID     0x2      /* Bad DAy Low/high bit (1=low)*/
00297 #define   OCI_DT_INVALID_MONTH       0x4                       /*  Bad MOnth */
00298 #define   OCI_DT_MONTH_BELOW_VALID   0x8   /* Bad MOnth Low/high bit (1=low) */
00299 #define   OCI_DT_INVALID_YEAR        0x10                        /* Bad YeaR */
00300 #define   OCI_DT_YEAR_BELOW_VALID    0x20  /*  Bad YeaR Low/high bit (1=low) */
00301 #define   OCI_DT_INVALID_HOUR        0x40                       /*  Bad HouR */
00302 #define   OCI_DT_HOUR_BELOW_VALID    0x80   /* Bad HouR Low/high bit (1=low) */
00303 #define   OCI_DT_INVALID_MINUTE      0x100                     /* Bad MiNute */
00304 #define   OCI_DT_MINUTE_BELOW_VALID  0x200 /*Bad MiNute Low/high bit (1=low) */
00305 #define   OCI_DT_INVALID_SECOND      0x400                    /*  Bad SeCond */
00306 #define   OCI_DT_SECOND_BELOW_VALID  0x800  /*bad second Low/high bit (1=low)*/
00307 #define   OCI_DT_DAY_MISSING_FROM_1582 0x1000     
00308                                  /*  Day is one of those "missing" from 1582 */
00309 #define   OCI_DT_YEAR_ZERO           0x2000       /* Year may not equal zero */
00310 #define   OCI_DT_INVALID_TIMEZONE    0x4000                 /*  Bad Timezone */
00311 #define   OCI_DT_INVALID_FORMAT      0x8000         /* Bad date format input */
00312 
00313 
00314 /*------------------------Scrollable Cursor Fetch Options------------------- 
00315  * For non-scrollable cursor, the only valid (and default) orientation is 
00316  * OCI_FETCH_NEXT
00317  */
00318 #define OCI_FETCH_CURRENT     0x01           /* refetching current position  */
00319 #define OCI_FETCH_NEXT        0x02                               /* next row */
00320 #define OCI_FETCH_FIRST       0x04            /* first row of the result set */
00321 #define OCI_FETCH_LAST        0x08         /* the last row of the result set */
00322 #define OCI_FETCH_PRIOR       0x10   /* the previous row relative to current */
00323 #define OCI_FETCH_ABSOLUTE    0x20             /* absolute offset from first */
00324 #define OCI_FETCH_RELATIVE    0x40             /* offset relative to current */
00325 #define OCI_FETCH_RESERVED_1  0x80                               /* reserved */
00326 
00327 /*------------------------Parse mode ----------------------------------------*/
00328 
00329 #define OCI_NTV_SYNTAX 1    /* Use what so ever is the native lang of server */
00330 
00331 
00332 /*------------------------Bind and Define Options----------------------------*/
00333 
00334 #define OCI_DATA_AT_EXEC      0x00000002             /* data at execute time */
00335 #define OCI_DYNAMIC_FETCH     0x00000002                /* fetch dynamically */
00336 #define OCI_PIECEWISE         0x00000004          /* piecewise DMLs or fetch */
00337 
00338 /*----------------------- Execution Modes -----------------------------------*/
00339 
00340 #define OCI_BATCH_ERRORS      0x80             /* batch errors in array dmls */
00341 #define OCI_STMT_SCROLLABLE_READONLY 0x08     /* if result set is scrollable */
00342 
00343 
00344 /*-----------------------------  Various Modes ------------------------------*/
00345 #define OCI_DEFAULT         0x00000000 
00346 #define OCI_THREADED        0x00000001      /* appl. in threaded environment */
00347 #define OCI_OBJECT          0x00000002  /* application in object environment */
00348 #define OCI_UTF16           0x00004000        /* mode for all UTF16 metadata */
00349 
00350 /*------------------------Authentication Modes-------------------------------*/
00351 #define OCI_SYSDBA          0x00000002           /* for SYSDBA authorization */
00352 #define OCI_SYSOPER         0x00000004          /* for SYSOPER authorization */
00353 #define OCI_PRELIM_AUTH     0x00000008      /* for preliminary authorization */
00354 
00355 /*------------------------ Transaction Start Flags --------------------------*/
00356 
00357 #define OCI_TRANS_NEW          0x00000001 /* starts a new transaction branch */
00358 #define OCI_TRANS_JOIN         0x00000002    /* join an existing transaction */
00359 #define OCI_TRANS_RESUME       0x00000004         /* resume this transaction */
00360 #define OCI_TRANS_STARTMASK    0x000000ff
00361 
00362 #define OCI_TRANS_READONLY     0x00000100   /* starts a readonly transaction */
00363 #define OCI_TRANS_READWRITE    0x00000200 /* starts a read-write transaction */
00364 #define OCI_TRANS_SERIALIZABLE 0x00000400
00365                                         /* starts a serializable transaction */
00366 #define OCI_TRANS_ISOLMASK     0x0000ff00
00367 
00368 #define OCI_TRANS_LOOSE        0x00010000        /* a loosely coupled branch */
00369 #define OCI_TRANS_TIGHT        0x00020000        /* a tightly coupled branch */
00370 #define OCI_TRANS_TYPEMASK     0x000f0000
00371 
00372 #define OCI_TRANS_NOMIGRATE    0x00100000      /* non migratable transaction */
00373 #define OCI_TRANS_SEPARABLE    0x00200000  /* separable transaction (8.1.6+) */
00374 #define OCI_TRANS_OTSRESUME    0x00400000      /* OTS resuming a transaction */
00375 
00376 /*------------------------ Transaction End Flags ----------------------------*/
00377 
00378 #define OCI_TRANS_TWOPHASE      0x01000000           /* use two phase commit */
00379 #define OCI_TRANS_WRITEBATCH    0x00000001  /* force cmt-redo for local txns */
00380 #define OCI_TRANS_WRITEIMMED    0x00000002              /* no force cmt-redo */
00381 #define OCI_TRANS_WRITEWAIT     0x00000004               /* no sync cmt-redo */
00382 #define OCI_TRANS_WRITENOWAIT   0x00000008   /* sync cmt-redo for local txns */
00383 
00384 /*------------------------Describe Handle Parameter Attributes --------------*/
00385 
00386 #define OCI_ATTR_DATA_SIZE      1                /* maximum size of the data */
00387 #define OCI_ATTR_DATA_TYPE      2     /* the SQL type of the column/argument */
00388 #define OCI_ATTR_DISP_SIZE      3                        /* the display size */
00389 #define OCI_ATTR_NAME           4         /* the name of the column/argument */
00390 #define OCI_ATTR_PRECISION      5                /* precision if number type */
00391 #define OCI_ATTR_SCALE          6                    /* scale if number type */
00392 #define OCI_ATTR_IS_NULL        7                            /* is it null ? */
00393 #define OCI_ATTR_TYPE_NAME      8             /* name of the named data type */
00394 #define OCI_ATTR_SCHEMA_NAME    9                         /* the schema name */
00395 #define OCI_ATTR_SUB_NAME       10      /* type name if package private type */
00396 
00397 /*------------------------Other Constants------------------------------------*/
00398 
00399 #define OCI_ERROR_MAXMSG_SIZE   1024         /* max size of an error message */
00400 #define OCI_LOBMAXSIZE          MINUB4MAXVAL        /* maximum lob data size */
00401 #define OCI_ROWID_LEN           23 
00402 
00403 /*-----------------------Handle Definitions----------------------------------*/
00404 typedef struct OCIEnv           OCIEnv;            /* OCI environment handle */
00405 typedef struct OCIError         OCIError;                /* OCI error handle */
00406 typedef struct OCISvcCtx        OCISvcCtx;             /* OCI service handle */
00407 typedef struct OCIStmt          OCIStmt;             /* OCI statement handle */
00408 typedef struct OCIBind          OCIBind;                  /* OCI bind handle */
00409 typedef struct OCIDefine        OCIDefine;              /* OCI Define handle */
00410 typedef struct OCIDescribe      OCIDescribe;          /* OCI Describe handle */
00411 typedef struct OCIServer        OCIServer;              /* OCI Server handle */
00412 typedef struct OCISession       OCISession;     /* OCI Authentication handle */
00413 typedef struct OCIComplexObject OCIComplexObject;          /* OCI COR handle */
00414 typedef struct OCITrans         OCITrans;          /* OCI Transaction handle */
00415 typedef struct OCISecurity      OCISecurity;          /* OCI Security handle */
00416 typedef struct OCISubscription  OCISubscription;      /* subscription handle */
00417 
00418 typedef struct OCICPool         OCICPool;          /* connection pool handle */
00419 typedef struct OCISPool         OCISPool;             /* session pool handle */
00420 typedef struct OCIAuthInfo      OCIAuthInfo;                  /* auth handle */
00421 typedef struct OCIAdmin         OCIAdmin;                    /* admin handle */
00422 typedef struct OCIEvent         OCIEvent;                 /* HA event handle */
00423 
00424 
00425 typedef struct OCIDirPathCtx      OCIDirPathCtx;               /* DP context */
00426 typedef struct OCIDirPathColArray OCIDirPathColArray;     /* DP column array */
00427 typedef struct OCIDirPathStream   OCIDirPathStream;             /* DP stream */
00428 
00429 /*--------------------- OCI Thread Object Definitions------------------------*/
00430 
00431 /* OCIThread Context */
00432 typedef struct OCIThreadContext OCIThreadContext;
00433 
00434 /* OCIThread Mutual Exclusion Lock */
00435 typedef struct OCIThreadMutex   OCIThreadMutex; 
00436 
00437 /* OCIThread Key for Thread-Specific Data */
00438 typedef struct OCIThreadKey     OCIThreadKey;  
00439 
00440 /* OCIThread Thread ID */
00441 typedef struct OCIThreadId      OCIThreadId;  
00442 
00443 /* OCIThread Thread Handle */
00444 typedef struct OCIThreadHandle  OCIThreadHandle;  
00445 
00446 /*--------------------- OCI Collection Object Definitions--------------------*/
00447 
00448 /* OCIColl - generic collection type */
00449 typedef struct OCIColl OCIColl;
00450 
00451 /* OCIArray - varray collection type */
00452 typedef OCIColl OCIArray;
00453 
00454 /* OCITable - nested table collection type */
00455 typedef OCIColl OCITable;
00456 
00457 /* OCIIter - collection iterator */
00458 typedef struct OCIIter OCIIter;
00459 
00460 
00461 /*-----------------------Descriptor Definitions------------------------------*/
00462 
00463 typedef struct OCISnapshot      OCISnapshot;      /* OCI snapshot descriptor */
00464 typedef struct OCIResult        OCIResult;      /* OCI Result Set Descriptor */
00465 typedef struct OCILobLocator    OCILobLocator; /* OCI Lob Locator descriptor */
00466 typedef struct OCIParam         OCIParam;        /* OCI PARameter descriptor */
00467 typedef struct OCIDateTime      OCIDateTime;      /* OCI DateTime descriptor */
00468 typedef struct OCIInterval      OCIInterval;      /* OCI Interval descriptor */
00469 typedef struct OCIRowid         OCIRowid;            /* OCI ROWID descriptor */
00470 
00471 
00472 /*----------------------------- OBJECT FREE OPTION --------------------------*/
00473 
00474 #define OCI_OBJECTFREE_FORCE      (ub2)0x0001
00475 #define OCI_OBJECTFREE_NONULL     (ub2)0x0002
00476 
00477 /*-------------------------- OCINumber --------------------------------------*/
00478 
00479 #define OCI_NUMBER_UNSIGNED 0                        /* Unsigned type -- ubX */
00480 #define OCI_NUMBER_SIGNED   2                          /* Signed type -- sbX */
00481 #define OCI_NUMBER_SIZE     22
00482 
00483 struct OCINumber
00484 {
00485   ub1 OCINumberPart[OCI_NUMBER_SIZE];
00486 };
00487 
00488 /*-----------------------Objects Definitions---------------------------------*/
00489 
00490 typedef struct OCIString        OCIString;
00491 typedef struct OCIRaw           OCIRaw;
00492 typedef struct OCIType          OCIType;
00493 typedef struct OCINumber        OCINumber;
00494 typedef struct OCIRef           OCIRef;   
00495 
00496 /*--------------------------- OBJECT INDICATOR ------------------------------*/
00497 
00498 typedef sb2 OCIInd;
00499 /*
00500  * OCIInd -- a variable of this type contains (null) indicator information
00501  */
00502 
00503 #define OCI_IND_NOTNULL (OCIInd)0                                /* not NULL */
00504 #define OCI_IND_NULL (OCIInd)(-1)                                    /* NULL */
00505 #define OCI_IND_BADNULL (OCIInd)(-2)                             /* BAD NULL */
00506 #define OCI_IND_NOTNULLABLE (OCIInd)(-3)                     /* not NULLable */
00507 
00508 
00509 /*-------------------------Object Ptr Types----------------------------------*/
00510 #define OCI_OTYPE_NAME 1                                      /* object name */
00511 #define OCI_OTYPE_REF  2                                       /* REF to TDO */
00512 #define OCI_OTYPE_PTR  3                                       /* PTR to TDO */
00513 
00514 /*------------------------ Lob-specific Definitions -------------------------*/
00515 
00516 typedef ub4 OCILobOffset;
00517 typedef ub4 OCILobLength;
00518 
00519 /*----------------------------Piece Definitions------------------------------*/
00520 
00521 #define OCI_ONE_PIECE 0                                         /* one piece */
00522 #define OCI_FIRST_PIECE 1                                 /* the first piece */
00523 #define OCI_NEXT_PIECE 2                          /* the next of many pieces */
00524 #define OCI_LAST_PIECE 3                                   /* the last piece */
00525 
00526 
00527 /*----------------------- GET OPTIONS FOR TDO  ------------------------------*/
00528 
00529 enum OCITypeGetOpt
00530 {
00531   OCI_TYPEGET_HEADER,   /* load only the header portion of the TDO           */
00532   OCI_TYPEGET_ALL       /* load all attribute and method descriptors as well */
00533 };
00534 typedef enum OCITypeGetOpt OCITypeGetOpt;
00535 
00536 /*--------------------------- OBJECT PIN OPTION -----------------------------*/
00537 
00538 enum OCIPinOpt
00539 {
00540   /* 0 = uninitialized */
00541   OCI_PIN_DEFAULT = 1,                                 /* default pin option */
00542   OCI_PIN_ANY = 3,                             /* pin any copy of the object */
00543   OCI_PIN_RECENT = 4,                       /* pin recent copy of the object */
00544   OCI_PIN_LATEST = 5                        /* pin latest copy of the object */
00545 };
00546 typedef enum OCIPinOpt OCIPinOpt;
00547 
00548 /*--------------------------- OBJECT LOCK OPTION ----------------------------*/
00549 
00550 enum OCILockOpt
00551 {
00552   /* 0 = uninitialized */
00553   OCI_LOCK_NONE = 1,                               /* null (same as no lock) */
00554   OCI_LOCK_X = 2,                                          /* exclusive lock */
00555   OCI_LOCK_X_NOWAIT = 3                      /* exclusive lock, do not wait  */
00556 };
00557 typedef enum OCILockOpt OCILockOpt;
00558 
00559 /*------------------------- OBJECT MODIFYING OPTION -------------------------*/
00560 
00561 enum OCIMarkOpt
00562 {
00563   /* 0 = uninitialized */
00564   OCI_MARK_DEFAULT = 1,               /* default (the same as OCI_MARK_NONE) */
00565   OCI_MARK_NONE = OCI_MARK_DEFAULT,          /* object has not been modified */
00566   OCI_MARK_UPDATE                                 /* object is to be updated */
00567 };
00568 typedef enum OCIMarkOpt OCIMarkOpt;
00569 
00570 /*------------------------------ TYPE CODE ----------------------------------*/
00571 
00572 /* The OCITypeCode type is interchangeable with the existing SQLT type
00573    which is a ub2 */
00574 typedef ub2 OCITypeCode;
00575 
00576 /*---------------------------  ORACLE DATE TYPE  ----------------------------*/
00577 
00578 struct OCITime
00579 {
00580   ub1 OCITimeHH;                          /* hours; range is 0 <= hours <=23 */
00581   ub1 OCITimeMI;                     /* minutes; range is 0 <= minutes <= 59 */
00582   ub1 OCITimeSS;                     /* seconds; range is 0 <= seconds <= 59 */
00583 };
00584 typedef struct OCITime OCITime;
00585 
00586 struct OCIDate
00587 {
00588   sb2 OCIDateYYYY;         /* gregorian year; range is -4712 <= year <= 9999 */
00589   ub1 OCIDateMM;                          /* month; range is 1 <= month < 12 */
00590   ub1 OCIDateDD;                             /* day; range is 1 <= day <= 31 */
00591   OCITime OCIDateTime;                                               /* time */
00592 };
00593 typedef struct OCIDate OCIDate;
00594 
00595 /*-------------------------- OBJECT Duration --------------------------------*/
00596  
00597 typedef ub2 OCIDuration;
00598  
00599 #define  OCI_DURATION_BEGIN (OCIDuration)10
00600                                            /* beginning sequence of duration */
00601 #define  OCI_DURATION_NULL (OCIDuration)(OCI_DURATION_BEGIN-1)
00602                                                             /* null duration */
00603 #define  OCI_DURATION_DEFAULT (OCIDuration)(OCI_DURATION_BEGIN-2) /* default */
00604 #define  OCI_DURATION_NEXT (OCIDuration)(OCI_DURATION_BEGIN-3)
00605                                                     /* next special duration */
00606 #define  OCI_DURATION_SESSION (OCIDuration)(OCI_DURATION_BEGIN)
00607                                                   /* the end of user session */
00608 #define  OCI_DURATION_TRANS (OCIDuration)(OCI_DURATION_BEGIN+1)
00609                                               /* the end of user transaction */
00610 
00611 /*-------------------------Object Ptr Types----------------------------------*/
00612 #define OCI_OTYPE_NAME 1                                      /* object name */
00613 
00614 /*--------------------------- OCI Parameter Types ---------------------------*/
00615 #define OCI_PTYPE_UNK                 0                         /* unknown   */
00616 #define OCI_PTYPE_TABLE               1                         /* table     */
00617 #define OCI_PTYPE_VIEW                2                         /* view      */
00618 #define OCI_PTYPE_PROC                3                         /* procedure */
00619 #define OCI_PTYPE_FUNC                4                         /* function  */
00620 #define OCI_PTYPE_PKG                 5                         /* package   */
00621 #define OCI_PTYPE_TYPE                6                 /* user-defined type */
00622 #define OCI_PTYPE_SYN                 7                         /* synonym   */
00623 #define OCI_PTYPE_SEQ                 8                         /* sequence  */
00624 #define OCI_PTYPE_COL                 9                         /* column    */
00625 #define OCI_PTYPE_ARG                 10                        /* argument  */
00626 #define OCI_PTYPE_LIST                11                        /* list      */
00627 #define OCI_PTYPE_TYPE_ATTR           12    /* user-defined type's attribute */
00628 #define OCI_PTYPE_TYPE_COLL           13        /* collection type's element */
00629 #define OCI_PTYPE_TYPE_METHOD         14       /* user-defined type's method */
00630 #define OCI_PTYPE_TYPE_ARG            15   /* user-defined type method's arg */
00631 #define OCI_PTYPE_TYPE_RESULT         16/* user-defined type method's result */
00632 #define OCI_PTYPE_SCHEMA              17                           /* schema */
00633 #define OCI_PTYPE_DATABASE            18                         /* database */
00634 #define OCI_PTYPE_RULE                19                             /* rule */
00635 #define OCI_PTYPE_RULE_SET            20                         /* rule set */
00636 #define OCI_PTYPE_EVALUATION_CONTEXT  21               /* evaluation context */
00637 #define OCI_PTYPE_TABLE_ALIAS         22                      /* table alias */
00638 #define OCI_PTYPE_VARIABLE_TYPE       23                    /* variable type */
00639 #define OCI_PTYPE_NAME_VALUE          24                  /* name value pair */
00640 
00641 /*------------------------------ TYPE CODE ----------------------------------*/
00642 
00643 #define OCI_TYPECODE_VARRAY      247         /* SQL VARRAY  OTS PAGED VARRAY */
00644 #define OCI_TYPECODE_TABLE       248              /* SQL TABLE  OTS MULTISET */
00645 
00646 /*------------------------Piece Information----------------------------------*/
00647 #define OCI_PARAM_IN 0x01                                    /* in parameter */
00648 #define OCI_PARAM_OUT 0x02                                  /* out parameter */
00649 
00650 /*----------------------- OBJECT PROPERTY ID -------------------------------*/
00651 
00652 typedef ub1 OCIObjectPropId;
00653 #define OCI_OBJECTPROP_LIFETIME 1       /* persistent or transient or value */
00654 #define OCI_OBJECTPROP_SCHEMA 2   /* schema name of table containing object */
00655 #define OCI_OBJECTPROP_TABLE 3     /* table name of table containing object */
00656 #define OCI_OBJECTPROP_PIN_DURATION 4             /* pin duartion of object */
00657 #define OCI_OBJECTPROP_ALLOC_DURATION 5         /* alloc duartion of object */
00658 #define OCI_OBJECTPROP_LOCK 6                      /* lock status of object */
00659 #define OCI_OBJECTPROP_MARKSTATUS 7                /* mark status of object */
00660 #define OCI_OBJECTPROP_VIEW 8            /* is object a view object or not? */
00661 
00662 /*----------------------- OBJECT LIFETIME ----------------------------------*/
00663 
00664 enum OCIObjectLifetime
00665 {
00666    /* 0 = uninitialized */
00667    OCI_OBJECT_PERSISTENT = 1,                          /* persistent object */
00668    OCI_OBJECT_TRANSIENT,                                /* transient object */
00669    OCI_OBJECT_VALUE                                         /* value object */
00670 };
00671 typedef enum OCIObjectLifetime OCIObjectLifetime;
00672 
00673 /*----------------------- OBJECT MARK STATUS -------------------------------*/
00674 
00675 typedef uword OCIObjectMarkStatus;
00676 #define OCI_OBJECT_NEW     0x0001                             /* new object */
00677 #define OCI_OBJECT_DELETED 0x0002                  /* object marked deleted */
00678 #define OCI_OBJECT_UPDATED 0x0004                  /* object marked updated */
00679 
00680 /* macros to test the object mark status */ 
00681 #define OCI_OBJECT_IS_UPDATED(flag) bit((flag), OCI_OBJECT_UPDATED)
00682 #define OCI_OBJECT_IS_DELETED(flag) bit((flag), OCI_OBJECT_DELETED)
00683 #define OCI_OBJECT_IS_NEW(flag) bit((flag), OCI_OBJECT_NEW)
00684 #define OCI_OBJECT_IS_DIRTY(flag) \
00685   bit((flag), OCI_OBJECT_UPDATED|OCI_OBJECT_NEW|OCI_OBJECT_DELETED)
00686 
00687 /*----- values for cflg argument to OCIDirpathColArrayEntrySet --------------*/
00688 
00689 #define OCI_DIRPATH_COL_COMPLETE 0                /* column data is complete */
00690 #define OCI_DIRPATH_COL_NULL     1                         /* column is null */
00691 #define OCI_DIRPATH_COL_PARTIAL  2                 /* column data is partial */
00692 #define OCI_DIRPATH_COL_ERROR    3               /* column error, ignore row */
00693 
00694 /*----- values for action parameter to OCIDirPathDataSave -------------------*/
00695 #define OCI_DIRPATH_DATASAVE_SAVEONLY 0              /* data save point only */
00696 
00697 /*------------- Supported Values for Direct Path Date cache -----------------*/
00698 #define OCI_ATTR_DIRPATH_DCACHE_NUM         303        /* date cache entries */
00699 #define OCI_ATTR_DIRPATH_DCACHE_SIZE        304          /* date cache limit */
00700 #define OCI_ATTR_DIRPATH_DCACHE_MISSES      305         /* date cache misses */
00701 #define OCI_ATTR_DIRPATH_DCACHE_HITS        306           /* date cache hits */
00702 #define OCI_ATTR_DIRPATH_DCACHE_DISABLE     307 /* on set: disable datecache */
00703 
00704 /*------------- Supported Values for Direct Path Stream Version -------------*/
00705 
00706 #define OCI_ATTR_DIRPATH_NOLOG          79               /* nologging option */
00707 #define OCI_ATTR_DIRPATH_PARALLEL       80     /* parallel (temp seg) option */
00708 
00709 /*------------------------- Database Startup Flags --------------------------*/
00710 #define OCI_DBSTARTUPFLAG_FORCE 0x00000001  /* Abort running instance, start */
00711 #define OCI_DBSTARTUPFLAG_RESTRICT 0x00000002      /* Restrict access to DBA */
00712 
00713 /*------------------------- Database Shutdown Modes -------------------------*/
00714 #define OCI_DBSHUTDOWN_TRANSACTIONAL      1 /* Wait for all the transactions */
00715 #define OCI_DBSHUTDOWN_TRANSACTIONAL_LOCAL 2  /* Wait for local transactions */
00716 #define OCI_DBSHUTDOWN_IMMEDIATE           3      /* Terminate and roll back */
00717 #define OCI_DBSHUTDOWN_ABORT              4 /* Terminate and don't roll back */
00718 #define OCI_DBSHUTDOWN_FINAL              5              /* Orderly shutdown */
00719 
00720 
00721 #endif /* OCILIB_OCI_DEFS_H_INCLUDED */
00722 

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