| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/drivers/Oracle/OCI/include/ocidef.h
Go to the documentation of this file.

    00001 /*
    00002  * $Header$ ocidef.h
    00003  */
    00004
    00005 /* Copyright (c) 1981, 2003, Oracle Corporation.  All rights reserved.  */
    00006 /* Copyright (c) 1984, 2003, Oracle Corporation.  All rights reserved.  */
    00007
    00008 /*
    00009 NAME
    00010   ocidef
    00011 CONTENTS
    00012   Oracle Call Interface cursor area and LDA definitions
    00013 NOTES
    00014   none
    00015 OWNER
    00016   Oates
    00017 DATE
    00018   09/07/82
    00019 MODIFIED
    00020     srseshad   03/25/03  - convert oci public api to ansi
    00021     csteinba   11/05/02  - bug 2521931: redefine OTYACL
    00022     aahluwal   06/03/02  - bug 2360115
    00023     bpalaval   02/08/01  - Change text to oratext.
    00024     chliang    02/01/01  - fix olint error.
    00025     bpalaval   11/16/00  - Bug 1244685 : Fix ALTER CLUSTER issue..
    00026     slari      11/08/00  - remove functions duplicated in ociapr.h
    00027     whe        09/01/99 -  976457:check __cplusplus for C++ code
    00028     skmishra   04/23/97 -  Provide C++ compatibility
    00029     lchidamb   06/26/96 -  put upidef.h, riddef.h within #ifndef
    00030     slari      06/12/96 -  add ocigft_getFcnType
    00031     dchatter   11/10/95 -  ocignfd - oci get native file descriptor
    00032     slari      05/11/95 -  change OCIEVDEF/OCIEVTSF to UPIEVDEF/UPIEVTSF
    00033     dchatter   04/06/95 -  add ifdef flags around OCI_flags
    00034     lchidamb   04/06/95 -  drop maxdsz from ocibndps/ocidfnps
    00035     slari      04/07/95 -  rename opinit to ocipin
    00036     slari      03/13/95 -  thread safety changes
    00037     dchatter   03/08/95 -  piece definitions OCI_*_PIECE
    00038     lchidamb   12/06/94 -  add support for binding/defining with skips
    00039     dchatter   03/06/95 -  merge changes from branch 1.12.720.1
    00040     dchatter   02/06/95 -  add defines for login mode parameters
    00041     dchatter   07/06/94 -  Deleting CRSCHK, with refcursor, no way to set this
    00042     dchatter   06/13/94 -  add a new LDA flag LDANBL
    00043     rkooi      11/18/92 -  update ocidpr interface
    00044     mmoore     10/31/92 -  add ocidpr
    00045     gpongrac   11/17/92 -  fix oexfet prototype
    00046     sjain      01/03/92 -  Add ocibra
    00047     rjenkins   11/04/91 -  adding prototypes for oparse and oexfet
    00048     sjain      04/15/91 -         Change ocistf proto
    00049     sjain      04/01/91 -         Rearrange oty codes. Add new ones
    00050     Jain       12/03/90 - Add #define for new describe call
    00051     Jain       11/29/90 - Add new function code for the new oci calls
    00052     Mendels    01/20/89 - fix 19170: make ocitbl CONST_DATA
    00053     Kabcene    01/27/88 - change interfaces to match V5
    00054     Navab      12/09/87 - add a parameter to ocierr call
    00055     Navab      11/30/87 - add ocierr, rename ocioer
    00056     Navab      10/08/87 - add prototypes for procedure declarations
    00057     Howard     09/07/87 - endif blah
    00058     Howard     05/11/87 - Add OTY types
    00059     Howard     04/27/87 - move ocldef defines here
    00060     Oates      10/15/85 - Add OCANCEL
    00061     Oates      09/30/85 - Implement ORA*Net
    00062     Oates      06/27/85 - Make datatype compatible with upidef.h
    00063     Andy       05/07/85 - delete CSRFBPIC
    00064 */
    00065
    00066 #ifndef UPIDEF
    00067 #include <upidef.h>
    00068 #endif
    00069
    00070 #ifndef RIDDEF
    00071 #include <riddef.h>
    00072 #endif
    00073
    00074 #include <ociapr.h>
    00075
    00076 #ifndef OCIDEF
    00077 #define OCIDEF
    00078
    00079
    00080 #define CSRCHECK 172                                   /* csrdef is a cursor */
    00081 #define LDACHECK 202                          /* csrdef is a login data area */
    00082 struct csrdef
    00083 {
    00084    b2      csrrc;                /* return code: v2 codes, v4 codes negative */
    00085    ub2     csrft;                                           /* function type */
    00086    ub4     csrrpc;                                   /* rows processed count */
    00087    ub2     csrpeo;                                     /* parse error offset */
    00088    ub1     csrfc;                                           /* function code */
    00089    ub1     csrlfl;                     /* lda flag to indicate type of login */
    00090    ub2     csrarc;                        /* actual untranslated return code */
    00091    ub1     csrwrn;                                          /* warning flags */
    00092    ub1     csrflg;                                           /* error action */
    00093    word    csrcn;                                           /* cursor number */
    00094    riddef  csrrid;                                        /* rowid structure */
    00095    word    csrose;                                /* os dependent error code */
    00096    ub1     csrchk;                      /* check byte = CSRCHECK - in cursor */
    00097                                         /* check byte = LDACHECK - in    LDA */
    00098    struct hstdef *csrhst;                              /* pointer to the hst */
    00099 };
    00100 typedef struct csrdef csrdef;
    00101 typedef struct csrdef ldadef;                    /* lda is the same as a csr */
    00102
    00103
    00104 /* values for csrlfl */
    00105 #define LDAFLG 1                                            /* ...via ologon */
    00106 #define LDAFLO 2                                     /* ...via olon or orlon */
    00107 #define LDANBL 3                                  /* ...nb logon in progress */
    00108
    00109 /* valuses for crsfc */
    00110 #define csrfpa 2                                                  /* ...OSQL */
    00111 #define csrfex 4                                                 /* ...OEXEC */
    00112 #define csrfbi 6                                                 /* ...OBIND */
    00113 #define csrfdb 8                                                /* ...ODFINN */
    00114 #define csrfdi 10                                               /* ...ODSRBN */
    00115 #define csrffe 12                                               /* ...OFETCH */
    00116 #define csrfop 14                                                /* ...OOPEN */
    00117 #define csrfcl 16                                               /* ...OCLOSE */
    00118 #define csrfds 22                                                 /* ...ODSC */
    00119 #define csrfnm 24                                                /* ...ONAME */
    00120 #define csrfp3 26                                                /* ...OSQL3 */
    00121 #define csrfbr 28                                               /* ...OBNDRV */
    00122 #define csrfbx 30                                               /* ...OBNDRN */
    00123 /*#defe csrfdf 32*/                                                  /* ???? */
    00124 #define csrfso 34                                                 /* ...OOPT */
    00125 #define csrfre 36                                               /* ...ORESUM */
    00126 #define csrfbn 50                                               /* ...OBINDN */
    00127 #define csrfca 52                                               /* ..OCANCEL */
    00128 #define csrfsd 54                                                 /* ..OSQLD */
    00129 #define csrfef 56                                                /* ..OEXFEN */
    00130 #define csrfln 58                                                 /* ..OFLNG */
    00131 #define csrfdp 60                                                /* ..ODSCSP */
    00132 #define csrfba 62                                                /* ..OBNDRA */
    00133 #define csrfbps 63                                               /*..OBINDPS */
    00134 #define csrfdps 64                                              /*..ODEFINPS */
    00135 #define csrfgpi 65                                              /* ...OGETPI */
    00136 #define csrfspi 66                                              /* ...OSETPI */
    00137
    00138 /* values for csrwrn */
    00139 #define CSRWANY  0x01                         /* there is a warning flag set */
    00140 #define CSRWTRUN 0x02                           /* a data item was truncated */
    00141 #define CSRWNVIC 0x04      /* NULL values were used in an aggregate function */
    00142 #define CSRWITCE 0x08           /* column count not equal to into list count */
    00143 #define CSRWUDNW 0x10               /* update or delete without where clause */
    00144 #define CSRWRSV0 0x20
    00145 #define CSRWROLL 0x40                                   /* rollback required */
    00146 #define CSRWRCHG 0x80       /* change after query start on select for update */
    00147
    00148 /* values fro csrflg */
    00149 #define CSRFSPND 0x01                         /* current operation suspended */
    00150 #define CSRFATAL 0x02            /* fatal operation: transaction rolled back */
    00151 #define CSRFBROW 0x04                              /* current row backed out */
    00152 #define CSRFREFC 0x08     /* ref cursor type CRSCHK disabled for this cursor */
    00153 #define CSRFNOAR 0x10     /* ref cursor type binds, so no array bind/execute */
    00154
    00155 /* define function codes; in order of octdef.h */
    00156 #define OTYCTB 1                                             /* CREATE TABLE */
    00157 #define OTYSER 2                                                 /* set role */
    00158 #define OTYINS 3                                                   /* INSERT */
    00159 #define OTYSEL 4                                                   /* SELECT */
    00160 #define OTYUPD 5                                                   /* UPDATE */
    00161 #define OTYDRO 6                                                /* drop role */
    00162 #define OTYDVW 7                                                /* DROP VIEW */
    00163                                                   /* once was validate index */
    00164                                                 /* once was create partition */
    00165                                                  /* once was alter partition */
    00166 #define OTYDTB 8                                               /* DROP TABLE */
    00167                                                      /* once was alter space */
    00168                                                       /* once was drop space */
    00169 #define OTYDEL 9                                                   /* DELETE */
    00170 #define OTYCVW 10                                             /* create view */
    00171 #define OTYDUS 11                                               /* drop user */
    00172 #define OTYCRO 12                                             /* create role */
    00173 #define OTYCSQ 13                                         /* create sequence */
    00174 #define OTYASQ 14                                          /* alter sequence */
    00175 #define OTYACL 15                                           /* alter cluster */
    00176 #define OTYDSQ 16                                           /* drop sequence */
    00177 #define OTYCSC 17                                           /* create schema */
    00178 #define OTYCCL 18                                          /* CREATE CLUSTER */
    00179                                                    /* once was alter cluster */
    00180 #define OTYCUS 19                                             /* create user */
    00181 #define OTYCIX 20                                            /* CREATE INDEX */
    00182 #define OTYDIX 21                                              /* DROP INDEX */
    00183 #define OTYDCL 22                                            /* DROP CLUSTER */
    00184 #define OTYVIX 23                                          /* validate index */
    00185 #define OTYCPR 24                                        /* create procedure */
    00186 #define OTYAPR 25                                         /* alter procedure */
    00187 #define OTYATB 26                                             /* alter table */
    00188                                                         /* once was evaluate */
    00189 #define OTYXPL 27                                                 /* explain */
    00190 #define OTYGRA 28                                                   /* grant */
    00191 #define OTYREV 29                                                  /* revoke */
    00192 #define OTYCSY 30                                          /* create synonym */
    00193 #define OTYDSY 31                                            /* drop synonym */
    00194 #define OTYASY 32                                 /* alter system switch log */
    00195 #define OTYSET 33                                         /* set transaction */
    00196 #define OTYPLS 34                                          /* pl/sql execute */
    00197 #define OTYLTB 35                                                    /* lock */
    00198 #define OTYNOP 36                                                    /* noop */
    00199 #define OTYRNM 37                                                  /* rename */
    00200 #define OTYCMT 38                                                 /* comment */
    00201 #define OTYAUD 39                                                   /* audit */
    00202 #define OTYNOA 40                                                /* no audit */
    00203 #define OTYAIX 41                                             /* ALTER INDEX */
    00204 #define OTYCED 42                                /* create external database */
    00205 #define OTYDED 43                                  /* drop external database */
    00206 #define OTYCDB 44                                         /* create database */
    00207 #define OTYADB 45                                          /* alter database */
    00208 #define OTYCRS 46                                 /* create rollback segment */
    00209 #define OTYARS 47                                  /* alter rollback segment */
    00210 #define OTYDRS 48                                   /* drop rollback segment */
    00211 #define OTYCTS 49                                       /* create tablespace */
    00212 #define OTYATS 50                                        /* alter tablespace */
    00213 #define OTYDTS 51                                         /* drop tablespace */
    00214 #define OTYASE 52                                           /* alter session */
    00215 #define OTYAUR 53                                              /* alter user */
    00216 #define OTYCWK 54                                           /* commit (work) */
    00217 #define OTYROL 55                                                /* rollback */
    00218 #define OTYSPT 56                                               /* savepoint */
    00219
    00220 /* For number greater than 56 the the type is the same as defined in
    00221 ** octdef.h for that number. So for completion look at octdef.h
    00222 */
    00223
    00224 #define OTYDEV OTYCVW                       /* old DEFINE VIEW = create view */
    00225
    00226 /* FUNCTION CODES */
    00227 #define OCLFPA  2                                            /* parse - OSQL */
    00228 #define OCLFEX  4                                         /* execute - OEXEC */
    00229 #define OCLFBI  6                                    /* BIND by name - OBIND */
    00230 #define OCLFDB  8                                 /* define buffer -  ODEFIN */
    00231 #define OCLFDI  10                                   /* describe item - ODSC */
    00232 #define OCLFFE  12                                         /* fetch - OFETCH */
    00233 #define OCLFOC  14                                    /* open cursor - OOPEN */
    00234 #       define OCLFLI  OCLFOC            /* old name for open cursor - OOPEN */
    00235 #define OCLFCC  16                                  /* close cursor - OCLOSE */
    00236 #       define OCLFLO  OCLFCC          /* old name for close cursor - OCLOSE */
    00237 #define OCLFDS  22                                        /* describe - ODSC */
    00238 #define OCLFON  24                     /* get table and column names - ONAME */
    00239 #define OCLFP3  26                                          /* parse - OSQL3 */
    00240 #define OCLFBR  28                        /* bind reference by name - OBNDRV */
    00241 #define OCLFBX  30                        /* bind referecne numeric - OBNDRN */
    00242 #define OCLFSO  34                                /* special function - OOPT */
    00243 #define OCLFRE  36                                        /* resume - ORESUM */
    00244 #define OCLFBN  50                                                  /* bindn */
    00245 #define OCLFMX  52                                /* maximum function number */
    00246
    00247 #ifdef NEVER                                                 /* unused codes */
    00248 # define OCLFLK  18                           /* open  for kernel operations */
    00249 # define OCLFEK  20                             /* execute kernel operations */
    00250 # define OCLFOK  22                                          /* kernel close */
    00251 # define OCLFIN  28                                       /* logon to oracle */
    00252 # define OCLFOF  30                                    /* logoff from oracle */
    00253 # define OCLFAX  32                               /* allocate a context area */
    00254 # define OCLFPI  34                                  /* page in context area */
    00255 # define OCLFIS  36                                  /* special system logon */
    00256 # define OCLFCO  38                          /* cancel the current operation */
    00257 # define OCLFGI  40                                       /* get database id */
    00258 # define OCLFJN  42                                     /* journal operation */
    00259 # define OCLFCL  44                       /* cleanup prior execute operation */
    00260 # define OCLFMC  46                                     /* map a cursor area */
    00261 # define OCLFUC  48                  /* unmap cursor and restore user maping */
    00262 #endif /*NEVER                                           *//* obsolete codes */
    00263
    00264
    00265 /* values for ocimode in ocipin call */
    00266
    00267 #define OCIEVDEF UPIEVDEF           /* default : non-thread safe enivronment */
    00268 #define OCIEVTSF UPIEVTSF                         /* thread-safe environment */
    00269
    00270
    00271 /* OCIL* flags used to determine the mode of login, using ocilog().
    00272 ** Currently defined only for non-blocking and thread-safe logins.
    00273 */
    00274
    00275 #define OCILMDEF        UPILMDEF                   /* default, regular login */
    00276 #define OCILMNBL        UPILMNBL                       /* non-blocking logon */
    00277 #define OCILMESY        UPILMESY            /* thread safe but external sync */
    00278 #define OCILMISY        UPILMISY                  /* internal sync, we do it */
    00279 #define OCILMTRY        UPILMTRY        /* try to, but do not block on mutex */
    00280
    00281
    00282 /*
    00283  * since sqllib uses both ocidef and ocidfn the following defines
    00284  * need to be guarded
    00285  */
    00286 #ifndef OCI_FLAGS
    00287 #define OCI_FLAGS
    00288
    00289 /* OCI_*_PIECE defines the piece types that are returned or set
    00290 */
    00291
    00292 #define OCI_ONE_PIECE   UPI_ONE_PIECE     /* there or this is the only piece */
    00293 #define OCI_FIRST_PIECE UPI_FIRST_PIECE          /* the first of many pieces */
    00294 #define OCI_NEXT_PIECE  UPI_NEXT_PIECE            /* the next of many pieces */
    00295 #define OCI_LAST_PIECE  UPI_LAST_PIECE      /* the last piece of this column */
    00296 #endif
    00297
    00298 /*
    00299 **  OCITAB: define return code pairs for version 2 to 3 conversions
    00300 */
    00301 struct  ocitab
    00302 {
    00303    b2   ocitv3;                                   /* Version 3/4 return code */
    00304    b2   ocitv2;                          /* Version 2 equivalent return code */
    00305 };
    00306 typedef struct ocitab ocitab;
    00307
    00308 externref CONST_DATA ocitab ocitbl[];
    00309
    00310 /* macros to check cursors and LDA's.  */
    00311 /* macros to set error codes           */
    00312
    00313 # define CRSCHK(c)     if ((c->csrchk != CSRCHECK)\
    00314                             && !bit(c->csrflg, CSRFREFC))\
    00315                           return(ocir32(c, OER(1001)))
    00316 # define ldaerr(l, e)  ( l->csrrc = (b2)(-( l->csrarc = (ub2)(e)) ) )
    00317 # define LDACHK(l)     if (l->csrchk != LDACHECK) \
    00318                           return(ldaerr(l, OER(1001)))
    00319
    00320
    00321 /************************************************/
    00322 /*         OCI PROCEDURE DECLARATIONS           */
    00323 /************************************************/
    00324
    00325
    00326
    00327
    00328 /*****************************/
    00329 /*  Database logon/logout    */
    00330 /*****************************/
    00331 sword ocilog( /*_ ldadef *lda, struct hstdef *hst, oratext *uid, sword uidl,
    00332                   oratext *psw, sword pswl, oratext* conn, sword connl,
    00333                   ub4 mode _*/);
    00334 sword ocilon( /*_ ldadef *lda, oratext *uid, word uidl, oratext *psw,
    00335                   word pswl, word audit _*/);
    00336 sword  ocilgi( /*_ ldadef *lda, b2 areacount _*/ );
    00337 sword ocirlo( /*_ ldadef *lda, struct hstdef *hst, oratext *uid, word uidl,
    00338             oratext *psw, word pswl, word audit _*/ );
    00339      /* ocilon - logon to oracle
    00340      ** ocilgi - version 2 compatible ORACLE logon call.
    00341      **          no login to ORACLE is performed: the LDA is initialized
    00342      ** ocirlo - version 5 compatible ORACLE Remote Login call,
    00343      **          oracle login is executed.
    00344      **   lda     - pointer to ldadef
    00345      **   uid     - user id [USER[/PASSWORD]]
    00346      **   uidl    - length of uid, if -1 strlen(uid) is used
    00347      **   psw     - password string; ignored if specified in uid
    00348      **   pswl    - length of psw, if -1 strlen(psw) is used
    00349      **   audit   - is not supported; the only permissible value is 0
    00350      **   areacount - unused
    00351      */
    00352
    00353 sword ocilof( /*_ ldadef *lda _*/ );
    00354      /*
    00355      ** ocilof - disconnect from ORACLE
    00356      **   lda     - pointer to ldadef
    00357      */
    00358
    00359
    00360 /*********************/
    00361 /*   Error Messages  */
    00362 /*********************/
    00363 sword ocierr( /*_ ldadef *lda, b2 rcode, oratext *buffer, word bufl _*/ );
    00364 sword ocidhe( /*_ b2 rcode, oratext *buffer _*/ );
    00365     /*
    00366     ** Move the text explanation for an ORACLE error to a user defined buffer
    00367     **  ocierr - will return the message associated with the hstdef stored
    00368     **           in the lda.
    00369     **  ocidhe - will return the message associated with the default host.
    00370     **    lda    - lda associated with the login session
    00371     **    rcode  - error code as returned by V3 call interface
    00372     **    buffer - address of a user buffer of at least 132 characters
    00373     */
    00374
    00375
    00376 /***********************/
    00377 /*  Cursor Open/Close  */
    00378 /***********************/
    00379 sword ociope( /*_ struct csrdef *cursor, ldadef *lda, oratext *dbn, word dbnl,
    00380                  word areasize, oratext *uid, word uidl _*/ );
    00381
    00382 sword ociclo( /*_ struct csrdef *cursor _*/ );
    00383    /*
    00384    ** open or close a cursor.
    00385    **   cursor - pointer to csrdef
    00386    **   ldadef - pointer to ldadef
    00387    **   dbn    - unused
    00388    **   dbnl   - unused
    00389    **   areasize - if (areasize == -1)  areasize <- system default initial size
    00390    **              else if (areasize IN [1..256]) areasize <- areasize * 1024;
    00391    **              most applications should use the default size since context
    00392    **              areas are extended as needed until memory is exhausted.
    00393    **   uid    - user id
    00394    **   uidl   - userid length
    00395    */
    00396
    00397 /***********************************/
    00398 /*      CONTROL AND OPTIONS        */
    00399 /***********************************/
    00400 sword ocibre( /*_ ldadef *lda _*/ );
    00401    /*
    00402    **  ocibrk - Oracle Call Interface send BReaK Sends a break to
    00403    **  oracle.  If oracle is  active,  the  current  operation  is
    00404    **  cancelled.  May be called  asynchronously.   DOES  NOT  SET
    00405    **  OERRCD in the hst.  This is because ocibrk  may  be  called
    00406    **  asynchronously.  Callers must test the return code.
    00407    **    lda  - pointer to a ldadef
    00408    */
    00409
    00410 sword ocican( /*_ struct csrdef *cursor _*/ );
    00411    /*
    00412    **  cancel the operation on the cursor, no additional OFETCH calls
    00413    **  will be issued for the existing cursor without an intervening
    00414    **  OEXEC call.
    00415    **   cursor  - pointer to csrdef
    00416    */
    00417
    00418 sword ocisfe( /*_ struct csrdef *cursor, word erropt, word waitopt _*/ );
    00419    /*
    00420    ** ocisfe - user interface set error options
    00421    ** set the error and cursor options.
    00422    ** allows user to set the options for dealing with fatal dml errors
    00423    ** and other cursor related options
    00424    ** see oerdef for valid settings
    00425    **   cursor  - pointer to csrdef
    00426    **   erropt  - error optionsn
    00427    **   waitopr - wait options
    00428    */
    00429
    00430
    00431 /***************************************/
    00432 /* COMMIT/ROLLBACK/AUTOCOMMIT          */
    00433 /***************************************/
    00434 sword   ocicom( /*_ ldadef *lda _*/ );
    00435 sword   ocirol( /*_ ldadef *lda _*/ );
    00436    /*
    00437    ** ocicom - commit the current transaction
    00438    ** ocirol - roll back the current transaction
    00439    */
    00440
    00441 sword   ocicon( /*_ ldadef *lda _*/ );
    00442 sword   ocicof( /*_ ldadef *lda _*/ );
    00443    /*
    00444    ** ocicon - auto Commit ON
    00445    ** ocicof - auto Commit OFf
    00446    */
    00447
    00448
    00449
    00450 /************************/
    00451 /*     parsing          */
    00452 /************************/
    00453 sword    ocisq3( /*_ struct csrdef *cursor, oratext *sqlstm, word sqllen _*/ );
    00454    /*
    00455    ** ocisq3 - user interface parse sql statement
    00456    **   cursor - pointer to csrdef
    00457    **   sqlstm - pointer to SQL statement
    00458    **   sqllen - length of SQL statement.  if -1, strlen(sqlstm) is used
    00459    */
    00460
    00461
    00462
    00463 /***************************/
    00464 /*      BINDING            */
    00465 /***************************/
    00466 /* these are for the opcode in ocibndps, ocidfnps */
    00467 #define OCI_PCWS 0
    00468 #define OCI_SKIP 1
    00469
    00470 sword ocibin( /*_ struct csrdef *cursor, oratext *sqlvar, word sqlvl,
    00471                   ub1 *progv, word progvl, word ftype, word scale,
    00472                   oratext *fmt, word fmtl, word fmtt _*/ );
    00473 sword  ocibrv( /*_ struct csrdef *cursor, oratext *sqlvar, word sqlvl,
    00474                    ub1 *progv, word progvl, word ftype, word scale, b2 *indp,
    00475                    oratext *fmt, word fmtl, word fmtt _*/ );
    00476 sword  ocibra( /*_ struct csrdef *cursor, oratext *sqlvar, word sqlvl,
    00477                    ub1 *progv, word progvl, word ftype, word scale,
    00478                    b2 *indp, ub2 *aln, ub2 *rcp, ub4 mal, ub4 *cal,
    00479                    oratext *fmt, word fmtl, word fmtt _*/ );
    00480 sword  ocibndps( /*_ struct csrdef *cursor, ub1 opcode, oratext *sqlvar,
    00481                      sb4 sqlvl, ub1 *progv, sb4 progvl, word ftype,
    00482                      word scale, b2 *indp, ub2 *aln, ub2 *rcp, sb4 pv_skip,
    00483                      sb4 ind_skip, sb4 len_skip, sb4 rc_skip, ub4 mal,
    00484                      ub4 *cal, oratext *fmt, sb4 fmtl, word fmtt _*/ );
    00485 sword ocibnn ( /*_ struct csrdef *cursor, ub2 sqlvn, ub1 *progv, word progvl,
    00486                    word ftype, word scale, oratext *fmt, word fmtl,
    00487                    word fmtt _*/ );
    00488 sword  ocibrn( /*_ struct csrdef *cursor, word sqlvn, ub1 *progv, word progvl,
    00489                   word ftype, word scale, b2 *indp, oratext *fmt, word fmtl,
    00490                   word fmtt _*/ );
    00491     /*
    00492     ** ocibin - bind by value by name
    00493     ** ocibrv - bind by reference by name
    00494     ** ocibra - bind by reference by name (array)
    00495     ** ocibndps - bind by reference by name (array) piecewise or with skips
    00496     ** ocibnn - bind by value numeric
    00497     ** ocibrn - bind by reference numeric
    00498     **
    00499     ** the contents of storage specified in bind-by-value calls are
    00500     ** evaluated immediately.
    00501     ** the addresses of storage specified in bind-by-reference calls are
    00502     ** remembered, and the contents are examined at every execute.
    00503     **
    00504     **  cursor  - pointer to csrdef
    00505     **  sqlvn   - the number represented by the name of the bind variables
    00506     **            for variables of the form :n or &n for n in [1..256)
    00507     **            (i.e. &1, :234).  unnecessarily using larger numbers
    00508     **            in the range wastes space.
    00509     **  sqlvar  - the name of the bind variable (:name or &name)
    00510     **  sqlval  - the length of the name;
    00511     **            in bindif -1, strlen(bvname) is used
    00512     **  progv   - pointer to the object to bind.
    00513     **  progvl  - length of object to bind.
    00514     **            in bind-by-value if specified as -1 then strlen(bfa) is
    00515     **              used (really only makes sends with character types)
    00516     **            in bind-by-value, if specified as -1 then UB2MAXVAL
    00517     **              is used.  Again this really makes sense only with
    00518     **              SQLT_STR.
    00519     **  ftype   - datatype of object
    00520     **  indp    - pointer to indicator variable.
    00521     **              -1     means to ignore bfa/bfl and bind NULL;
    00522     **              not -1 means to bind the contents of bfa/bfl
    00523     **              bind the contents pointed to by bfa
    00524     **  aln     - Alternate length pointer
    00525     **  rcp     - Return code pointer
    00526     **  mal     - Maximum array length
    00527     **  cal     - Current array length pointer
    00528     **  fmt     - format string
    00529     **  fmtl    - length of format string; if -1, strlen(fmt) is used
    00530     **  fmtt    - desired output type after applying forat mask. Not
    00531     **            really yet implemented
    00532     **  scale   - number of decimal digits in a cobol packed decimal (type 7)
    00533     **
    00534     ** Note that the length of bfa when bound as SQLT_STR is reduced
    00535     ** to strlen(bfa).
    00536     ** Note that trailing blanks are stripped of storage of SQLT_STR.
    00537     */
    00538
    00539 /***************************/
    00540 /*        DESCRIBING       */
    00541 /***************************/
    00542 sword ocidsc ( /*_ struct csrdef *cursor, word pos, b2 *dbsize, b2 *fsize,
    00543              b2 *rcode, b2 *dtype, b1 *buf, b2 *bufl, b2 *dsize _*/ );
    00544 sword ocidsr( /*_ struct csrdef *cursor, word pos, b2 *dbsize, b2 *dtype,
    00545             b2 *fsize _*/ );
    00546 sword   ocinam( /*_ struct csrdef *cursor, word pos, b1 *tbuf, b2 *tbufl,
    00547                 b1 *buf, b2 *bufl _*/);
    00548     /*
    00549     **  ocidsc, ocidsr: Obtain information about a column
    00550     **  ocinam : get the name of a column
    00551     **   cursor  - pointer to csrdef
    00552     **   pos     - position in select list from [1..N]
    00553     **   dbsize  - place to store the database size
    00554     **   fsize   - place to store the fetched size
    00555     **   rcode   - place to store the fetched column returned code
    00556     **   dtype   - place to store the data type
    00557     **   buf     - array to store the column name
    00558     **   bufl    - place to store the column name length
    00559     **   dsize   - maximum display size
    00560     **   tbuf    - place to store the table name
    00561     **   tbufl   - place to store the table name length
    00562     */
    00563
    00564 sword ocidsp ( /*_ struct csrdef *cursor, word pos, sb4 *dbsize, sb2 *dbtype,
    00565                    sb1 *cbuf, sb4 *cbufl, sb4 *dsize, sb2 *pre, sb2 *scl,
    00566                    sb2 *nul _*/);
    00567
    00568 sword ocidpr(/*_ ldadef *lda, oratext *object_name, size_t object_length,
    00569                 ptr_t reserved1, size_t reserved1_length, ptr_t reserved2,
    00570                 size_t reserved2_length, ub2 *overload, ub2 *position,
    00571                 ub2 *level, oratext **argument_name, ub2 *argument_length,
    00572                 ub2 *datatype, ub1 *default_supplied, ub1 *in_out,
    00573                 ub4 *length, sb2 *precision, sb2 *scale, ub1 *radix,
    00574                 ub4 *spare, ub4 *total_elements _*/);
    00575    /*
    00576    ** OCIDPR - User Program Interface: Describe Stored Procedure
    00577    **
    00578    ** This routine is used to obtain information about the calling
    00579    ** arguments of a stored procedure.  The client provides the
    00580    ** name of the procedure using "object_name" and "database_name"
    00581    ** (database name is optional).  The client also supplies the
    00582    ** arrays for OCIDPR to return the values and indicates the
    00583    ** length of array via the "total_elements" parameter.  Upon return
    00584    ** the number of elements used in the arrays is returned in the
    00585    ** "total_elements" parameter.  If the array is too small then
    00586    ** an error will be returned and the contents of the return arrays
    00587    ** are invalid.
    00588    **
    00589    **
    00590    **   EXAMPLE :
    00591    **
    00592    **   Client provides -
    00593    **
    00594    **   object_name    - SCOTT.ACCOUNT_UPDATE@BOSTON
    00595    **   total_elements - 100
    00596    **
    00597    **
    00598    **   ACCOUNT_UPDATE is an overloaded function with specification :
    00599    **
    00600    **     type number_table is table of number index by binary_integer;
    00601    **     table account (account_no number, person_id number,
    00602    **                    balance number(7,2))
    00603    **     table person  (person_id number(4), person_nm varchar2(10))
    00604    **
    00605    **      function ACCOUNT_UPDATE (account number,
    00606    **         person person%rowtype, amounts number_table,
    00607    **         trans_date date) return accounts.balance%type;
    00608    **
    00609    **      function ACCOUNT_UPDATE (account number,
    00610    **         person person%rowtype, amounts number_table,
    00611    **         trans_no number) return accounts.balance%type;
    00612    **
    00613    **
    00614    **   Values returned -
    00615    **
    00616    **   overload position   argument  level  datatype length prec scale rad
    00617    **   -------------------------------------------------------------------
    00618    **          0        0                0   NUMBER     22    7     2   10
    00619    **          0        1   ACCOUNT      0   NUMBER     22    0     0    0
    00620    **          0        2   PERSON       0   RECORD      0    0     0    0
    00621    **          0        2     PERSON_ID  1   NUMBER     22    4     0   10
    00622    **          0        2     PERSON_NM  1   VARCHAR2   10    0     0    0
    00623    **          0        3   AMOUNTS      0   TABLE       0    0     0    0
    00624    **          0        3                1   NUMBER     22    0     0    0
    00625    **          0        4   TRANS_NO     0   NUMBER     22    0     0    0
    00626    **
    00627    **          1        0                0   NUMBER     22    7     2   10
    00628    **          1        1   ACCOUNT      0   NUMBER     22    0     0    0
    00629    **          1        2   PERSON       0   RECORD      0    0     0    0
    00630    **          1        2    PERSON_ID   1   NUMBER     22    4     0   10
    00631    **          1        2    PERSON_NM   1   VARCHAR2   10    0     0    0
    00632    **          1        3   AMOUNTS      0   TABLE       0    0     0    0
    00633    **          1        3                1   NUMBER     22    0     0    0
    00634    **          1        4   TRANS_DATE   0   NUMBER     22    0     0    0
    00635    **
    00636    **
    00637    **  OCIDPR Argument Descriptions -
    00638    **
    00639    **  ldadef           - pointer to ldadef
    00640    **  object_name      - object name, synonyms are also accepted and will
    00641    **                     be translate, currently only procedure and function
    00642    **                     names are accepted, also NLS names are accepted.
    00643    **                     Currently, the accepted format of a name is
    00644    **                     [[part1.]part2.]part3[@dblink] (required)
    00645    **  object_length    - object name length (required)
    00646    **  reserved1        - reserved for future use
    00647    **  reserved1_length - reserved for future use
    00648    **  reserved2        - reserved for future use
    00649    **  reserved2_length - reserved for future use
    00650    **  overload         - array indicating overloaded procedure # (returned)
    00651    **  position         - array of argument positions, position 0 is a
    00652    **                     function return argument (returned)
    00653    **  level            - array of argument type levels, used to describe
    00654    **                     sub-datatypes of data structures like records
    00655    **                     and arrays (returned)
    00656    **  argument_name    - array of argument names, only returns first
    00657    **                     30 characters of argument names, note storage
    00658    **                     for 30 characters is allocated by client (returned)
    00659    **  argument_length  - array of argument name lengths (returned)
    00660    **  datatype         - array of oracle datatypes (returned)
    00661    **  default_supplied - array indicating parameter has default (returned)
    00662    **                     0 = no default, 1 = default supplied
    00663    **  in_out           - array indicating if argument is IN or OUT (returned
    00664    **                     0 = IN param, 1 = OUT param, 2 = IN/OUT param
    00665    **  length           - array of argument lengths (returned)
    00666    **  precision        - array of precisions (if number type)(returned)
    00667    **  scale            - array of scales (if number type)(returned)
    00668    **  radix            - array of radix (if number type)(returned)
    00669    **  spare            - array of spares.
    00670    **  total_elements   - size of arrays supplied by client (required),
    00671    **                     total number of elements filled (returned)
    00672    */
    00673
    00674 /*************************************/
    00675 /* DEFINING                          */
    00676 /*************************************/
    00677 sword ocidfi( /*_ struct csrdef *cursor, word pos, ub1 *buf, word bufl,
    00678                   word ftype, b2 *rc, word scale _*/ );
    00679 sword ocidfn( /*_ struct csrdef *cursor, word pos, ub1 *buf, word bufl,
    00680                  word ftype, word scale, b2 *indp, oratext *fmt, word fmtl,
    00681                  word fmtt, ub2 *rl, ub2 *rc _*/ );
    00682 sword ocidfnps( /*_ struct csrdef *cursor, ub1 opcode, word pos, ub1 *buf,
    00683                     sb4 bufl, word ftype, word scale,
    00684                     b2 *indp, oratext *fmt, sb4 fmtl,
    00685                     word fmtt, ub2 *rl, ub2 *rc,
    00686                     sb4 pv_skip, sb4 ind_skip, sb4 len_skip,
    00687                     sb4 rc_skip _*/ );
    00688
    00689
    00690    /*  Define a user data buffer using upidfn
    00691    **   cursor  - pointer to csrdef
    00692    **   pos     - position of a field or exp in the select list of a query
    00693    **   bfa/bfl - address and length of client-supplied storage
    00694                   to receive data
    00695    **   ftype   - user datatype
    00696    **   scale   - number of fractional digits for cobol packed decimals
    00697    **   indp    - place to store the length of the returned value. If returned
    00698    **             value is:
    00699    **             negative, the field fetched was NULL
    00700    **             zero    , the field fetched was same length or shorter than
    00701    **               the buffer provided
    00702    **             positive, the field fetched was truncated
    00703    **   fmt    - format string
    00704    **   fmtl   - length of format string, if -1 strlent(fmt) used
    00705    **   rl     - place to store column length after each fetch
    00706    **   rc     - place to store column error code after each fetch
    00707    **   fmtt   - fomat type
    00708    */
    00709
    00710 /********************************/
    00711 /*    PIECE INFORMATION GET/SET */
    00712 /********************************/
    00713 sword           ocigetpi( /*_ struct csrdef *cursor, ub1 *piecep,
    00714                               dvoid **ctxpp, ub4 *iterp, ub4 *indexp _*/ );
    00715 sword           ocisetpi( /*_ struct csrdef *cursor, ub1 piece,
    00716                               dvoid *bufp, ub4 *lenp _*/ );
    00717
    00718
    00719 /********************************/
    00720 /*   EXECUTE                    */
    00721 /********************************/
    00722 sword ociexe( /*_ struct csrdef *cursor _*/ );
    00723 sword ociexn( /*_ struct csrdef *cursor, word iters, word roff _*/ );
    00724 sword ociefn( /*_ struct csrdef *cursor, ub4 nrows, word can, word exact _*/);
    00725     /*
    00726     ** ociexe  - execute a cursor
    00727     ** ociexn  - execute a cursosr N times
    00728     **  cursor   - pointer to a csrdef
    00729     **  iters    - number of times to execute cursor
    00730     **  roff     - offset within the bind variable array at which to begin
    00731     **             operations.
    00732     */
    00733
    00734
    00735 /*********************************/
    00736 /*     FETCHING                  */
    00737 /*********************************/
    00738 sword ocifet( /*_ struct csrdef *cursor _*/ );
    00739 sword ocifen( /*_ struct csrdef *cursor, word nrows _*/ );
    00740     /* ocifet - fetch the next row
    00741     ** ocifen - fetch n rows
    00742     ** cursor   - pointer to csrdef
    00743     ** nrows    - number of rows to be fetched
    00744     */
    00745
    00746 sword ocilng(/*_ struct csrdef *cursor, word posit, ub1 *bfa, sb4 bfl,
    00747                  word dty, ub4 *rln, sb4 off _*/);
    00748
    00749 /*********************************/
    00750 /*         CONVERSION            */
    00751 /*********************************/
    00752 sword ocic32( /*_ struct csrdef *cursor _*/ );
    00753     /*
    00754     **   Convert selected version 3 return codes to the equivalent
    00755     **   version 2 code.
    00756     **   csrdef->csrrc is set to the converted code
    00757     **   csrdef->csrft is set to v2 oracle statment type
    00758     **   csrdef->csrrpc is set to the rows processed count
    00759     **   csrdef->csrpeo is set to error postion
    00760     **
    00761     **     cursor - pointer to csrdef
    00762     */
    00763
    00764
    00765 sword ocir32( /*_ struct csrdef *cursor, word retcode _*/ );
    00766    /*
    00767    ** Convert selected version 3 return codes to the equivalent version 2
    00768    ** code.
    00769    **
    00770    **    cursor - pointer to csrdef
    00771    **    retcode - place to store the return code
    00772    */
    00773
    00774
    00775 VOID ociscn( /*_ word **arglst, char *mask_addr, word **newlst _*/ );
    00776    /*
    00777    ** Convert call-by-ref to call-by-value:
    00778    ** takes an arg list and a mask address, determines which args need
    00779    ** conversion to a value, and creates a new list begging at the address
    00780    ** of newlst.
    00781    **
    00782    **    arglst    - list of arguments
    00783    **    mast_addr _ mask address determines args needing conversion
    00784    **    newlst    - new list of args
    00785    */
    00786
    00787 word     ocistf ( /*_ word typ, word bufl, word rdig, oratext *fmt,
    00788                       struct csrdef *cursor, sword *err _*/ );
    00789 /*  Convert a packed  decimal buffer  length  (bytes) and scale to a format
    00790 **  string of the form mm.+/-nn, where  mm is the number of packed
    00791 **  decimal digits, and nn is the scaling factor.   A positive scale name
    00792 **  nn digits to the rights of the decimal; a negative scale means nn zeros
    00793 **  should be supplied to the left of the decimal.
    00794 **     bufl   - length of the packed decimal buffer
    00795 **     rdig   - number of fractional digits
    00796 **     fmt    - pointer to a string holding the conversion format
    00797 **     cursor - pointer to csrdef
    00798 **     err    - pointer to word storing error code
    00799 */
    00800
    00801
    00802 /******************************************/
    00803 /*         Non-blocking operations        */
    00804 /******************************************/
    00805 sword ocinbs( /*_ ldadef *lda _*/ );  /* set a connection to non-blocking   */
    00806 sword ocinbt( /*_ ldadef *lda _*/ );  /* test if connection is non-blocking */
    00807 sword ocinbc( /*_ ldadef *lda _*/ );  /* clear a connection to blocking     */
    00808 sword ocinlo( /*_ ldadef *lda, struct hstdef *hst, oratext *conn,
    00809                   sword connl, oratext *uid, sword uidl,
    00810                   oratext *psw, sword pswl, sword audit _*/ );
    00811               /* logon in non-blocking fashion */
    00812 /* ocinlo allows an application to logon in non-blocking fashion.
    00813 **   lda     - pointer to ldadef
    00814 **   hst     - pointer to a 256 byte area, must be cleared to zero before call
    00815 **   conn    - the database link (if specified @LINK in uid will be ignored)
    00816 **   connl   - length of conn; if -1 strlen(conn) is used
    00817 **   uid     - user id [USER[/PASSWORD][@LINK]]
    00818 **   uidl    - length of uid, if -1 strlen(uid) is used
    00819 **   psw     - password string; ignored if specified in uid
    00820 **   pswl    - length of psw, if -1 strlen(psw) is used
    00821 **   audit   - is not supported; the only permissible value is 0
    00822 */
    00823
    00824 /***************************************************/
    00825 /*         Procedure Declaration for Pro*C         */
    00826 /***************************************************/
    00827 /* Note: The following routines are used in Pro*C and have the
    00828    same interface as their couterpart in OCI.
    00829    Althought the interface follows for more details please refer
    00830    to the above routines */
    00831
    00832 /******************************************/
    00833 /*         initialization/logon/logof     */
    00834 /******************************************/
    00835 sword ocipin( /*_ ub4 mode _*/ );
    00836
    00837 sword ologin( /*_ ldadef *lda, b2 areacount _*/ );
    00838 sword ologon( /*_ ldadef *lda, b2 areacount _*/ );
    00839
    00840 /*****************************************/
    00841 /*        Open/Close/Parse Cursor        */
    00842 /*****************************************/
    00843
    00844 /*
    00845 ** ocisqd - oci delayed parse (Should be used only with deferred upi/oci)
    00846 ** FUNCTION: Call upidpr to delay the parse of the sql statement till the
    00847 **           time that a call needs to be made to the kernel (execution or
    00848 **           describe time )
    00849 ** RETURNS: Oracle return code.
    00850 */
    00851 sword ocisq7(/*_ struct csrdef *cursor, oratext *sqlstm, sb4 sqllen,
    00852                  word defflg, ub4 sqlt _*/);
    00853
    00854 /*****************************************/
    00855 /*            Bind                       */
    00856 /*****************************************/
    00857 sword obind( /*_ struct csrdef *cursor, oratext *sqlvar, word sqlvl,
    00858                  ub1 *progv, word progvl, word ftype, word scale,
    00859                  oratext *fmt, word fmtl, word fmtt _*/ );
    00860 sword obindn( /*_ struct csrdef *cursor, ub2 sqlvn, ub1 *progv, word progvl,
    00861                   word ftype, word scale, oratext *fmt, word fmtl,
    00862                   word fmtt _*/ );
    00863
    00864 /**********************************************/
    00865 /*                 Define                     */
    00866 /**********************************************/
    00867 sword odfinn( /*_ struct csrdef *cursor, word pos, ub1 *buf, word bufl,
    00868                   word ftype, b2 *rc, word scale _*/ );
    00869
    00870 /**********************************************/
    00871 /*                 Describe                   */
    00872 /**********************************************/
    00873 sword odsrbn( /*_ struct csrdef *cursor, word pos, b2 *dbsize, b2 *dtype,
    00874             b2 *fsize _*/ );
    00875
    00876
    00877 /******************************************/
    00878 /*         Non-blocking operations        */
    00879 /******************************************/
    00880 sword onblon( /*_ ldadef *lda, struct hstdef *hst, oratext *conn,
    00881                   sword connl, oratext *uid, sword uidl,
    00882                   oratext *psw, sword pswl, sword audit _*/ );
    00883               /* logon in non-blocking fashion */
    00884 sword ocignfd( /*_ ldadef *lda, dvoid *nfdp _*/);           /* get native fd */
    00885
    00886 ub2   ocigft_getFcnType( /*_ ub2 oertyp _*/ );      /* get sql function code */
    00887
    00888 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines