📄 oracl.h
字号:
/* Copyright (c) Oracle Corporation 2000. All Rights Reserved */
/*
Please see the online help (oraclec.hlp)
for documentation of these classes.
*/
/*
Oracle Objects for OLE C++ Classes
This file is the header for the all classes. That is, all the
classes except OBound and OBinder (which use the obound.h header)
CREATED ******** 11/22/94
RWOOLARD MODIFIED 03/20/95
bug# 262914 *ErrorText should return const char *
262723 Added overloaded OParameter.Add(..., OValue)
PCHARI MODIFIED 03/19/98
bug# 624443 *NT 3.5.1 does not support CoInitializeEx
and so this fix to explicitly link with ole32.dll
MLAKSHMI MODIFIED 01/06/99
changed the OTYPE_ROWID value to 104 from 11
PCHARI MODIFIED 06/03/99
bug# 806756 Added critical section object
CSHAY MODIFIED 01/12/00
Oracle 8i support
*/
#ifndef ORACL_ORACLE
#define ORACL_ORACLE
// compiler specific defines
#ifdef WIN32
#define __huge
#define OHUGESP
#ifdef _MSC_VER
#ifdef OORACLMBUILD
#define OEXPORT __declspec(dllexport)
#else
#define OEXPORT __declspec(dllimport)
#endif
#endif // _MSC_VER
#ifdef __BORLANDC__
#define OEXPORT _export
#endif // __BORLANDC__
#else // WIN16
#define OEXPORT _export
#define OHUGESP
#endif //WIN32
#ifndef OEXPORT
#define OEXPORT
#define OHUGESP
#endif
#include "windows.h"
#ifdef WIN32
# ifdef ORAANSI
# include <ole2.h>
# include <winnls.h>
# endif
#else
# include <ole2.h>
# include <dispatch.h>
# ifdef _CID_MS15
# define OLECHAR char
# endif
#endif
// handy boolean type
typedef int oboolean;
// simple success return value
typedef int oresult;
// oresults can have one of the following values
#define OSUCCESS 0
#define OFAILURE 101
// error numbers returned by the ErrorNumber method.
// ----- error numbers
#define OERROR_NONE 0 // there isn't an error
#define OERROR_NOINTER 11 // we couldn't get a needed interface
#define OERROR_MEMORY 12 // memory allocation problem
#define OERROR_BADERR 13 // error in error handling (!)
#define OERROR_INVPARENT 14 // parent object on open is invalid (not open)
#define OERROR_SYSTEM 15 // some system error
#define OERROR_NOTOPEN 16 // attempt to use unopened object
#define OERROR_BADARG 17 // bad argument to routine
#define OERROR_INVRECORD 18 // the current record is invalid
#define OERROR_BADTYPE 19 // invalid operation on an Oracle data type
#define OERROR_ADVISEULINK 4096 // not an advisory connection
#define OERROR_DBCONNECT 4097 // connection not made
#define OERROR_POSITION 4098 // invalid database position
#define OERROR_NOFIELDNAME 4099 // field not found
#define OERROR_NOFIELDINDEX 4100 // invalid field index
#define OERROR_TRANSIP 4101 // transaction already in progress
#define OERROR_SCHEMAERR 4102 // error retreiving table definition
#define OERROR_ORLONERR 4103 // unable to make connection
#define OERROR_TRANSNIPC 4104 // commit when no transaction
#define OERROR_TRANSNIPR 4105 // rollback when no transaction
#define OERROR_NODSET 4106 // no such dynaset attached to connection
#define OERROR_INVROWNUM 4108 // invalid row reference
#define OERROR_TEMPFILE 4109 // error creating temporary file
#define OERROR_DUPSESSION 4110 // duplicate session name
#define OERROR_NOSESSION 4111 // no such session on detach
#define OERROR_NOOBJECTN 4112 // no object with specified name
#define OERROR_DUPCONN 4113 // duplicate connection
#define OERROR_NOCONN 4114 // no such connection on detach
#define OERROR_BFINDEX 4115 // invalid field index
#define OERROR_CURNREADY 4116 // cursor not ready
#define OERROR_NOUPDATES 4117 // updates not allowed
#define OERROR_NOTEDITING 4118 // not currently editing
#define OERROR_DATACHANGE 4119 // data has changed since last read
#define OERROR_NOBUFMEM 4120 // no memory for binding buffers
#define OERROR_INVBKMRK 4121 // invalid bookmark
#define OERROR_BNDVNOEN 4122 // bind variable not enabled
#define OERROR_DUPPARAM 4123 // duplicate parameter name
#define OERROR_INVARGVAL 4124 // invalid argument value
#define OERROR_INVFLDTYPE 4125 // invalid field type
#define OERROR_NOTIMPL 4126 // operation not implemented
#define OERROR_TRANSFORUP 4127 // For Update detected, no transaction
#define OERROR_NOTUPFORUP 4128 // For Update detected, not updatable
#define OERROR_TRANSLOCK 4129 // Commit/Rollback, but trans locked
#define OERROR_CACHEPARM 4130 // Invalid cache parameter
#define OERROR_FLDRQROWID 4131 // Field processing requires ROWID
#define OERROR_OUTOFMEMORY 4132 // Out of Memory
#define OERROR_POINTER 4133 // Invalid pointer
#define OERROR_INVNUMBER 4134 // Invalid number
#define OERROR_MAXSIZE 4135 // Maximum size execeeded.
#define OERROR_INVDIMENSION 4136 // Invalid Dimension
#define OERROR_MAXBUFFER 4137 // Maximum buffer exceeds 32512 bytes.
#define OERROR_ARRAYSIZ 4138 // Array elements not same size
// Find Methods parser errors
#define OERROR_STACK_OVER 4496 // Parser : Stack Overflow
#define OERROR_SYNTAX ERROR 4497 // Parser : Syntax Error near
#define OERROR_MISPLACED_PAREN 4498 // Parser : Misplaced parentheses
#define OERROR_MISPLACED_QUOTE 4499 // Parser : Misplaced quotation marks
#define OERROR_MISSING PAREN 4500 // Parser : WARNING - Missing closing Parenthesis
#define OERROR_EXPECTED_PAREN 4501 // Parser : Usually open parentheses expected
#define OERROR_PARSER_UNKNOWN 4502 // Parser : Unknown parser error condition
#define OERROR_INVALID_FUNCTION 4503// Parser : Syntax not supported
#define OERROR_INVALID_COLUMN 4504 // Parser : Invalid Column Name
#define OERROR_MAX_TOKEN 4505 // Parser : Maximum Token size exceeded
#define OERROR_PARSER_DATA_TYPE 4506// Parser : Unsupported data type
#define OERROR_UNEXPECTED_TOKEN 4507// Parser : Unexpected token found
#define OERROR_END_OF_CLAUSE 4508 // Parser : Unexpected end of clause
// Find Methods runtime errors
#define OERROR_INVALID_INSTR 4516 // Runtime : Internal Error : Invalid Instruction
#define OERROR_STACK_ERROR 4517 // Runtime : Internal Error : Stack over/under-flow
#define OERROR_CONVERT_TYPES 4518 // Runtime : Invalid type conversion
#define OERROR_RUNTIME_DATA_TYPE 4519 // Runtime : Invalid datatype
#define OERROR_INVALID_SQL_ARG 4520 // Runtime : SQL function missing argument"
#define OERROR_INVALID_COMPARE 4521 // Runtime : Invalid comparison
#define OERROR_SELECT_DUAL 4522 // Runtime : Select from dual failed
#define OERROR_DUAL_DATATYPE 4523 // Runtime : Invalid datatype in Select from dual
#define OERROR_ECURSOR 8192 // cannot create cursor
#define OERROR_FETCHERR 8193 // error fetching field
#define OERROR_BINDERR 8194 // output data binding error
#define OERROR_SQLERR 8195 // error in SQL statement
#define OERROR_ESQLEXEC 8196 // SQL execution error
#define OERROR_COMERR 8197 // error during commit
#define OERROR_ROLERR 8198 // error during rollback
#define OERROR_OPTERR 8299 // error setting options
#define OERROR_CONNERR 8200 // unable to make connection
#define OERROR_RDBMSVER 8201 // Database version not available
//object and ref errors
#define OERROR_NOOBJECT 4796 //Creating Oracle object instance in client side object cache failed
#define OERROR_OBINDERR 4797 //Binding Oracle object instance to the SQL statement failed
#define OERROR_NOATTRNAME 4798 //Getting attribute name of Oracle object instance failed
#define OERROR_NOATTRINDEX 4799 //Getting attribute index of Oracle object instance failed
#define OERROR_INVINPOBJECT 4801 //Invalid input object type for binding operation
#define OERROR_BAD_INDICATOR 4802 //Fetched Oracle Object instance comes with invalid indicator structure
#define OERROR_OBJINSTNULL 4803 //Operation on NULL Oracle object instance failed.
#define OERROR_REFNULL 4804 //Pin Operation on NULL Ref value failed.
//lob errors
#define OERROR_INVPOLLPARAMS 4896 //Invalid amount and chunksize specified for LOB read/write operation.
#define OERROR_INVSEEKPARAMS 4897 //Invalid seek value is specified for LOB read/write operation.
#define OERROR_LOBREAD 4898 //Read operation failed
#define OERROR_LOBWRITE 4899 //Write operation failure
#define OERROR_INVLOBLEN 4902 //Invalid buffer length for LOB write operation
#define OERROR_NOEDIT 4903 //Write,Trim ,Append,Copy operation is allowed outside the dynaset edit
#define OERROR_INVINPUTLOB 4904 //Invalid input LOB for bind operation
#define OERROR_NOEDITONCLONE 4905 //Write,Trim,Append,Copy is not allowed for clone LOB object
#define OERROR_LOBFILEOPEN 4906 //Specified file could not be opened in LOB operation
#define OERROR_LOBFILEIOERR 4907 //File Read or Write failed in LOB Operation.
#define OERROR_LOBNULL 4908 //Operation on NULL LOB has failed.
//aq errors
#define OERROR_AQCREATEERR 4996 //Error creating AQ object
#define OERROR_MSGCREATEERR 4997 //Error creating AQMsg object
#define OERROR_PAYLOADCREATEERR 4998//Error creating Payload object
#define OERROR_MAXAGENTS 4998 //Maximum number of subscribers exceeded.
#define OERROR_AGENTCREATEERR 5000 //Error creating AQ Agent
//collection errors
#define OERROR_COLLINSTNULL 5196 //Operation on NULL Oracle collection failed. See IsNull property on OraCollection
#define OERROR_NOELEMENT 5197 //Element does not exist for given index
#define OERROR_INVINDEX 5198 //Invalid collection index is specified
#define OERROR_NODELETE 5199 //Delete operation is not supported for VARRAY collection type
// server data types
#define OTYPE_VARCHAR2 1
#define OTYPE_NUMBER 2
#define OTYPE_SINT 3
#define OTYPE_FLOAT 4
#define OTYPE_STRING 5
#define OTYPE_LONG 8
#define OTYPE_VARCHAR 9
#define OTYPE_DATE 12
#define OTYPE_RAW 23
#define OTYPE_LONGRAW 24
#define OTYPE_UINT 68
#define OTYPE_LONGVARRAW 95
#define OTYPE_CHAR 96
#define OTYPE_CHARZ 97
#define OTYPE_CURSOR 102
#define OTYPE_ROWID 104
#define OTYPE_MSLABEL 106
#define OTYPE_OBJECT 108
#define OTYPE_REF 110
#define OTYPE_COLL 122
#define OTYPE_BLOB 113
#define OTYPE_CLOB 112
#define OTYPE_BFILE 114
#define OTYPE_VARRAY 247
#define OTYPE_TABLE 248
#define OTYPE_METADATA 999
//additional datatypes for object attributes
#define OTYPE_DECIMAL 7
#define OTYPE_REAL 21
#define OTYPE_DOUBLE 22
#define OTYPE_UNSIGNED8 23
#define OTYPE_RAW 23
#define OTYPE_UNSIGNED16 25
#define OTYPE_UNSIGNED32 26
#define OTYPE_SIGNED8 27
#define OTYPE_SIGNED16 28
#define OTYPE_SIGNED32 29
#define OTYPE_PTR 32
#define OTYPE_OPAQUE 58
#define OTYPE_UINT 68
#define OTYPE_LONGVARRAW 95
#define OTYPE_RSLT 116
#define OTYPE_SYSFIRST 228
#define OTYPE_SYSLAST 235
#define OTYPE_OCTET 245
#define OTYPE_SMALLINT 246
#define OTYPE_OTMLAST 320
// edit modes for dynaset
#define ODYNASET_EDIT_NOEDIT 0
#define ODYNASET_EDIT_EDITING 1
#define ODYNASET_EDIT_NEWRECORD 2
// parameter io types
#define OPARAMETER_INVAR 1
#define OPARAMETER_OUTVAR 2
#define OPARAMETER_INOUTVAR 3
// parameter status flags
#define OPARAMETER_STATUS_IN 1
#define OPARAMETER_STATUS_OUT 2
#define OPARAMETER_STATUS_AUTOENABLED 4
#define OPARAMETER_STATUS_ENABLED 8
// Options for creating database
#define ODATABASE_DEFAULT 0
#define ODATABASE_PARTIAL_INSERT 1
#define ODATABASE_ORAMODE 1 // Same as PARTIAL_INSERT
#define ODATABASE_EDIT_NOWAIT 2
#define ODATABASE_NO_REFETCH 4
#define ODATABASE_NONBLOCK 8
#define ODATABASE_ENLIST_IN_MTS 16
// Options for creating dynaset
#define ODYNASET_DEFAULT 0
#define ODYNASET_NOBIND 1
#define ODYNASET_KEEP_BLANKS 2
#define ODYNASET_READONLY 4
#define ODYNASET_NOCACHE 8
#define ODYNASET_PARTIAL_INSERT 16
#define ODYNASET_ORAMODE 16
#define ODYNASET_NO_REFETCH 32
#define ODYNASET_NO_MOVEFIRST 64
#define ODYNASET_DIRTY_WRITE 128
#define ODYNASET_VIEW_LONG 256
// Options for creating SqlStmt object
#define OSQLSTMT_DEFAULT 0
#define OSQLSTMT_NOBIND 1
#define OSQLSTMT_FAILEXEC 2
// Threading Model Options
#define OSTARTUP_MULTITHREADED 0
#define OSTARTUP_APARTMENTTHREADED 1
// definitions of actions used in the callback routines
#define OADVISE_MOVE_FIRST 1
#define OADVISE_MOVE_NEXT 2
#define OADVISE_MOVE_PREV 3
#define OADVISE_MOVE_LAST 4
#define OADVISE_FIND_FIRST 5
#define OADVISE_FIND_NEXT 6
#define OADVISE_FIND_PREV 7
#define OADVISE_FIND_LAST 8
#define OADVISE_DELETE 9
#define OADVISE_ADDNEW 10
#define OADVISE_REFRESH 11
#define OADVISE_MOVE_TOMARK 12
#define OADVISE_ROLLBACK 13
#define OADVISE_UPDATE 18
#define OADVISE_MOVE_NEXTN 20
#define OADVISE_MOVE_PREVN 21
#define OADVISE_MOVETO 22
#define OADVISE_FOUNDLAST 151
#define OADVISE_OTHER 99
//Lob
#define OLOB_ONE_PIECE 0
#define OLOB_FIRST_PIECE 1
#define OLOB_NEXT_PIECE 2
#define OLOB_LAST_PIECE 3
#define OLOB_SUCCESS 0
#define OLOB_NEED_DATA 99
//AQ
#define OAQ_BOTH 0
#define OAQ_ENQUEUE 1
#define OAQ_DEQUEUE 2
#define OAQ_ENQ_IMMEDIATE 1
#define OAQ_ENQ_ON_COMMIT 2
#define OAQ_NULL_MSGID 0
#define OAQ_DQ_BROWSE 1
#define OAQ_DQ_LOCKED 2
#define OAQ_DQ_REMOVE 3
#define OAQ_DQ_FIRST_MSG 1
#define OAQ_DQ_NEXT_TRANS 2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -