⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ocidef.h

📁 SQLAPI C/C++ 连接Oracle 数据库!
💻 H
📖 第 1 页 / 共 3 页
字号:
 */#ifndef OCI_FLAGS #define OCI_FLAGS/* OCI_*_PIECE defines the piece types that are returned or set*/#define OCI_ONE_PIECE   UPI_ONE_PIECE     /* there or this is the only piece */#define OCI_FIRST_PIECE UPI_FIRST_PIECE          /* the first of many pieces */#define OCI_NEXT_PIECE  UPI_NEXT_PIECE            /* the next of many pieces */#define OCI_LAST_PIECE  UPI_LAST_PIECE      /* the last piece of this column */#endif/***  OCITAB: define return code pairs for version 2 to 3 conversions*/struct	ocitab{   b2	ocitv3; 				  /* Version 3/4 return code */   b2	ocitv2; 			 /* Version 2 equivalent return code */};typedef struct ocitab ocitab; externref CONST_DATA ocitab ocitbl[]; /* macros to check cursors and LDA's.  *//* macros to set error codes	       */# define CRSCHK(c)     if ((c->csrchk != CSRCHECK)\                            && !bit(c->csrflg, CSRFREFC))\			  return(ocir32(c, OER(1001)))# define ldaerr(l, e)  ( l->csrrc = (b2)(-( l->csrarc = (ub2)(e)) ) )# define LDACHK(l)     if (l->csrchk != LDACHECK) \			  return(ldaerr(l, OER(1001))) /************************************************//*     	   OCI PROCEDURE DECLARATIONS  	        *//************************************************/ /*****************************//*  Database logon/logout    *//*****************************/sword ocilog( /*_ ldadef *lda, struct hstdef *hst, oratext *uid, sword uidl,                   oratext *psw, sword pswl, oratext* conn, sword connl,                  ub4 mode _*/);sword ocilon( /*_ ldadef *lda, oratext *uid, word uidl, oratext *psw, word pswl,                  word audit _*/);sword  ocilgi( /*_ ldadef *lda, b2 areacount _*/ );sword ocirlo( /*_ ldadef *lda, struct hstdef *hst, oratext *uid, word uidl,	    oratext *psw, word pswl, word audit _*/ );     /* ocilon - logon to oracle     ** ocilgi - version 2 compatible ORACLE logon call.     **          no login to ORACLE is performed: the LDA is initialized     ** ocirlo - version 5 compatible ORACLE Remote Login call,     **          oracle login is executed.     **	  lda     - pointer to ldadef     **	  uid	  - user id [USER[/PASSWORD]]     **	  uidl	  - length of uid, if -1 strlen(uid) is used     **   psw	  - password string; ignored if specified in uid     **   pswl	  - length of psw, if -1 strlen(psw) is used     **   audit   - is not supported; the only permissible value is 0     **   areacount - unused     */sword ocilof( /*_ ldadef *lda _*/ );     /*     ** ocilof - disconnect from ORACLE     **	  lda     - pointer to ldadef     *//*********************//*   Error Messages  *//*********************/sword ocierr( /*_ ldadef *lda, b2 rcode, oratext *buffer, word bufl _*/ );sword ocidhe( /*_ b2 rcode, oratext *buffer _*/ );    /*     ** Move the text explanation for an ORACLE error to a user defined buffer    **  ocierr - will return the message associated with the hstdef stored     **           in the lda.    **  ocidhe - will return the message associated with the default host.    **    lda    - lda associated with the login session    **    rcode  - error code as returned by V3 call interface    **	  buffer - address of a user buffer of at least 132 characters    *//***********************//*  Cursor Open/Close  *//***********************/sword ociope( /*_ struct csrdef *cursor, ldadef *lda, oratext *dbn, word dbnl,                  word areasize, oratext *uid, word uidl _*/ );sword ociclo( /*_ struct csrdef *cursor _*/ );   /*    ** open or close a cursor.   **   cursor - pointer to csrdef   **	ldadef - pointer to ldadef   **   dbn    - unused   **	dbnl   - unused   **   areasize - if (areasize == -1)	areasize <- system default initial size   **              else if (areasize IN [1..256]) areasize <- areasize * 1024;   **              most applications should use the default size since context   **              areas are extended as needed until memory is exhausted.   **   uid    - user id   **   uidl   - userid length   *//***********************************//*	CONTROL AND OPTIONS	   *//***********************************/sword ocibre( /*_ ldadef *lda _*/ );   /*   **  ocibrk - Oracle Call Interface send BReaK Sends a break to   **  oracle.  If oracle is  active,  the  current  operation  is   **  cancelled.  May be called  asynchronously.   DOES  NOT  SET   **  OERRCD in the hst.  This is because ocibrk  may  be  called   **  asynchronously.  Callers must test the return code.   **    lda  - pointer to a ldadef    */sword ocican( /*_ struct csrdef *cursor _*/ );   /*   **  cancel the operation on the cursor, no additional OFETCH calls   **  will be issued for the existing cursor without an intervening    **  OEXEC call.   **   cursor  - pointer to csrdef   */sword ocisfe( /*_ struct csrdef *cursor, word erropt, word waitopt _*/ );   /*    ** ocisfe - user interface set error options   ** set the error and cursor options.   ** allows user to set the options for dealing with fatal dml errors   ** and other cursor related options   ** see oerdef for valid settings   **   cursor  - pointer to csrdef   **	erropt  - error optionsn   **   waitopr - wait options   *//***************************************//* COMMIT/ROLLBACK/AUTOCOMMIT	       *//***************************************/sword   ocicom( /*_ ldadef *lda _*/ );sword   ocirol( /*_ ldadef *lda _*/ );   /*   ** ocicom - commit the current transaction   ** ocirol - roll back the current transaction   */ sword   ocicon( /*_ ldadef *lda _*/ );sword   ocicof( /*_ ldadef *lda _*/ );   /*   ** ocicon - auto Commit ON   ** ocicof - auto Commit OFf   */ /************************//*     parsing		*//************************/sword	 ocisq3( /*_ struct csrdef *cursor, oratext *sqlstm, word sqllen _*/ );   /*   ** ocisq3 - user interface parse sql statement   **	cursor - pointer to csrdef   **	sqlstm - pointer to SQL statement   **	sqllen - length of SQL statement.  if -1, strlen(sqlstm) is used   *//***************************//*	BINDING 	   *//***************************//* these are for the opcode in ocibndps, ocidfnps */#define OCI_PCWS 0#define OCI_SKIP 1sword ocibin( /*_ struct csrdef *cursor, oratext *sqlvar, word sqlvl, ub1 *progv,	   word progvl, word ftype, word scale, oratext *fmt, word fmtl,	   word fmtt _*/ );sword  ocibrv( /*_ struct csrdef *cursor, oratext *sqlvar, word sqlvl, ub1 *progv,  	         word progvl, word ftype, word scale, b2 *indp, oratext *fmt,		 word fmtl, word fmtt _*/ );sword  ocibra( /*_ struct csrdef *cursor, oratext *sqlvar, word sqlvl, ub1 *progv,  	         word progvl, word ftype, word scale, b2 *indp, ub2 *aln,                 ub2 *rcp, ub4 mal, ub4 *cal, oratext *fmt,		 word fmtl, word fmtt _*/ );sword  ocibndps( /*_ struct csrdef *cursor, ub1 opcode, oratext *sqlvar, sb4 sqlvl, 		   ub1 *progv, sb4 progvl, word ftype, word scale, b2 *indp, 		   ub2 *aln, ub2 *rcp, 		   sb4 pv_skip, sb4 ind_skip, sb4 len_skip, sb4 rc_skip,		   ub4 mal, ub4 *cal, oratext *fmt, sb4 fmtl, word fmtt _*/ );sword ocibnn ( /*_ struct csrdef *cursor, ub2 sqlvn, ub1 *progv, word progvl,             word ftype, word scale, oratext *fmt, word fmtl, word fmtt _*/ );sword  ocibrn( /*_ struct csrdef *cursor, word sqlvn, ub1 *progv, word progvl,                  word ftype, word scale, b2 *indp, oratext *fmt, word fmtl, 		  word fmtt _*/ );    /*    ** ocibin - bind by value by name    ** ocibrv - bind by reference by name    ** ocibra - bind by reference by name (array)    ** ocibndps - bind by reference by name (array) piecewise or with skips    ** ocibnn - bind by value numeric    ** ocibrn - bind by reference numeric    **    ** the contents of storage specified in bind-by-value calls are    ** evaluated immediately.    ** the addresses of storage specified in bind-by-reference calls are    ** remembered, and the contents are examined at every execute.    **    **  cursor	- pointer to csrdef    **  sqlvn	- the number represented by the name of the bind variables    **		  for variables of the form :n or &n for n in [1..256)    **		  (i.e. &1, :234).  unnecessarily using larger numbers    **		  in the range wastes space.    **  sqlvar	- the name of the bind variable (:name or &name)    **  sqlval	- the length of the name;    **		  in bindif -1, strlen(bvname) is used    **  progv	- pointer to the object to bind.    **  progvl	- length of object to bind.    **		  in bind-by-value if specified as -1 then strlen(bfa) is    **		    used (really only makes sends with character types)    **		  in bind-by-value, if specified as -1 then UB2MAXVAL    **		    is used.  Again this really makes sense only with    **		    SQLT_STR.    **  ftype	- datatype of object    **  indp	- pointer to indicator variable.    **		    -1	   means to ignore bfa/bfl and bind NULL;    **		    not -1 means to bind the contents of bfa/bfl    **		    bind the contents pointed to by bfa    **  aln     - Alternate length pointer    **  rcp     - Return code pointer    **  mal     - Maximum array length    **  cal     - Current array length pointer    **  fmt	- format string    **  fmtl	- length of format string; if -1, strlen(fmt) is used    **  fmtt	- desired output type after applying forat mask. Not    **		  really yet implemented    **  scale   - number of decimal digits in a cobol packed decimal (type 7)    **    ** Note that the length of bfa when bound as SQLT_STR is reduced    ** to strlen(bfa).    ** Note that trailing blanks are stripped of storage of SQLT_STR.    */    /***************************//*        DESCRIBING       *//***************************/sword ocidsc ( /*_ struct csrdef *cursor, word pos, b2 *dbsize, b2 *fsize,             b2 *rcode, b2 *dtype, b1 *buf, b2 *bufl, b2 *dsize _*/ );sword ocidsr( /*_ struct csrdef *cursor, word pos, b2 *dbsize, b2 *dtype, 	    b2 *fsize _*/ );sword	ocinam( /*_ struct csrdef *cursor, word pos, b1 *tbuf, b2 *tbufl,	        b1 *buf, b2 *bufl _*/);    /*    **  ocidsc, ocidsr: Obtain information about a column    **  ocinam : get the name of a column    **   cursor	 - pointer to csrdef    **	 pos	 - position in select list from [1..N]    **   dbsize	 - place to store the database size    **   fsize   - place to store the fetched size    **   rcode   - place to store the fetched column returned code    **   dtype   - place to store the data type    **   buf     - array to store the column name    **   bufl    - place to store the column name length    **   dsize   - maximum display size    **	 tbuf	 - place to store the table name    **	 tbufl	 - place to store the table name length    */sword ocidsp ( /*_ struct csrdef *cursor, word pos, sb4 *dbsize, sb2 *dbtype,                   sb1 *cbuf, sb4 *cbufl, sb4 *dsize, sb2 *pre, sb2 *scl,                   sb2 *nul _*/);sword ocidpr(/*_ ldadef *lda, oratext *object_name, size_t object_length,                ptr_t reserved1, size_t reserved1_length, ptr_t reserved2,                size_t reserved2_length, ub2 *overload, ub2 *position,                ub2 *level, oratext **argument_name, ub2 *argument_length,                 ub2 *datatype, ub1 *default_supplied, ub1 *in_out,                 ub4 *length, sb2 *precision, sb2 *scale, ub1 *radix,                 ub4 *spare, ub4 *total_elements _*/);   /*   ** OCIDPR - User Program Interface: Describe Stored Procedure   **   ** This routine is used to obtain information about the calling   ** arguments of a stored procedure.  The client provides the    ** name of the procedure using "object_name" and "database_name"   ** (database name is optional).  The client also supplies the    ** arrays for OCIDPR to return the values and indicates the    ** length of array via the "total_elements" parameter.  Upon return   ** the number of elements used in the arrays is returned in the    ** "total_elements" parameter.  If the array is too small then    ** an error will be returned and the contents of the return arrays 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -