29 #ifndef OCILIBCPP_H_INCLUDED 30 #define OCILIBCPP_H_INCLUDED 160 typedef std::basic_string<otext, std::char_traits<otext>, std::allocator<otext> >
ostring;
178 typedef std::vector<unsigned char>
Raw;
220 #include "ocilib_core.hpp" 236 Oracle9iR1 = OCI_9_0,
237 Oracle9iR2 = OCI_9_2,
238 Oracle10gR1 = OCI_10_1,
239 Oracle10gR2 = OCI_10_2,
240 Oracle11gR1 = OCI_11_1,
241 Oracle11gR2 = OCI_11_2,
242 Oracle12cR1 = OCI_12_1,
243 Oracle18cR1 = OCI_18_1,
244 Oracle18cR2 = OCI_18_2,
245 Oracle18cR3 = OCI_18_3
460 LobBinary = OCI_BLOB,
462 LobCharacter = OCI_CLOB,
464 LobNationalCharacter = OCI_NCLOB
484 LongBinary = OCI_BLONG,
486 LongCharacter = OCI_CLONG
537 friend T
Check(T result);
621 unsigned int GetRow()
const;
631 const char *
what()
const throw() override;
679 SourceInstance = OCI_HES_INSTANCE,
681 SourceDatabase = OCI_HES_DATABASE,
683 SourceNode = OCI_HES_NODE,
685 SourceService = OCI_HES_SERVICE,
687 SourceServiceMember = OCI_HES_SERVICE_MEMBER,
689 SourceASMInstance = OCI_HES_ASM_INSTANCE,
691 SourcePreConnect = OCI_HES_PRECONNECT
711 EventDown = OCI_HET_DOWN,
733 Default = OCI_ENV_DEFAULT,
735 Threaded = OCI_ENV_THREADED,
737 Events = OCI_ENV_EVENTS
757 ImportLinkage = OCI_IMPORT_MODE_LINKAGE,
759 ImportRuntime = OCI_IMPORT_MODE_RUNTIME
779 CharsetAnsi = OCI_CHAR_ANSI,
781 CharsetWide = OCI_CHAR_WIDE
801 SessionDefault = OCI_SESSION_DEFAULT,
803 SessionXa = OCI_SESSION_XA,
805 SessionSysDba = OCI_SESSION_SYSDBA,
807 SessionSysOper = OCI_SESSION_SYSOPER,
809 SessionSysAsm = OCI_SESSION_SYSASM,
811 SessionSysBkp = OCI_SESSION_SYSBKP,
813 SessionSysDgD = OCI_SESSION_SYSDGD,
815 SessionSysKmt = OCI_SESSION_SYSKMT,
817 SessionSysRac = OCI_SESSION_SYSRAC,
819 SessionPreAuth = OCI_SESSION_PRELIM_AUTH
839 StartOnly = OCI_DB_SPM_START,
841 StartMount = OCI_DB_SPM_MOUNT,
843 StartOpen = OCI_DB_SPM_OPEN,
845 StartFull = OCI_DB_SPM_FULL
865 StartDefault = OCI_DB_SPF_DEFAULT,
867 StartForce = OCI_DB_SPF_FORCE,
869 StartRestrict = OCI_DB_SPF_RESTRICT
889 ShutdownOnly = OCI_DB_SDM_SHUTDOWN,
891 ShutdownClose = OCI_DB_SDM_CLOSE,
893 ShutdownDismount = OCI_DB_SDM_DISMOUNT,
895 ShutdownFull = OCI_DB_SDM_FULL
916 ShutdowntDefault = OCI_DB_SDF_DEFAULT,
919 ShutdowTrans = OCI_DB_SDF_TRANS,
923 ShutdownTransLocal = OCI_DB_SDF_TRANS_LOCAL,
926 ShutdownImmediate = OCI_DB_SDF_IMMEDIATE,
932 ShutdownAbort = OCI_DB_SDF_ABORT
952 OracleClientBytes = OCI_MEM_ORACLE,
954 OcilibBytes = OCI_MEM_OCILIB,
956 AllBytes = OCI_MEM_ALL
975 typedef void(*HAHandlerProc) (
Connection &con, HAEventSource eventSource, HAEventType eventType,
Timestamp &time);
1010 static void Cleanup();
1045 static unsigned int GetCharMaxSize();
1054 static big_uint GetAllocatedBytes(AllocatedBytesFlags type);
1061 static bool Initialized();
1073 static OracleVersion GetCompileVersion();
1080 static unsigned int GetCompileMajorVersion();
1087 static unsigned int GetCompileMinorVersion();
1094 static unsigned int GetCompileRevisionVersion();
1105 static OracleVersion GetRuntimeVersion();
1112 static unsigned int GetRuntimeMajorVersion();
1119 static unsigned int GetRuntimeMinorVersion();
1126 static unsigned int GetRuntimeRevisionVersion();
1138 static void EnableWarnings(
bool value);
1171 static bool SetFormat(FormatType formatType,
const ostring& format);
1183 static ostring GetFormat(FormatType formatType);
1215 const ostring& spfile = OTEXT(
""));
1275 static void SetHAHandler(HAHandlerProc handler);
1281 friend class Environment;
1285 static unsigned int TAFHandler(
OCI_Connection *pConnection,
unsigned int type,
unsigned int event);
1286 static void NotifyHandler(
OCI_Event *pEvent);
1287 static void NotifyHandlerAQ(
OCI_Dequeue *pDequeue);
1293 static void SetUserCallback(
AnyPointer ptr, T callback);
1296 static void SetSmartHandle(
AnyPointer ptr, T handle);
1301 static Handle * GetEnvironmentHandle();
1303 static Environment& GetInstance();
1307 void SelfInitialize(EnvironmentFlags mode,
const ostring& libpath);
1311 EnvironmentHandle _handle;
1312 ConcurrentMap<AnyPointer, Handle *> _handles;
1313 ConcurrentMap<AnyPointer, CallbackPointer> _callbacks;
1314 EnvironmentFlags _mode;
1315 unsigned int _charMaxSize;
1369 static void Run(
ThreadHandle handle, ThreadProc func,
void *args);
1478 static void Create(
const ostring& name, ThreadKeyFreeProc freeProc =
nullptr);
1522 ConnectionPool = OCI_POOL_CONNECTION,
1524 SessionPool = OCI_POOL_SESSION
1561 unsigned int minSize,
unsigned int maxSize,
unsigned int increment = 1,
1583 unsigned int minSize,
unsigned int maxSize,
unsigned int increment = 1,
1634 unsigned int GetTimeout()
const;
1649 void SetTimeout(
unsigned int value);
1660 bool GetNoWait()
const;
1674 void SetNoWait(
bool value);
1681 unsigned int GetBusyConnectionsCount()
const;
1688 unsigned int GetOpenedConnectionsCount()
const;
1695 unsigned int GetMinSize()
const;
1702 unsigned int GetMaxSize()
const;
1709 unsigned int GetIncrement()
const;
1719 unsigned int GetStatementCacheSize()
const;
1728 void SetStatementCacheSize(
unsigned int value);
1740 friend class Environment;
1741 friend class Exception;
1752 template<
class,
int>
1769 TimeoutSend = OCI_NTO_SEND,
1774 TimeoutReceive = OCI_NTO_RECEIVE,
1779 TimeoutCall = OCI_NTO_CALL
1799 FailoverRequestSession = OCI_FOT_SESSION,
1801 FailoverRequestSelect = OCI_FOT_SELECT
1821 FailoverEventEnd = OCI_FOE_END,
1823 FailoverEventAbort = OCI_FOE_ABORT,
1825 FailoverEventReauthentificate = OCI_FOE_REAUTH,
1827 FailoverEventBegin = OCI_FOE_BEGIN,
1829 FailoverEventError = OCI_FOE_ERROR
1849 FailoverOk = OCI_FOC_OK,
1851 FailoverRetry = OCI_FOC_RETRY
1871 TraceIdentity = OCI_TRC_IDENTITY,
1873 TraceModule = OCI_TRC_MODULE,
1875 TraceAction = OCI_TRC_ACTION,
1877 TraceDetail = OCI_TRC_DETAIL
1896 typedef FailoverResult(*TAFHandlerProc) (
Connection &con, FailoverRequest failoverRequest, FailoverEvent failoverEvent);
2002 void SetAutoCommit(
bool enabled);
2009 bool GetAutoCommit()
const;
2019 bool IsServerAlive()
const;
2029 bool PingServer()
const;
2039 ostring GetConnectionString()
const;
2069 ostring GetServerVersion()
const;
2079 OracleVersion GetVersion()
const;
2086 unsigned int GetServerMajorVersion()
const;
2093 unsigned int GetServerMinorVersion()
const;
2100 unsigned int GetServerRevisionVersion()
const;
2109 void ChangePassword(
const ostring& newPwd);
2116 ostring GetSessionTag()
const;
2132 void SetSessionTag(
const ostring& tag);
2154 void SetTransaction(
const Transaction &transaction);
2187 bool SetFormat(FormatType formatType,
const ostring& format);
2199 ostring GetFormat(FormatType formatType);
2220 void EnableServerOutput(
unsigned int bufsize,
unsigned int arrsize,
unsigned int lnsize);
2230 void DisableServerOutput();
2240 bool GetServerOutput(
ostring &line)
const;
2247 void GetServerOutput(std::vector<ostring> &lines)
const;
2277 void SetTrace(SessionTrace trace,
const ostring& value);
2289 ostring GetTrace(SessionTrace trace)
const;
2362 unsigned int GetStatementCacheSize()
const;
2374 void SetStatementCacheSize(
unsigned int value);
2392 unsigned int GetDefaultLobPrefetchSize()
const;
2418 void SetDefaultLobPrefetchSize(
unsigned int value);
2434 unsigned int GetMaxCursors()
const;
2444 bool IsTAFCapable()
const;
2459 void SetTAFHandler(TAFHandlerProc handler);
2490 unsigned int GetTimeout(TimeoutType timeout);
2519 void SetTimeout(TimeoutType timeout,
unsigned int value);
2546 Unknown = OCI_UNKNOWN,
2550 Tight = OCI_TRS_TIGHT,
2552 Loose = OCI_TRS_LOOSE,
2558 Serializable = OCI_TRS_SERIALIZABLE
2628 TransactionFlags GetFlags()
const;
2635 unsigned int GetTimeout()
const;
2656 friend class BindArray;
2670 Number(
bool create =
false);
2686 Number(
const otext* str,
const otext* format = OTEXT(
""));
2718 void FromString(
const ostring& str,
const ostring& format = OTEXT(
""))
const;
2740 ostring ToString()
const override;
2751 Number operator ++ (
int);
2752 Number operator -- (
int);
2754 bool operator == (
const Number& other)
const;
2755 bool operator != (
const Number& other)
const;
2756 bool operator > (
const Number& other)
const;
2757 bool operator < (
const Number& other)
const;
2758 bool operator >= (
const Number& other)
const;
2759 bool operator <= (
const Number& other)
const;
2762 Number& operator = (
const T &lhs);
2768 Number operator - (
const T &value);
2771 Number operator + (
const T &value);
2774 Number operator * (
const T &value);
2777 Number operator / (
const T &value);
2780 Number& operator += (
const T &value);
2783 Number& operator -= (
const T &value);
2786 Number& operator *= (
const T &value);
2789 Number& operator /= (
const T &value);
2797 int Compare(
const Number& other)
const;
2800 inline T GetValue()
const;
2803 Number& SetValue(
const T &value);
2806 void Add(
const T &value);
2809 void Sub(
const T &value);
2812 void Multiply(
const T &value);
2815 void Divide(
const T &value);
2831 friend class BindArray;
2844 static Date SysDate();
2853 Date(
bool create =
false);
2869 Date(
const otext* str,
const otext* format = OTEXT(
""));
2893 bool IsValid()
const;
2900 int GetYear()
const;
2907 void SetYear(
int value);
2914 int GetMonth()
const;
2921 void SetMonth(
int value);
2935 void SetDay(
int value);
2942 int GetHours()
const;
2949 void SetHours(
int value);
2956 int GetMinutes()
const;
2963 void SetMinutes(
int value);
2970 int GetSeconds()
const;
2977 void SetSeconds(
int value);
2986 int DaysBetween(
const Date& other)
const;
2997 void SetDate(
int year,
int month,
int day);
3008 void SetTime(
int hour,
int min,
int sec);
3022 void SetDateTime(
int year,
int month,
int day,
int hour,
int min,
int sec);
3033 void GetDate(
int &year,
int &month,
int &day)
const;
3044 void GetTime(
int &hour,
int &min,
int &sec)
const;
3058 void GetDateTime(
int &year,
int &month,
int &day,
int &hour,
int &min,
int &sec)
const;
3067 void AddDays(
int days);
3076 void AddMonths(
int months);
3092 Date LastDay()
const;
3118 void FromString(
const ostring& str,
const ostring& format = OTEXT(
""));
3140 ostring ToString()
const override;
3154 Date& operator ++ ();
3161 Date operator ++ (
int);
3168 Date& operator -- ();
3175 Date operator -- (
int);
3182 Date operator + (
int value)
const;
3189 Date operator - (
int value)
const;
3196 Date& operator += (
int value);
3203 Date& operator -= (
int value);
3210 bool operator == (
const Date& other)
const;
3217 bool operator != (
const Date& other)
const;
3224 bool operator > (
const Date& other)
const;
3231 bool operator < (
const Date& other)
const;
3238 bool operator >= (
const Date& other)
const;
3245 bool operator <= (
const Date& other)
const;
3249 int Compare(
const Date& other)
const;
3265 friend class Environment;
3268 friend class BindArray;
3283 YearMonth = OCI_INTERVAL_YM,
3285 DaySecond = OCI_INTERVAL_DS
3338 bool IsValid()
const;
3348 int GetYear()
const;
3358 void SetYear(
int value);
3368 int GetMonth()
const;
3378 void SetMonth(
int value);
3398 void SetDay(
int value);
3408 int GetHours()
const;
3418 void SetHours(
int value);
3428 int GetMinutes()
const;
3438 void SetMinutes(
int value);
3448 int GetSeconds()
const;
3458 void SetSeconds(
int value);
3465 int GetMilliSeconds()
const;
3472 void SetMilliSeconds(
int value);
3488 void GetDaySecond(
int &day,
int &hour,
int &min,
int &sec,
int &fsec)
const;
3504 void SetDaySecond(
int day,
int hour,
int min,
int sec,
int fsec);
3517 void GetYearMonth(
int &year,
int &month)
const;
3530 void SetYearMonth(
int year,
int month);
3539 void UpdateTimeZone(
const ostring& timeZone);
3551 void FromString(
const ostring& data);
3561 ostring ToString(
int leadingPrecision,
int fractionPrecision)
const;
3568 ostring ToString()
const override;
3610 bool operator == (
const Interval& other)
const;
3617 bool operator != (
const Interval& other)
const;
3624 bool operator > (
const Interval& other)
const;
3631 bool operator < (
const Interval& other)
const;
3638 bool operator >= (
const Interval& other)
const;
3645 bool operator <= (
const Interval& other)
const;
3649 int Compare(
const Interval& other)
const;
3664 friend class Environment;
3667 friend class BindArray;
3683 NoTimeZone = OCI_TIMESTAMP,
3685 WithTimeZone = OCI_TIMESTAMP_TZ,
3687 WithLocalTimeZone = OCI_TIMESTAMP_LTZ
3706 static Timestamp SysTimestamp(TimestampType type = NoTimeZone);
3743 TimestampType
GetType()
const;
3759 bool IsValid()
const;
3766 int GetYear()
const;
3773 void SetYear(
int value);
3780 int GetMonth()
const;
3787 void SetMonth(
int value);
3801 void SetDay(
int value);
3808 int GetHours()
const;
3815 void SetHours(
int value);
3822 int GetMinutes()
const;
3829 void SetMinutes(
int value);
3836 int GetSeconds()
const;
3843 void SetSeconds(
int value);
3850 int GetMilliSeconds()
const;
3857 void SetMilliSeconds(
int value);
3868 void GetDate(
int &year,
int &month,
int &day)
const;
3880 void GetTime(
int &hour,
int &min,
int &sec,
int &fsec)
const;
3891 void SetDate(
int year,
int month,
int day);
3903 void SetTime(
int hour,
int min,
int sec,
int fsec);
3918 void GetDateTime(
int &year,
int &month,
int &day,
int &hour,
int &min,
int &sec,
int &fsec)
const;
3934 void SetDateTime(
int year,
int month,
int day,
int hour,
int min,
int sec,
int fsec,
const ostring& timeZone = OTEXT(
""));
3955 void SetTimeZone(
const ostring& timeZone);
3965 void GetTimeZoneOffset(
int &hour,
int &min)
const;
3992 void FromString(
const ostring& data,
const ostring& format = OCI_STRING_FORMAT_DATE);
4012 ostring ToString()
const override;
4117 bool operator == (
const Timestamp& other)
const;
4124 bool operator != (
const Timestamp& other)
const;
4131 bool operator > (
const Timestamp& other)
const;
4138 bool operator < (
const Timestamp& other)
const;
4145 bool operator >= (
const Timestamp& other)
const;
4152 bool operator <= (
const Timestamp& other)
const;
4156 int Compare(
const Timestamp& other)
const;
4168 template<
class T,
int U>
4173 friend class BindArray;
4209 T Read(
unsigned int length);
4221 unsigned int Write(
const T &content);
4233 unsigned int Append(
const T& content);
4242 void Append(
const Lob& other);
4258 bool Seek(SeekMode seekMode, big_uint offset);
4272 big_uint GetOffset()
const;
4279 big_uint GetLength()
const;
4286 big_uint GetMaxSize()
const;
4299 big_uint GetChunkSize()
const;
4315 void Truncate(big_uint length);
4332 big_uint Erase(big_uint offset, big_uint length);
4347 void Copy(
Lob &dest, big_uint offset, big_uint offsetDest, big_uint length)
const;
4354 bool IsTemporary()
const;
4361 bool IsRemote()
const;
4375 void Open(OpenMode mode);
4412 void EnableBuffering(
bool value);
4426 Lob& operator += (
const Lob& other);
4433 bool operator == (
const Lob& other)
const;
4440 bool operator != (
const Lob& other)
const;
4444 bool Equals(
const Lob &other)
const;
4446 Lob(
OCI_Lob *pLob, Handle *parent =
nullptr);
4495 friend class BindArray;
4547 Raw Read(
unsigned int size);
4563 bool Seek(SeekMode seekMode, big_uint offset);
4573 bool Exists()
const;
4580 big_uint GetOffset()
const;
4587 big_uint GetLength()
const;
4643 bool IsOpened()
const;
4657 bool operator == (
const File& other)
const;
4664 bool operator != (
const File& other)
const;
4668 bool Equals(
const File &other)
const;
4697 Table = OCI_TIF_TABLE,
4699 View = OCI_TIF_VIEW,
4757 unsigned int GetColumnCount()
const;
4773 Column GetColumn(
unsigned int index)
const;
4787 boolean IsFinalType()
const;
4821 friend class BindArray;
4837 Persistent = OCI_OBJ_PERSISTENT,
4839 Transient = OCI_OBJ_TRANSIENT,
4841 Value = OCI_OBJ_VALUE
4876 bool IsAttributeNull(
const ostring& name)
const;
4885 void SetAttributeNull(
const ostring& name);
4921 T Get(
const ostring& name)
const;
4937 void Get(
const ostring& name, T &value)
const;
4969 void Set(
const ostring& name,
const T &value);
5001 friend class BindArray;
5039 Object GetObject()
const;
5046 bool IsReferenceNull()
const;
5056 void SetReferenceNull();
5070 ostring ToString()
const override;
5093 typedef T ValueType;
5101 bool IsNull()
const;
5106 CollectionType* _coll;
5125 typedef typename T::ValueType value_type;
5128 typedef std::random_access_iterator_tag iterator_category;
5129 typedef ptrdiff_t difference_type;
5130 typedef ptrdiff_t distance_type;
5131 typedef value_type* pointer;
5132 typedef value_type& reference;
5181 friend class BindArray;
5198 Varray = OCI_COLL_VARRAY,
5200 NestedTable = OCI_COLL_NESTED_TABLE,
5202 IndexedTable = OCI_COLL_INDEXED_TABLE
5235 CollectionType
GetType()
const;
5242 unsigned int GetMax()
const;
5249 unsigned int GetSize()
const;
5261 unsigned int GetCount()
const;
5270 void Truncate(
unsigned int size);
5290 bool IsElementNull(
unsigned int index)
const;
5302 void SetElementNull(
unsigned int index);
5321 bool Delete(
unsigned int index)
const;
5330 T Get(
unsigned int index)
const;
5340 void Set(
unsigned int index,
const T &value);
5350 void Append(
const T &data);
5371 ostring ToString()
const override;
5399 const_iterator begin()
const;
5413 const_iterator end()
const;
5431 static T GetElem(
OCI_Elem *elem, Handle *parent);
5433 static void SetElem(
OCI_Elem *elem,
const T &value);
5445 template<
class T,
int U>
5450 friend class BindArray;
5480 unsigned int Write(
const T& content);
5487 unsigned int GetLength()
const;
5494 T GetContent()
const;
5526 InOut = OCI_BDM_IN_OUT
5593 unsigned int GetSubType()
const;
5604 unsigned int GetDataCount()
const;
5633 void SetDataNull(
bool value,
unsigned int index = 1);
5649 bool IsDataNull(
unsigned int index = 1)
const;
5664 void SetCharsetForm(CharsetForm value);
5671 BindDirection GetDirection()
const;
5687 friend class Exception;
5689 template<
class,
int>
5692 friend class BindObject;
5704 TypeSelect = OCI_CST_SELECT,
5706 TypeUpdate = OCI_CST_UPDATE,
5708 TypeDelete = OCI_CST_DELETE,
5710 TypeInsert = OCI_CST_INSERT,
5712 TypeCreate = OCI_CST_CREATE,
5714 TypeDrop = OCI_CST_DROP,
5716 TypeAlter = OCI_CST_ALTER,
5718 TypeBegin = OCI_CST_BEGIN,
5720 TypeDeclare = OCI_CST_DECLARE,
5722 TypeCall = OCI_CST_CALL,
5724 TypeMerge = OCI_CST_MERGE
5744 FetchForward = OCI_SFM_DEFAULT,
5746 FetchScrollable = OCI_SFM_SCROLLABLE
5766 BindByPosition = OCI_BIND_BY_POS,
5768 BindByName = OCI_BIND_BY_NAME
5788 LongExplicit = OCI_LONG_EXPLICIT,
5790 LongImplicit = OCI_LONG_IMPLICIT
5854 void Describe(
const ostring& sql);
5879 void Parse(
const ostring& sql);
5891 void Prepare(
const ostring& sql);
5898 void ExecutePrepared();
5907 void Execute(
const ostring& sql);
5927 unsigned int ExecutePrepared(T callback);
5949 template<
class T,
class U>
5950 unsigned int ExecutePrepared(T callback, U adapter);
5971 unsigned int Execute(
const ostring& sql, T callback);
5994 template<
class T,
class U>
5995 unsigned int Execute(
const ostring& sql, T callback, U adapter);
6011 unsigned int GetAffectedRows()
const;
6025 ostring GetSqlIdentifier()
const;
6087 void SetBindArraySize(
unsigned int size);
6094 unsigned int GetBindArraySize()
const;
6111 void AllowRebinding(
bool value);
6121 bool IsRebindingAllowed()
const;
6139 unsigned int GetBindIndex(
const ostring& name)
const;
6146 unsigned int GetBindCount()
const;
6162 BindInfo GetBind(
unsigned int index)
const;
6219 template<
class T,
class U>
6321 template<
class T,
class U>
6345 void Register(
const ostring& name);
6364 template<
class T,
class U>
6365 void Register(
const ostring& name, U& extraInfo);
6385 template<
class T,
class U>
6386 void Register(
const ostring& name, U extraInfo);
6393 StatementType GetStatementType()
const;
6404 unsigned int GetSqlErrorPos()
const;
6416 void SetFetchMode(FetchMode value);
6426 FetchMode GetFetchMode()
const;
6435 void SetBindMode(BindMode value);
6445 BindMode GetBindMode()
const;
6454 void SetFetchSize(
unsigned int value);
6464 unsigned int GetFetchSize()
const;
6476 void SetPrefetchSize(
unsigned int value);
6486 unsigned int GetPrefetchSize()
const;
6506 void SetPrefetchMemory(
unsigned int value);
6516 unsigned int GetPrefetchMemory()
const;
6525 void SetLongMaxSize(
unsigned int value);
6535 unsigned int GetLongMaxSize()
const;
6547 void SetLongMode(LongMode value);
6554 LongMode GetLongMode()
const;
6568 unsigned int GetSQLCommand()
const;
6589 void GetBatchErrors(std::vector<Exception> &exceptions);
6593 static bool IsResultsetHandle(Handle *handle);
6594 static void OnFreeSmartHandle(SmartHandle *smartHandle);
6598 BindsHolder *GetBindsHolder(
bool allocate)
const;
6600 void ReleaseResultsets()
const;
6604 void SetInData()
const;
6605 void SetOutData()
const;
6606 void ClearBinds()
const;
6608 template<
typename M,
class T>
6611 template<
typename M,
class T>
6614 template<
typename M,
class T>
6617 template<
typename M,
class T,
class U>
6623 template<
typename T>
6624 unsigned int Fetch(T callback);
6626 template<
typename T,
typename U>
6627 unsigned int Fetch(T callback, U adapter);
6650 SeekAbsolute = OCI_SFD_ABSOLUTE,
6652 SeekRelative = OCI_SFD_RELATIVE
6677 T Get(
unsigned int index)
const;
6693 void Get(
unsigned int index, T &value)
const;
6708 T Get(
const ostring& name)
const;
6721 void Get(
const ostring &name, T &value)
const;
6737 template<
class T,
class U>
6738 bool Get(T& value, U adapter)
const;
6755 template<
typename T>
6756 unsigned int ForEach(T callback);
6780 template<
typename T,
typename U>
6781 unsigned int ForEach(T callback, U adapter);
6859 bool Seek(SeekMode mode,
int offset);
6866 unsigned int GetCount()
const;
6878 unsigned int GetCurrentRow()
const;
6893 unsigned int GetColumnIndex(
const ostring& name)
const;
6900 unsigned int GetColumnCount()
const;
6912 Column GetColumn(
unsigned int index)
const;
6936 bool IsColumnNull(
unsigned int index)
const;
6945 bool IsColumnNull(
const ostring& name)
const;
6959 bool operator ++ (
int);
6966 bool operator -- (
int);
6974 bool operator += (
int offset);
6982 bool operator -= (
int offset);
7011 NoFlags = OCI_CPF_NONE,
7014 IsIdentity = OCI_CPF_IS_IDENTITY,
7018 IsGeneratedAlways = OCI_CPF_IS_GEN_ALWAYS,
7021 IsGeneratedByDefaultOnNull = OCI_CPF_IS_GEN_BY_DEFAULT_ON_NULL,
7023 IsLogicalPartitioning = OCI_CPF_IS_LPART,
7025 IsGeneratedByContainers = OCI_CPF_IS_CONID
7063 ostring GetFullSQLType()
const;
7089 unsigned int GetSubType()
const;
7096 CharsetForm GetCharsetForm()
const;
7103 CollationID GetCollationID()
const;
7114 unsigned int GetSize()
const;
7121 int GetScale()
const;
7128 int GetPrecision()
const;
7135 int GetFractionalPrecision()
const;
7142 int GetLeadingPrecision()
const;
7154 PropertyFlags GetPropertyFlags()
const;
7161 bool IsNullable()
const;
7172 bool IsCharSemanticUsed()
const;
7213 typedef void (*NotifyHandlerProc) (
Event &evt);
7223 ObjectChanges = OCI_CNT_OBJECTS,
7225 RowChanges = OCI_CNT_ROWS,
7227 DatabaseChanges = OCI_CNT_DATABASES,
7229 AllChanges = OCI_CNT_ALL
7263 void Register(
const Connection &connection,
const ostring& name, ChangeTypes changeTypes, NotifyHandlerProc handler,
unsigned int port = 0,
unsigned int timeout = 0);
7286 void Watch(
const ostring& sql);
7300 unsigned int GetTimeout()
const;
7307 unsigned int GetPort()
const;
7337 friend class Environment;
7349 DatabaseStart = OCI_ENT_STARTUP,
7351 DatabaseShutdown = OCI_ENT_SHUTDOWN,
7353 DatabaseShutdownAny = OCI_ENT_SHUTDOWN_ANY,
7355 DatabaseDrop = OCI_ENT_DROP_DATABASE,
7357 Unregister = OCI_ENT_DEREGISTER,
7359 ObjectChanged = OCI_ENT_OBJECT_CHANGED
7379 ObjectInserted = OCI_ONT_INSERT,
7381 ObjectUpdated = OCI_ONT_UPDATE,
7383 ObjectDeleted = OCI_ONT_DELETE,
7385 ObjectAltered = OCI_ONT_ALTER,
7387 ObjectDropped = OCI_ONT_DROP,
7389 ObjectGeneric = OCI_ONT_GENERIC
7416 ObjectEvent GetObjectEvent()
const;
7423 ostring GetDatabaseName()
const;
7433 ostring GetObjectName()
const;
7512 void SetName(
const ostring& value);
7537 void SetAddress(
const ostring& value);
7565 Ready = OCI_AMS_READY,
7567 Waiting = OCI_AMS_WAITING,
7569 Processed = OCI_AMS_PROCESSED,
7571 Expired = OCI_AMS_EXPIRED
7640 void SetPayload(
const T &value);
7650 Date GetEnqueueTime()
const;
7657 int GetAttemptCount()
const;
7664 MessageState GetState()
const;
7686 int GetExpiration()
const;
7707 void SetExpiration(
int value);
7717 int GetEnqueueDelay()
const;
7741 void SetEnqueueDelay(
int value);
7751 int GetPriority()
const;
7765 void SetPriority(
int value);
7776 Raw GetOriginalID()
const;
7789 void SetOriginalID(
const Raw &value);
7799 ostring GetCorrelation()
const;
7811 void SetCorrelation(
const ostring& value);
7826 ostring GetExceptionQueue()
const;
7854 void SetExceptionQueue(
const ostring& value);
7864 Agent GetSender()
const;
7873 void SetSender(
const Agent &agent);
7886 void SetConsumers(std::vector<Agent> &agents);
7912 Before = OCI_ASD_BEFORE,
7934 Immediate = OCI_AMV_IMMEDIATE,
7936 OnCommit = OCI_AMV_ON_COMMIT
7978 void Put(
const Message &message);
7988 EnqueueVisibility GetVisibility()
const;
8000 void SetVisibility(EnqueueVisibility value);
8010 EnqueueMode GetMode()
const;
8030 void SetMode(EnqueueMode value);
8042 Raw GetRelativeMsgID()
const;
8057 void SetRelativeMsgID(
const Raw &value);
8069 friend class Environment;
8080 typedef void (*NotifyAQHandlerProc) (
Dequeue &dequeue);
8090 Browse = OCI_ADM_BROWSE,
8092 Locked = OCI_ADM_LOCKED,
8094 Remove = OCI_ADM_REMOVE,
8096 Confirm = OCI_ADM_REMOVE_NODATA
8116 Immediate = OCI_AMV_IMMEDIATE,
8118 OnCommit = OCI_AMV_ON_COMMIT
8138 FirstMessage = OCI_ADN_FIRST_MSG,
8140 NextMessage = OCI_ADN_NEXT_MSG,
8143 NextTransaction = OCI_ADN_NEXT_TRANSACTION
8195 Agent Listen(
int timeout);
8218 void SetConsumer(
const ostring& value);
8228 ostring GetCorrelation()
const;
8241 void SetCorrelation(
const ostring& value);
8251 Raw GetRelativeMsgID()
const;
8260 void SetRelativeMsgID(
const Raw &value);
8270 DequeueVisibility GetVisibility()
const;
8286 void SetVisibility(DequeueVisibility value);
8296 DequeueMode GetMode()
const;
8308 void SetMode(DequeueMode value);
8318 NavigationMode GetNavigation()
const;
8339 void SetNavigation(NavigationMode value);
8349 int GetWaitTime()
const;
8368 void SetWaitTime(
int value);
8377 void SetAgents(std::vector<Agent> &agents);
8395 void Subscribe(
unsigned int port,
unsigned int timeout, NotifyAQHandlerProc handler);
8429 NormalQueue = OCI_AQT_NORMAL,
8431 ExceptionQueue = OCI_AQT_EXCEPTION,
8433 NonPersistentQueue = OCI_AQT_NON_PERSISTENT
8469 static void Create(
const Connection &connection,
const ostring& queue,
const ostring& table, QueueType type = NormalQueue,
8470 unsigned int maxRetries = 0,
unsigned int retryDelay = 0,
unsigned int retentionTime = 0,
8471 bool dependencyTracking =
false,
const ostring& comment = OTEXT(
""));
8494 unsigned int maxRetries= 0,
unsigned int retryDelay= 0,
8495 unsigned int retentionTime= 0,
const ostring& comment = OTEXT(
""));
8531 static void Start(
const Connection &connection,
const ostring& queue,
bool enableEnqueue =
true,
bool enableDequeue =
true);
8551 static void Stop(
const Connection &connection,
const ostring& queue,
bool stopEnqueue =
true,
bool stopDequeue =
true,
bool wait =
true);
8572 None = OCI_AGM_NONE,
8575 Transactionnal = OCI_AGM_TRANSACTIONNAL
8596 Buffered = OCI_APM_BUFFERED,
8598 Persistent = OCI_APM_PERSISTENT,
8646 static void Create(
const Connection &connection,
const ostring& table,
const ostring& payloadType,
bool multipleConsumers,
8647 const ostring& storageClause = OTEXT(
""),
const ostring& sortList = OTEXT(
""),
8648 GroupingMode groupingMode = None,
const ostring& comment = OTEXT(
""),
8649 unsigned int primaryInstance = 0,
unsigned int secondaryInstance = 0,
8650 const ostring& compatible = OTEXT(
""));
8670 static void Alter(
const Connection &connection,
const ostring& table,
const ostring& comment,
unsigned int primaryInstance = 0,
unsigned int secondaryInstance = 0);
8692 static void Drop(
const Connection &connection,
const ostring& table,
bool force =
true);
8717 static void Purge(
const Connection &connection,
const ostring& table, PurgeMode mode,
const ostring& condition = OTEXT(
""),
bool block =
true);
8758 Default = OCI_DCM_DEFAULT,
8760 Force = OCI_DCM_FORCE
8780 ResultComplete = OCI_DPR_COMPLETE,
8782 ResultError = OCI_DPR_ERROR,
8784 ResultFull = OCI_DPR_FULL ,
8786 ResultPartial = OCI_DPR_PARTIAL,
8788 ResultEmpty = OCI_DPR_EMPTY
8839 void SetColumn(
unsigned int colIndex,
const ostring& name,
unsigned int maxSize,
const ostring& format = OTEXT(
""));
8872 void SetEntry(
unsigned int rowIndex,
unsigned int colIndex,
const T& value,
bool complete =
true);
8978 void SetCurrentRows(
unsigned int value);
8988 unsigned int GetCurrentRows()
const;
8998 unsigned int GetMaxRows()
const;
9008 unsigned int GetRowCount()
const;
9022 unsigned int GetAffectedRows()
const;
9037 void SetDateFormat(
const ostring& format);
9065 void SetParallel(
bool value);
9081 void SetNoLog(
bool value);
9096 void SetCacheSize(
unsigned int value);
9108 void SetBufferSize(
unsigned int value);
9123 void SetConversionMode(ConversionMode value);
9153 unsigned int GetErrorColumn();
9188 unsigned int GetErrorRow();
9193 #include "ocilib_impl.hpp" struct OCI_Mutex OCI_Mutex
OCILIB encapsulation of OCI mutexes.
struct OCI_Agent OCI_Agent
OCILIB encapsulation of A/Q Agent.
CharsetModeValues
Charset mode enumerated values.
Encapsulate a Resultset column or object member properties.
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.
DequeueVisibilityValues
Message visibility enumerated values.
STL compliant Collection Random iterator class.
Flags< SessionFlagsValues > SessionFlags
Sessions flags.
struct OCI_Connection OCI_Connection
Oracle physical connection.
Static class allowing to set/get thread local storage (TLS) values for a given unique key...
Exception class handling all OCILIB errors.
Provides SQL bind informations.
TypeInfoTypeValues
Type of object information enumerated values.
EventTypeValues
Event type enumerated values.
LobTypeValues
Lob types enumerated values.
CollectionIterator< const CollectionElement< T > > const_iterator
Common const iterator declaration.
Enum< BindModeValues > BindMode
Bind Modes.
HAEventSourceValues
HA Event sources enumerated values.
Enum< DequeueModeValues > DequeueMode
Dequeue mode.
Enum< PoolTypeValues > PoolType
Type of Pool.
Enum< CharsetFormValues > CharsetForm
Type of charsetForm.
FetchModeValues
Fetch Modes enumerated values.
TimeoutTypeValues
Timeout enumerated values.
HAEventTypeValues
HA Event types enumerated values.
unsigned int GetRow() const
Return the row index which caused an error during statement execution.
Class allowing the administration of Oracle Queues.
SessionTraceValues
Session trace enumerated values.
Enum< GroupingModeValues > GroupingMode
Grouping Mode.
StatementTypeValues
Statement Type enumerated values.
Enum< LobTypeValues > LobType
Type of Lob.
Enum< DataTypeValues > DataType
Column data type.
OCI_Mutex * MutexHandle
Alias for an OCI_Mutex pointer.
struct OCI_XID OCI_XID
Global transaction identifier.
ostring GetMessage() const
Retrieve the error message.
Object used for executing SQL or PL/SQL statement and returning the produced results.
A connection or session with a specific database.
Flags< PropertyFlagsValues > PropertyFlags
Column properties flags.
static class allowing to manipulate threads
PoolTypeValues
Pool type enumerated values.
struct OCI_Interval OCI_Interval
Oracle internal interval representation.
Object identifying the SQL data type LONG.
struct OCI_Dequeue OCI_Dequeue
OCILIB encapsulation of A/Q dequeuing operations.
int GetOracleErrorCode() const
Return the Oracle error code.
Oracle Transaction object.
FailoverResultValues
Failover callback results enumerated values.
struct OCI_Statement OCI_Statement
Oracle SQL or PL/SQL statement.
struct OCI_Bind OCI_Bind
Internal bind representation.
Enum< ObjectTypeValues > ObjectType
Object Type.
LongTypeValues
Long types enumerated values.
struct OCI_Subscription OCI_Subscription
OCILIB encapsulation of Oracle DCN notification.
TimestampTypeValues
Interval types enumerated values.
StartFlagsValues
Oracle instance start flags enumerated values.
Flags< ShutdownFlagsValues > ShutdownFlags
Oracle instance shutdown flags.
AQ identified agent for messages delivery.
Static class allowing managing mutexes.
Enum< DequeueVisibilityValues > DequeueVisibility
Message visibility after begin dequeued.
Enum< OracleVersionValues > OracleVersion
Oracle Version.
Oracle Direct path loading encapsulation.
Enum< EnqueueVisibilityValues > EnqueueVisibility
Message visibility after begin queued.
Enum< NavigationModeValues > NavigationMode
Navigation Mode.
struct OCI_Timestamp OCI_Timestamp
Oracle internal timestamp representation.
Enum< EventTypeValues > EventType
Event type.
EnqueueModeValues
Message enqueuing mode enumerated values.
void(* POCI_THREAD)(OCI_Thread *thread, void *arg)
Thread procedure prototype.
Template Enumeration template class providing some type safety to some extends for manipulating enume...
Flags< ChangeTypesValues > ChangeTypes
Subscription changes flags.
Enum< ExceptionTypeValues > ExceptionType
Type of Exception.
ConversionModeValues
Conversion mode enumerated values.
VectorTypeValues
Vector type values.
Flags< ShutdownModeValues > ShutdownMode
Oracle instance shutdown modes.
Flags< EnvironmentFlagsValues > EnvironmentFlags
Environment Flags.
ShutdownModeValues
Oracle instance shutdown modes enumerated values.
struct OCI_Msg OCI_Msg
OCILIB encapsulation of A/Q message.
const void * ThreadId
Thread Unique ID.
Object identifying the SQL data type REF.
Enum< IntervalTypeValues > IntervalType
Interval types.
SeekModeValues
Seek Modes enumerated values.
Enum< StatementTypeValues > StatementType
Statement Type.
PurgeModeValues
Purge mode enumerated values.
Static class in charge of library initialization / cleanup.
FailoverRequestValues
Failover request enumerated values.
Class used for handling transient collection value. it is used internally by the Collection<T> class:...
AllocatedBytesValues
Allocated Bytes enumerated values.
Enum< ObjectEventValues > ObjectEvent
Object events.
FailoverEventValues
Failover events enumerated values.
Enum< VectorTypeValues > VectorType
Vector type.
struct OCI_Ref OCI_Ref
Oracle REF type representation.
ChangeTypesValues
Subscription changes flags values.
Enum< SeekModeValues > SeekMode
Seek Modes.
void * AnyPointer
Alias for the generic void pointer.
const char * what() const override
Override the std::exception::what() method.
ExceptionType GetType() const
Return the Exception type.
Connection GetConnection() const
Return the connection within the error occurred.
Object identifying the SQL data type BFILE.
Object identifying the SQL data types VARRAY and NESTED TABLE.
Enum< MessageStateValues > MessageState
Message state.
struct OCI_Date OCI_Date
Oracle internal date representation.
Flags< AllocatedBytesValues > AllocatedBytesFlags
Allocated Bytes.
ResultValues
Direct Operation Result enumerated values.
friend T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so, it raises a C++ exception using the retrieved error handle.
Flags< StartFlagsValues > StartFlags
Oracle instance start flags.
Object identifying the SQL data type INTERVAL.
Enum< FormatTypeValues > FormatType
Format type.
int GetInternalErrorCode() const
Return the OCILIB error code.
Enum< TimeoutTypeValues > TimeoutType
Timeout Types.
CollectionTypeValues
Collection type enumerated values.
Enum< EnqueueModeValues > EnqueueMode
Message enqueuing mode.
struct OCI_Transaction OCI_Transaction
Oracle Transaction.
POCI_THREADKEYDEST ThreadKeyFreeProc
Thread Key callback for freeing resources.
GroupingModeValues
Grouping mode enumerated values.
Class allowing the administration of Oracle Queue tables.
Enum< LongModeValues > LongMode
LONG data type mapping modes.
Enum< TimestampTypeValues > TimestampType
Type of timestamp.
Enqueue object for queuing messages into an Oracle Queue.
struct OCI_Resultset OCI_Resultset
Collection of output columns from a select statement.
SessionFlagsValues
Session flags enumerated values.
TransactionFlagsValues
Transaction flags enumerated values.
Enum< FailoverEventValues > FailoverEvent
Failover events.
OpenModeValues
Open Modes enumerated values.
Enum< FetchModeValues > FetchMode
Fetch Modes.
A connection or session Pool.
BindModeValues
Bind Modes enumerated values.
Enum< PurgeModeValues > PurgeMode
Purge mode.
Enum< HAEventSourceValues > HAEventSource
Source of HA events.
BindDirectionValues
Bind direction enumerated values.
Enum< FailoverResultValues > FailoverResult
Failover callback results.
Enum< LongTypeValues > LongType
Type of Long.
struct OCI_File OCI_File
Oracle External Large objects:
struct OCI_Thread OCI_Thread
OCILIB encapsulation of OCI Threads.
Enum< HAEventTypeValues > HAEventType
Type of HA events.
ObjectEventValues
Object events enumerated values.
LongModeValues
LONG data type mapping modes enumerated values.
Abstract class allowing derived classes to be compatible with any type supporting the operator << oci...
Flags< StartModeValues > StartMode
Oracle instance start modes.
ObjectTypeValues
Object Type enumerated values.
Enum< ConversionModeValues > ConversionMode
Conversion Mode.
struct OCI_Number OCI_Number
Oracle NUMBER representation.
Enum< NumericTypeValues > NumericType
Numeric data type.
void * CallbackPointer
Alias used for storing user callback method pointers.
CollectionIterator< CollectionElement< T > > iterator
Common iterator declaration.
Enum< CharsetModeValues > CharsetMode
Environment charset mode.
Template class providing OCILIB handles auto memory, life cycle and scope management.
NumericTypeValues
Numeric type enumerated values.
Enum< TypeInfoTypeValues > TypeInfoType
Type of object information.
OCI_Thread * ThreadHandle
Alias for an OCI_Thread pointer.
Enum< ImportModeValues > ImportMode
OCI libraries import mode.
CharsetFormValues
Charset form enumerated values.
void(* POCI_THREADKEYDEST)(void *data)
Thread key destructor prototype.
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
CollationIDValues
Collation ID enumerated values.
struct OCI_Long OCI_Long
Oracle Long data type.
Provides type information on Oracle Database objects.
EnqueueVisibilityValues
Message visibility enumerated values.
struct OCI_TypeInfo OCI_TypeInfo
Type info metadata handle.
NavigationModeValues
Navigation Mode enumerated values.
Object identifying the SQL data type NUMBER.
IntervalTypeValues
Interval types enumerated values.
POCI_THREAD ThreadProc
Thread callback.
ShutdownFlagsValues
Oracle instance shutdown flags enumerated values.
DequeueModeValues
Dequeue mode enumerated values.
Statement GetStatement() const
Return the statement within the error occurred.
DataTypeValues
Data type enumerated values.
ImportModeValues
OCI libraries import mode enumerated values.
Enum< FailoverRequestValues > FailoverRequest
Failover requests.
Lob< ostring, LobNationalCharacter > NClob
Class handling NCLOB oracle type.
MessageStateValues
Message state enumerated values.
OracleVersionValues
Oracle Version enumerated values.
Enum< SeekModeValues > SeekMode
Seek Modes.
Object identifying the SQL data type LOB (CLOB, NCLOB and BLOB)
Enum< CollationIDValues > CollationID
Type of Collation ID.
SeekModeValues
Seek Modes enumerated values.
Enum< ResultValues > Result
Direct Operation Result.
QueueTypeValues
Queue Type enumerated values.
ExceptionTypeValues
Exception type enumerated values.
Lob< ostring, LobCharacter > Clob
Class handling CLOB oracle type.
Enum< BindDirectionValues > BindDirection
Bind direction.
struct OCI_Coll OCI_Coll
Oracle Collections (VARRAYs and Nested Tables) representation.
PropertyFlagsValues
Column properties flags values.
Enum< SessionTraceValues > SessionTrace
Session traces.
struct OCI_Elem OCI_Elem
Oracle Collection item representation.
FormatTypeValues
Format type enumerated values.
Flags< TransactionFlagsValues > TransactionFlags
Transaction flags.
std::basic_string< otext, std::char_traits< otext >, std::allocator< otext > > ostring
string class wrapping the OCILIB otext * type and OTEXT() macros ( see Character sets ) ...
struct OCI_Object OCI_Object
Oracle Named types representation.
StartModeValues
Oracle instance start modes enumerated values.
struct OCI_Column OCI_Column
Oracle SQL Column and Type member representation.
struct OCI_Error OCI_Error
Encapsulates an Oracle or OCILIB exception.
Object identifying the SQL data type TIMESTAMP.
Enum< QueueTypeValues > QueueType
Queue Type.
Dequeue object for dequeuing messages into an Oracle Queue.
Object identifying the SQL data type OBJECT.
EnvironmentFlagsValues
Environment Flags enumerated values.
struct OCI_Event OCI_Event
OCILIB encapsulation of Oracle DCN event.
Subscription to database or objects changes.
struct OCI_Lob OCI_Lob
Oracle Internal Large objects:
Enum< CollectionTypeValues > CollectionType
Collection type.
Object identifying the SQL data type DATE.
Enum< OpenModeValues > OpenMode
Open Modes.