Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

localoci.h

Go to the documentation of this file.
00001 
00002 /*
00003  *   THIS FILE IS UNDER RCS - DO NOT MODIFY UNLESS YOU HAVE
00004  *   CHECKED IT OUT USING THE COMMAND CHECKOUT.
00005  *
00006  *    $Id: localoci_8h-source.html 2161 2006-05-19 16:55:03Z paulf $
00007  *
00008  *    Revision history:
00009  *     $Log$
00009  *     Revision 1.1  2006/05/19 16:55:02  paulf
00009  *     first inclusion
00009  *
00010  *     Revision 1.1  2000/02/14 20:05:54  lucky
00011  *     Initial revision
00012  *
00013  *
00014  */
00015 
00016 /*
00017  *  localoci.h   
00018  *  
00019  *  Does all the basic Oracle OCI includes required
00020  *
00021  *  Also contains some useful definitions to use with OCI 7.3
00022  *  (Not everything is nicely defined in the Oracle header files)
00023  *                                       -Lynn Dietz
00024  *  
00025  * NOTE:  When you need to test the VALUE of a return code from an
00026  *        OCI function, always use the rc field of the Cda_Def structure
00027  *        instead of the actual returned value. The rc value will  
00028  *        always be positive (it's an unsigned 2-byte int in OCI 7.3).
00029  *
00030  *        The actual return value (which is the same as the
00031  *        outdated v2_rc field of the Cda_Def structure) may have 
00032  *        a different sign or value than the rc field and could 
00033  *        cause one to become very confused.  LDD
00034  *
00035  */
00036 
00037 #ifndef LOCALOCI_H
00038 #define LOCALOCI_H
00039 
00040 /* Basic Oracle OCI includes: 
00041  ****************************/
00042 #include <oratypes.h>
00043 #include <ocidfn.h>
00044 #ifdef __STDC__       /* if ANSI C compiler */
00045 #include <ociapr.h>
00046 #else
00047 #include <ocikpr.h>
00048 #endif
00049 
00050 /* Useful local definitions start here: */
00051 
00052 /* Oracle DataType Codes
00053  * internal/external datatype codes 
00054  **********************************/
00055 #define VARCHAR2_TYPE         1   /* char[n], n<=2000                  */
00056 #define NUMBER_TYPE           2   /* unsigned char[21]                 */
00057 #define INT_TYPE              3   /* signed char,short,int, or long    */
00058 #define FLOAT_TYPE            4   /* float, double                     */
00059 #define STRING_TYPE           5   /* char[n+1] (null-terminated-string)*/
00060 #define ROWID_TYPE           11   /* char[n]                           */
00061 #define DATE_TYPE            12   /* char[7]                           */
00062 #define LONGVARRAW_TYPE      24   /* unsigned char[n+ilen]             */
00063 #define UNSIGNED_TYPE        68   /* unsigned integers                 */
00064 #define CHAR_TYPE            96   /* fixed-length char[n] n<=255       */
00065 
00066 /* Oracle OCI oparse flags 
00067  *************************/
00068 #define  NATIVE                     1
00069 #define  VERSION_7                  2
00070 #define  OCI_NTS                   -1   /* null-terminated string */
00071 #define  OCI_IGNORED_FIELD         -1
00072 #define  OCI_MORE_FETCH_PIECES   3130
00073 #define  OCI_MORE_INSERT_PIECES  3129
00074 #define  OCI_NO_MORE_DATA        1403   /* got all data */
00075 #define  OCI_NULL_COLUMN         1405   /* fetched a null column */
00076 #define  OCI_TRUNCATED_COLUMN    1406   /* truncated a column */
00077 #define  OCI_DEFER_FULL_PARSE       1
00078 #define  OCI_NODEFER_FULL_PARSE     0
00079 #define  OCI_NATIVE_BEHAVIOR        1  /* expect native behavior of the version you're connected to */
00080 #define  OCI_VERSION_7              2  /* expect behavior of Oracle version7 */
00081 
00082 /* Possible "indicator variable" values 
00083    ("indp" argument of obndrv,obndrn)
00084  **************************************/
00085 #define  OCI_VALID_DATA             0
00086 #define  OCI_NULL_DATA             -1
00087 
00088 /* Arguments for oexfet
00089  **********************/
00090 #define  CANCEL_CURSOR    1  /* cancel cursor (same as ocan) after fetch   */
00091 #define  KEEP_CURSOR      0  /* keep cursor active, do more fetches w/ofen */  
00092 
00093 /* Oracle return codes to check for on ofetch,oexfet,ofen
00094  ********************************************************/
00095 #define  OCI_SUCCESS           0   /* no errors                            */
00096 #define  OCI_NO_DATA_FOUND  1403   /* no more rows were selected           */
00097 #define  OCI_NULL_COLUMN    1405   /* null item retrieved for a column     */
00098 #define  OCI_TRUNCATED      1406   /* item fetched was truncated           */
00099 #define  OCI_INVALID_CONV   1454   /* invalid conversion requested         */
00100 #define  OCI_REALOVERFLOW   1456   /* item would overflow a floating-point */
00101                                    /* number on this machine               */
00102 #define  OCI_UNSUPPORTED    3115   /* unsupported datatype                 */
00103 
00104 /*  OCI function code labels,
00105  *  corresponding to the fc numbers
00106  *  in the cursor data area.
00107  **********************************/
00108 CONST text  *oci_func_tab[] =  {(text *) "not used",
00109 /* 1-2 */       (text *) "not used", (text *) "OSQL",
00110 /* 3-4 */       (text *) "not used", (text *) "OEXEC, OEXN",
00111 /* 5-6 */       (text *) "not used", (text *) "OBIND",
00112 /* 7-8 */       (text *) "not used", (text *) "ODEFIN",
00113 /* 9-10 */      (text *) "not used", (text *) "ODSRBN",
00114 /* 11-12 */     (text *) "not used", (text *) "OFETCH, OFEN",
00115 /* 13-14 */     (text *) "not used", (text *) "OOPEN",
00116 /* 15-16 */     (text *) "not used", (text *) "OCLOSE",
00117 /* 17-18 */     (text *) "not used", (text *) "not used",
00118 /* 19-20 */     (text *) "not used", (text *) "not used",
00119 /* 21-22 */     (text *) "not used", (text *) "ODSC",
00120 /* 23-24 */     (text *) "not used", (text *) "ONAME",
00121 /* 25-26 */     (text *) "not used", (text *) "OSQL3",
00122 /* 27-28 */     (text *) "not used", (text *) "OBNDRV",
00123 /* 29-30 */     (text *) "not used", (text *) "OBNDRN",
00124 /* 31-32 */     (text *) "not used", (text *) "not used",
00125 /* 33-34 */     (text *) "not used", (text *) "OOPT",
00126 /* 35-36 */     (text *) "not used", (text *) "not used",
00127 /* 37-38 */     (text *) "not used", (text *) "not used",
00128 /* 39-40 */     (text *) "not used", (text *) "not used",
00129 /* 41-42 */     (text *) "not used", (text *) "not used",
00130 /* 43-44 */     (text *) "not used", (text *) "not used",
00131 /* 45-46 */     (text *) "not used", (text *) "not used",
00132 /* 47-48 */     (text *) "not used", (text *) "not used",
00133 /* 49-50 */     (text *) "not used", (text *) "not used",
00134 /* 51-52 */     (text *) "not used", (text *) "OCAN",
00135 /* 53-54 */     (text *) "not used", (text *) "OPARSE",
00136 /* 55-56 */     (text *) "not used", (text *) "OEXFET",
00137 /* 57-58 */     (text *) "not used", (text *) "OFLNG",
00138 /* 59-60 */     (text *) "not used", (text *) "ODESCR",
00139 /* 61-62 */     (text *) "not used", (text *) "OBNDRA"
00140 };
00141 
00142 #endif  /* LOCALOCI_H */
00143 

Generated on Tue May 6 09:16:04 2003 for Earthworm Libs by doxygen1.3-rc3