27 #include "ocilibcpp/core.hpp" 28 #include "ocilibcpp/support.hpp" 52 Oracle10gR1 = OCI_10_1,
53 Oracle10gR2 = OCI_10_2,
54 Oracle11gR1 = OCI_11_1,
55 Oracle11gR2 = OCI_11_2,
56 Oracle12cR1 = OCI_12_1,
57 Oracle12cR2 = OCI_12_2,
58 Oracle18cR1 = OCI_18_1,
59 Oracle18cR2 = OCI_18_2,
60 Oracle18cR3 = OCI_18_3,
61 Oracle18cR4 = OCI_18_4
276 LobBinary = OCI_BLOB,
278 LobCharacter = OCI_CLOB,
280 LobNationalCharacter = OCI_NCLOB
300 LongBinary = OCI_BLONG,
302 LongCharacter = OCI_CLONG
437 unsigned int GetRow()
const;
447 const char*
what() const noexcept override;
465 void SetWhat(const otext* value) noexcept;
466 void CopyWhat(const
char* value) noexcept;
502 SourceInstance = OCI_HES_INSTANCE,
504 SourceDatabase = OCI_HES_DATABASE,
506 SourceNode = OCI_HES_NODE,
508 SourceService = OCI_HES_SERVICE,
510 SourceServiceMember = OCI_HES_SERVICE_MEMBER,
512 SourceASMInstance = OCI_HES_ASM_INSTANCE,
514 SourcePreConnect = OCI_HES_PRECONNECT
534 EventDown = OCI_HET_DOWN,
556 Default = OCI_ENV_DEFAULT,
558 Threaded = OCI_ENV_THREADED,
560 Events = OCI_ENV_EVENTS
580 ImportLinkage = OCI_IMPORT_MODE_LINKAGE,
582 ImportRuntime = OCI_IMPORT_MODE_RUNTIME
602 CharsetAnsi = OCI_CHAR_ANSI,
604 CharsetWide = OCI_CHAR_WIDE
624 SessionDefault = OCI_SESSION_DEFAULT,
626 SessionXa = OCI_SESSION_XA,
628 SessionSysDba = OCI_SESSION_SYSDBA,
630 SessionSysOper = OCI_SESSION_SYSOPER,
632 SessionSysAsm = OCI_SESSION_SYSASM,
634 SessionSysBkp = OCI_SESSION_SYSBKP,
636 SessionSysDgD = OCI_SESSION_SYSDGD,
638 SessionSysKmt = OCI_SESSION_SYSKMT,
640 SessionSysRac = OCI_SESSION_SYSRAC,
642 SessionPreAuth = OCI_SESSION_PRELIM_AUTH
662 StartOnly = OCI_DB_SPM_START,
664 StartMount = OCI_DB_SPM_MOUNT,
666 StartOpen = OCI_DB_SPM_OPEN,
668 StartFull = OCI_DB_SPM_FULL
688 StartDefault = OCI_DB_SPF_DEFAULT,
690 StartForce = OCI_DB_SPF_FORCE,
692 StartRestrict = OCI_DB_SPF_RESTRICT
712 ShutdownOnly = OCI_DB_SDM_SHUTDOWN,
714 ShutdownClose = OCI_DB_SDM_CLOSE,
716 ShutdownDismount = OCI_DB_SDM_DISMOUNT,
718 ShutdownFull = OCI_DB_SDM_FULL
739 ShutdowntDefault = OCI_DB_SDF_DEFAULT,
742 ShutdowTrans = OCI_DB_SDF_TRANS,
746 ShutdownTransLocal = OCI_DB_SDF_TRANS_LOCAL,
749 ShutdownImmediate = OCI_DB_SDF_IMMEDIATE,
755 ShutdownAbort = OCI_DB_SDF_ABORT
775 OracleClientBytes = OCI_MEM_ORACLE,
777 OcilibBytes = OCI_MEM_OCILIB,
779 AllBytes = OCI_MEM_ALL
798 typedef void(*HAHandlerProc) (
Connection& con, HAEventSource eventSource, HAEventType eventType,
Timestamp& time);
835 static void Cleanup();
870 static unsigned int GetCharMaxSize();
879 static big_uint GetAllocatedBytes(AllocatedBytesFlags type);
886 static bool Initialized();
898 static OracleVersion GetCompileVersion();
905 static unsigned int GetCompileMajorVersion();
912 static unsigned int GetCompileMinorVersion();
919 static unsigned int GetCompileRevisionVersion();
930 static OracleVersion GetRuntimeVersion();
937 static unsigned int GetRuntimeMajorVersion();
944 static unsigned int GetRuntimeMinorVersion();
951 static unsigned int GetRuntimeRevisionVersion();
963 static void EnableWarnings(
bool value);
996 static bool SetFormat(FormatType formatType,
const ostring& format);
1008 static ostring GetFormat(FormatType formatType);
1040 const ostring& spfile = OTEXT(
""));
1100 static void SetHAHandler(HAHandlerProc handler);
1106 friend class Environment;
1110 static unsigned int TAFHandler(
OCI_Connection* pConnection,
unsigned int type,
unsigned int event);
1111 static void NotifyHandler(
OCI_Event* pEvent);
1112 static void NotifyHandlerAQ(
OCI_Dequeue* pDequeue);
1118 static void SetUserCallback(
AnyPointer ptr, T callback);
1121 static void SetSmartHandle(
AnyPointer ptr, T handle);
1128 static Environment& GetInstance();
1132 void SelfInitialize(EnvironmentFlags mode,
const ostring& libpath);
1138 EnvironmentHandle _handle;
1139 EnvironmentFlags _mode;
1140 unsigned int _charMaxSize;
1303 static void Create(
const ostring& name, ThreadKeyFreeProc freeProc =
nullptr);
1347 ConnectionPool = OCI_POOL_CONNECTION,
1349 SessionPool = OCI_POOL_SESSION
1386 unsigned int minSize,
unsigned int maxSize,
unsigned int increment = 1,
1408 unsigned int minSize,
unsigned int maxSize,
unsigned int increment = 1,
1459 unsigned int GetTimeout()
const;
1474 void SetTimeout(
unsigned int value);
1485 bool GetNoWait()
const;
1499 void SetNoWait(
bool value);
1506 unsigned int GetBusyConnectionsCount()
const;
1513 unsigned int GetOpenedConnectionsCount()
const;
1520 unsigned int GetMinSize()
const;
1527 unsigned int GetMaxSize()
const;
1534 unsigned int GetIncrement()
const;
1544 unsigned int GetStatementCacheSize()
const;
1553 void SetStatementCacheSize(
unsigned int value);
1565 friend class Environment;
1577 template<
class,
int>
1594 TimeoutSend = OCI_NTO_SEND,
1599 TimeoutReceive = OCI_NTO_RECEIVE,
1604 TimeoutCall = OCI_NTO_CALL
1624 FailoverRequestSession = OCI_FOT_SESSION,
1626 FailoverRequestSelect = OCI_FOT_SELECT
1646 FailoverEventEnd = OCI_FOE_END,
1648 FailoverEventAbort = OCI_FOE_ABORT,
1650 FailoverEventReauthentificate = OCI_FOE_REAUTH,
1652 FailoverEventBegin = OCI_FOE_BEGIN,
1654 FailoverEventError = OCI_FOE_ERROR
1674 FailoverOk = OCI_FOC_OK,
1676 FailoverRetry = OCI_FOC_RETRY
1696 TraceIdentity = OCI_TRC_IDENTITY,
1698 TraceModule = OCI_TRC_MODULE,
1700 TraceAction = OCI_TRC_ACTION,
1702 TraceDetail = OCI_TRC_DETAIL
1721 typedef FailoverResult(*TAFHandlerProc) (
Connection& con, FailoverRequest failoverRequest, FailoverEvent failoverEvent);
1827 void SetAutoCommit(
bool enabled);
1834 bool GetAutoCommit()
const;
1844 bool IsServerAlive()
const;
1854 bool PingServer()
const;
1864 ostring GetConnectionString()
const;
1894 ostring GetServerVersion()
const;
1904 OracleVersion GetVersion()
const;
1911 unsigned int GetServerMajorVersion()
const;
1918 unsigned int GetServerMinorVersion()
const;
1925 unsigned int GetServerRevisionVersion()
const;
1934 void ChangePassword(
const ostring& newPwd);
1941 ostring GetSessionTag()
const;
1957 void SetSessionTag(
const ostring& tag);
1979 void SetTransaction(
const Transaction& transaction);
2012 bool SetFormat(FormatType formatType,
const ostring& format);
2024 ostring GetFormat(FormatType formatType);
2045 void EnableServerOutput(
unsigned int bufsize,
unsigned int arrsize,
unsigned int lnsize);
2055 void DisableServerOutput();
2065 bool GetServerOutput(
ostring& line)
const;
2072 void GetServerOutput(std::vector<ostring>& lines)
const;
2102 void SetTrace(SessionTrace trace,
const ostring& value);
2114 ostring GetTrace(SessionTrace trace)
const;
2187 unsigned int GetStatementCacheSize()
const;
2199 void SetStatementCacheSize(
unsigned int value);
2217 unsigned int GetDefaultLobPrefetchSize()
const;
2243 void SetDefaultLobPrefetchSize(
unsigned int value);
2259 unsigned int GetMaxCursors()
const;
2269 bool IsTAFCapable()
const;
2284 void SetTAFHandler(TAFHandlerProc handler);
2315 unsigned int GetTimeout(TimeoutType timeout);
2344 void SetTimeout(TimeoutType timeout,
unsigned int value);
2371 Unknown = OCI_UNKNOWN,
2375 Tight = OCI_TRS_TIGHT,
2377 Loose = OCI_TRS_LOOSE,
2383 Serializable = OCI_TRS_SERIALIZABLE
2453 TransactionFlags GetFlags()
const;
2460 unsigned int GetTimeout()
const;
2495 Number(
bool create =
false);
2511 Number(
const otext* str,
const otext* format = OTEXT(
""));
2543 void FromString(
const ostring& str,
const ostring& format = OTEXT(
""))
const;
2565 ostring ToString()
const override;
2576 Number operator ++ (
int);
2577 Number operator -- (
int);
2579 bool operator == (
const Number& other)
const;
2580 bool operator != (
const Number& other)
const;
2581 bool operator > (
const Number& other)
const;
2582 bool operator < (
const Number& other)
const;
2583 bool operator >= (
const Number& other)
const;
2584 bool operator <= (
const Number& other)
const;
2586 template<class T, typename core::SupportedNumeric<T>::Type::type* =
nullptr>
2587 Number& operator = (
const T& lhs);
2589 template<class T, typename core::SupportedNumeric<T>::Type::type* =
nullptr>
2592 template<class T, typename core::SupportedNumeric<T>::Type::type* =
nullptr>
2593 Number operator - (
const T& value);
2595 template<class T, typename core::SupportedNumeric<T>::Type::type* =
nullptr>
2596 Number operator + (
const T& value);
2598 template<class T, typename core::SupportedNumeric<T>::Type::type* =
nullptr>
2599 Number operator * (
const T& value);
2601 template<class T, typename core::SupportedNumeric<T>::Type::type* =
nullptr>
2602 Number operator / (
const T& value);
2604 template<class T, typename core::SupportedNumeric<T>::Type::type* =
nullptr>
2605 Number& operator += (
const T& value);
2607 template<class T, typename core::SupportedNumeric<T>::Type::type* =
nullptr>
2608 Number& operator -= (
const T& value);
2610 template<class T, typename core::SupportedNumeric<T>::Type::type* =
nullptr>
2611 Number& operator *= (
const T& value);
2613 template<class T, typename core::SupportedNumeric<T>::Type::type* =
nullptr>
2614 Number& operator /= (
const T& value);
2619 static AnyPointer GetNativeValue(
const T& value);
2625 int Compare(
const Number& other)
const;
2628 inline T GetValue()
const;
2631 Number& SetValue(
const T& value);
2634 void Add(
const T& value);
2637 void Sub(
const T& value);
2640 void Multiply(
const T& value);
2643 void Divide(
const T& value);
2672 static Date SysDate();
2681 Date(
bool create =
false);
2697 Date(
const otext* str,
const otext* format = OTEXT(
""));
2721 bool IsValid()
const;
2728 int GetYear()
const;
2735 void SetYear(
int value);
2742 int GetMonth()
const;
2749 void SetMonth(
int value);
2763 void SetDay(
int value);
2770 int GetHours()
const;
2777 void SetHours(
int value);
2784 int GetMinutes()
const;
2791 void SetMinutes(
int value);
2798 int GetSeconds()
const;
2805 void SetSeconds(
int value);
2814 int DaysBetween(
const Date& other)
const;
2825 void SetDate(
int year,
int month,
int day);
2836 void SetTime(
int hour,
int min,
int sec);
2850 void SetDateTime(
int year,
int month,
int day,
int hour,
int min,
int sec);
2861 void GetDate(
int& year,
int& month,
int& day)
const;
2872 void GetTime(
int& hour,
int& min,
int& sec)
const;
2886 void GetDateTime(
int& year,
int& month,
int& day,
int& hour,
int& min,
int& sec)
const;
2895 void AddDays(
int days);
2904 void AddMonths(
int months);
2920 Date LastDay()
const;
2946 void FromString(
const ostring& str,
const ostring& format = OTEXT(
""));
2968 ostring ToString()
const override;
2982 Date& operator ++ ();
2989 Date operator ++ (
int);
2996 Date& operator -- ();
3003 Date operator -- (
int);
3010 Date operator + (
int value)
const;
3017 Date operator - (
int value)
const;
3024 Date& operator += (
int value);
3031 Date& operator -= (
int value);
3038 bool operator == (
const Date& other)
const;
3045 bool operator != (
const Date& other)
const;
3052 bool operator > (
const Date& other)
const;
3059 bool operator < (
const Date& other)
const;
3066 bool operator >= (
const Date& other)
const;
3073 bool operator <= (
const Date& other)
const;
3077 int Compare(
const Date& other)
const;
3093 friend class Environment;
3111 YearMonth = OCI_INTERVAL_YM,
3113 DaySecond = OCI_INTERVAL_DS
3166 bool IsValid()
const;
3176 int GetYear()
const;
3186 void SetYear(
int value);
3196 int GetMonth()
const;
3206 void SetMonth(
int value);
3226 void SetDay(
int value);
3236 int GetHours()
const;
3246 void SetHours(
int value);
3256 int GetMinutes()
const;
3266 void SetMinutes(
int value);
3276 int GetSeconds()
const;
3286 void SetSeconds(
int value);
3293 int GetMilliSeconds()
const;
3300 void SetMilliSeconds(
int value);
3316 void GetDaySecond(
int& day,
int& hour,
int& min,
int& sec,
int& fsec)
const;
3332 void SetDaySecond(
int day,
int hour,
int min,
int sec,
int fsec);
3345 void GetYearMonth(
int& year,
int& month)
const;
3358 void SetYearMonth(
int year,
int month);
3367 void UpdateTimeZone(
const ostring& timeZone);
3379 void FromString(
const ostring& data);
3389 ostring ToString(
int leadingPrecision,
int fractionPrecision)
const;
3396 ostring ToString()
const override;
3438 bool operator == (
const Interval& other)
const;
3445 bool operator != (
const Interval& other)
const;
3452 bool operator > (
const Interval& other)
const;
3459 bool operator < (
const Interval& other)
const;
3466 bool operator >= (
const Interval& other)
const;
3473 bool operator <= (
const Interval& other)
const;
3477 int Compare(
const Interval& other)
const;
3492 friend class Environment;
3511 NoTimeZone = OCI_TIMESTAMP,
3513 WithTimeZone = OCI_TIMESTAMP_TZ,
3515 WithLocalTimeZone = OCI_TIMESTAMP_LTZ
3534 static Timestamp SysTimestamp(TimestampType type = NoTimeZone);
3571 TimestampType
GetType()
const;
3587 bool IsValid()
const;
3594 int GetYear()
const;
3601 void SetYear(
int value);
3608 int GetMonth()
const;
3615 void SetMonth(
int value);
3629 void SetDay(
int value);
3636 int GetHours()
const;
3643 void SetHours(
int value);
3650 int GetMinutes()
const;
3657 void SetMinutes(
int value);
3664 int GetSeconds()
const;
3671 void SetSeconds(
int value);
3678 int GetMilliSeconds()
const;
3685 void SetMilliSeconds(
int value);
3696 void GetDate(
int& year,
int& month,
int& day)
const;
3708 void GetTime(
int& hour,
int& min,
int& sec,
int& fsec)
const;
3719 void SetDate(
int year,
int month,
int day);
3731 void SetTime(
int hour,
int min,
int sec,
int fsec);
3746 void GetDateTime(
int& year,
int& month,
int& day,
int& hour,
int& min,
int& sec,
int& fsec)
const;
3762 void SetDateTime(
int year,
int month,
int day,
int hour,
int min,
int sec,
int fsec,
const ostring& timeZone = OTEXT(
""));
3783 void SetTimeZone(
const ostring& timeZone);
3793 void GetTimeZoneOffset(
int& hour,
int& min)
const;
3820 void FromString(
const ostring& data,
const ostring& format = OCI_STRING_FORMAT_DATE);
3840 ostring ToString()
const override;
3945 bool operator == (
const Timestamp& other)
const;
3952 bool operator != (
const Timestamp& other)
const;
3959 bool operator > (
const Timestamp& other)
const;
3966 bool operator < (
const Timestamp& other)
const;
3973 bool operator >= (
const Timestamp& other)
const;
3980 bool operator <= (
const Timestamp& other)
const;
3984 int Compare(
const Timestamp& other)
const;
3996 template<
class T,
int U>
4037 T Read(
unsigned int length);
4049 unsigned int Write(
const T& content);
4061 unsigned int Append(
const T& content);
4070 void Append(
const Lob& other);
4086 bool Seek(SeekMode seekMode, big_uint offset);
4100 big_uint GetOffset()
const;
4107 big_uint GetLength()
const;
4114 big_uint GetMaxSize()
const;
4127 big_uint GetChunkSize()
const;
4143 void Truncate(big_uint length);
4160 big_uint Erase(big_uint offset, big_uint length);
4175 void Copy(
Lob& dest, big_uint offset, big_uint offsetDest, big_uint length)
const;
4182 bool IsTemporary()
const;
4189 bool IsRemote()
const;
4203 void Open(OpenMode mode);
4240 void EnableBuffering(
bool value);
4254 Lob& operator += (
const Lob& other);
4261 bool operator == (
const Lob& other)
const;
4268 bool operator != (
const Lob& other)
const;
4272 bool Equals(
const Lob& other)
const;
4375 Raw Read(
unsigned int size);
4391 bool Seek(SeekMode seekMode, big_uint offset);
4401 bool Exists()
const;
4408 big_uint GetOffset()
const;
4415 big_uint GetLength()
const;
4471 bool IsOpened()
const;
4485 bool operator == (
const File& other)
const;
4492 bool operator != (
const File& other)
const;
4496 bool Equals(
const File& other)
const;
4525 Table = OCI_TIF_TABLE,
4527 View = OCI_TIF_VIEW,
4585 unsigned int GetColumnCount()
const;
4601 Column GetColumn(
unsigned int index)
const;
4615 boolean IsFinalType()
const;
4665 Persistent = OCI_OBJ_PERSISTENT,
4667 Transient = OCI_OBJ_TRANSIENT,
4669 Value = OCI_OBJ_VALUE
4704 bool IsAttributeNull(
const ostring& name)
const;
4713 void SetAttributeNull(
const ostring& name);
4749 T Get(
const ostring& name)
const;
4765 void Get(
const ostring& name, T& value)
const;
4797 void Set(
const ostring& name,
const T& value);
4811 ostring ToString()
const override;
4867 Object GetObject()
const;
4874 bool IsReferenceNull()
const;
4884 void SetReferenceNull();
4898 ostring ToString()
const override;
4921 typedef T ValueType;
4929 bool IsNull()
const;
4934 CollectionType* _coll;
4953 typedef typename T::ValueType value_type;
4956 typedef std::random_access_iterator_tag iterator_category;
4957 typedef ptrdiff_t difference_type;
4958 typedef ptrdiff_t distance_type;
4959 typedef value_type* pointer;
4960 typedef value_type& reference;
5027 Varray = OCI_COLL_VARRAY,
5029 NestedTable = OCI_COLL_NESTED_TABLE,
5031 IndexedTable = OCI_COLL_INDEXED_TABLE
5064 CollectionType
GetType()
const;
5071 unsigned int GetMax()
const;
5078 unsigned int GetSize()
const;
5090 unsigned int GetCount()
const;
5099 void Truncate(
unsigned int size);
5119 bool IsElementNull(
unsigned int index)
const;
5131 void SetElementNull(
unsigned int index);
5150 bool Delete(
unsigned int index)
const;
5159 T Get(
unsigned int index)
const;
5169 void Set(
unsigned int index,
const T& value);
5179 void Append(
const T& value);
5200 ostring ToString()
const override;
5228 const_iterator begin()
const;
5242 const_iterator end()
const;
5262 static void SetElem(
OCI_Elem* elem,
const T& value);
5274 template<
class T,
int U>
5309 unsigned int Write(
const T& content);
5316 unsigned int GetLength()
const;
5323 T GetContent()
const;
5377 InOut = OCI_BDM_IN_OUT
5444 unsigned int GetSubType()
const;
5455 unsigned int GetDataCount()
const;
5484 void SetDataNull(
bool value,
unsigned int index = 1);
5500 bool IsDataNull(
unsigned int index = 1)
const;
5515 void SetCharsetForm(CharsetForm value);
5522 BindDirection GetDirection()
const;
5540 template<
class,
int>
5543 friend class BindObject;
5555 TypeSelect = OCI_CST_SELECT,
5557 TypeUpdate = OCI_CST_UPDATE,
5559 TypeDelete = OCI_CST_DELETE,
5561 TypeInsert = OCI_CST_INSERT,
5563 TypeCreate = OCI_CST_CREATE,
5565 TypeDrop = OCI_CST_DROP,
5567 TypeAlter = OCI_CST_ALTER,
5569 TypeBegin = OCI_CST_BEGIN,
5571 TypeDeclare = OCI_CST_DECLARE,
5573 TypeCall = OCI_CST_CALL,
5575 TypeMerge = OCI_CST_MERGE
5595 FetchForward = OCI_SFM_DEFAULT,
5597 FetchScrollable = OCI_SFM_SCROLLABLE
5617 BindByPosition = OCI_BIND_BY_POS,
5619 BindByName = OCI_BIND_BY_NAME
5639 LongExplicit = OCI_LONG_EXPLICIT,
5641 LongImplicit = OCI_LONG_IMPLICIT
5705 void Describe(
const ostring& sql);
5730 void Parse(
const ostring& sql);
5742 void Prepare(
const ostring& sql);
5749 void ExecutePrepared();
5758 void Execute(
const ostring& sql);
5778 unsigned int ExecutePrepared(T callback);
5800 template<
class T,
class U>
5801 unsigned int ExecutePrepared(T callback, U adapter);
5822 unsigned int Execute(
const ostring& sql, T callback);
5845 template<
class T,
class U>
5846 unsigned int Execute(
const ostring& sql, T callback, U adapter);
5862 unsigned int GetAffectedRows()
const;
5876 ostring GetSqlIdentifier()
const;
5938 void SetBindArraySize(
unsigned int size);
5945 unsigned int GetBindArraySize()
const;
5962 void AllowRebinding(
bool value);
5972 bool IsRebindingAllowed()
const;
5990 unsigned int GetBindIndex(
const ostring& name)
const;
5997 unsigned int GetBindCount()
const;
6013 BindInfo GetBind(
unsigned int index)
const;
6070 template<
class T,
class U>
6172 template<
class T,
class U>
6196 void Register(
const ostring& name);
6215 template<
class T,
class U>
6216 void Register(
const ostring& name, U& extraInfo);
6236 template<
class T,
class U>
6237 void Register(
const ostring& name, U extraInfo);
6244 StatementType GetStatementType()
const;
6255 unsigned int GetSqlErrorPos()
const;
6267 void SetFetchMode(FetchMode value);
6277 FetchMode GetFetchMode()
const;
6286 void SetBindMode(BindMode value);
6296 BindMode GetBindMode()
const;
6305 void SetFetchSize(
unsigned int value);
6315 unsigned int GetFetchSize()
const;
6327 void SetPrefetchSize(
unsigned int value);
6337 unsigned int GetPrefetchSize()
const;
6357 void SetPrefetchMemory(
unsigned int value);
6367 unsigned int GetPrefetchMemory()
const;
6376 void SetLongMaxSize(
unsigned int value);
6386 unsigned int GetLongMaxSize()
const;
6398 void SetLongMode(LongMode value);
6405 LongMode GetLongMode()
const;
6419 unsigned int GetSQLCommand()
const;
6440 void GetBatchErrors(std::vector<Exception>& exceptions);
6445 static void OnFreeSmartHandle(SmartHandle* smartHandle);
6451 void ReleaseResultsets()
const;
6455 void SetInData()
const;
6456 void SetOutData()
const;
6457 void ClearBinds()
const;
6459 template<
typename M,
class T>
6462 template<
typename M,
class T>
6465 template<
typename M,
class T>
6468 template<
typename M,
class T,
class U>
6471 template<
typename T>
6472 unsigned int Fetch(T callback);
6474 template<
typename T,
typename U>
6475 unsigned int Fetch(T callback, U adapter);
6498 SeekAbsolute = OCI_SFD_ABSOLUTE,
6500 SeekRelative = OCI_SFD_RELATIVE
6525 T Get(
unsigned int index)
const;
6541 void Get(
unsigned int index, T& value)
const;
6556 T Get(
const ostring& name)
const;
6569 void Get(
const ostring& name, T& value)
const;
6585 template<
class T,
class U>
6586 bool Get(T& value, U adapter)
const;
6603 template<
typename T>
6604 unsigned int ForEach(T callback);
6628 template<
typename T,
typename U>
6629 unsigned int ForEach(T callback, U adapter);
6707 bool Seek(SeekMode mode,
int offset);
6714 unsigned int GetCount()
const;
6726 unsigned int GetCurrentRow()
const;
6741 unsigned int GetColumnIndex(
const ostring& name)
const;
6748 unsigned int GetColumnCount()
const;
6760 Column GetColumn(
unsigned int index)
const;
6784 bool IsColumnNull(
unsigned int index)
const;
6793 bool IsColumnNull(
const ostring& name)
const;
6807 bool operator ++ (
int);
6814 bool operator -- (
int);
6822 bool operator += (
int offset);
6830 bool operator -= (
int offset);
6859 NoFlags = OCI_CPF_NONE,
6862 IsIdentity = OCI_CPF_IS_IDENTITY,
6866 IsGeneratedAlways = OCI_CPF_IS_GEN_ALWAYS,
6869 IsGeneratedByDefaultOnNull = OCI_CPF_IS_GEN_BY_DEFAULT_ON_NULL,
6871 IsLogicalPartitioning = OCI_CPF_IS_LPART,
6873 IsGeneratedByContainers = OCI_CPF_IS_CONID
6911 ostring GetFullSQLType()
const;
6937 unsigned int GetSubType()
const;
6944 CharsetForm GetCharsetForm()
const;
6951 CollationID GetCollationID()
const;
6962 unsigned int GetSize()
const;
6969 int GetScale()
const;
6976 int GetPrecision()
const;
6983 int GetFractionalPrecision()
const;
6990 int GetLeadingPrecision()
const;
7002 PropertyFlags GetPropertyFlags()
const;
7009 bool IsNullable()
const;
7020 bool IsCharSemanticUsed()
const;
7061 typedef void (*NotifyHandlerProc) (
Event& evt);
7071 ObjectChanges = OCI_CNT_OBJECTS,
7073 RowChanges = OCI_CNT_ROWS,
7075 DatabaseChanges = OCI_CNT_DATABASES,
7077 AllChanges = OCI_CNT_ALL
7111 void Register(
const Connection& connection,
const ostring& name, ChangeTypes changeTypes, NotifyHandlerProc handler,
unsigned int port = 0,
unsigned int timeout = 0);
7134 void Watch(
const ostring& sql);
7148 unsigned int GetTimeout()
const;
7155 unsigned int GetPort()
const;
7185 friend class Environment;
7197 DatabaseStart = OCI_ENT_STARTUP,
7199 DatabaseShutdown = OCI_ENT_SHUTDOWN,
7201 DatabaseShutdownAny = OCI_ENT_SHUTDOWN_ANY,
7203 DatabaseDrop = OCI_ENT_DROP_DATABASE,
7205 Unregister = OCI_ENT_DEREGISTER,
7207 ObjectChanged = OCI_ENT_OBJECT_CHANGED
7227 ObjectInserted = OCI_ONT_INSERT,
7229 ObjectUpdated = OCI_ONT_UPDATE,
7231 ObjectDeleted = OCI_ONT_DELETE,
7233 ObjectAltered = OCI_ONT_ALTER,
7235 ObjectDropped = OCI_ONT_DROP,
7237 ObjectGeneric = OCI_ONT_GENERIC
7264 ObjectEvent GetObjectEvent()
const;
7271 ostring GetDatabaseName()
const;
7281 ostring GetObjectName()
const;
7360 void SetName(
const ostring& value);
7385 void SetAddress(
const ostring& value);
7413 Ready = OCI_AMS_READY,
7415 Waiting = OCI_AMS_WAITING,
7417 Processed = OCI_AMS_PROCESSED,
7419 Expired = OCI_AMS_EXPIRED
7488 void SetPayload(
const T& value);
7498 Date GetEnqueueTime()
const;
7505 int GetAttemptCount()
const;
7512 MessageState GetState()
const;
7534 int GetExpiration()
const;
7555 void SetExpiration(
int value);
7565 int GetEnqueueDelay()
const;
7589 void SetEnqueueDelay(
int value);
7599 int GetPriority()
const;
7613 void SetPriority(
int value);
7624 Raw GetOriginalID()
const;
7637 void SetOriginalID(
const Raw& value);
7647 ostring GetCorrelation()
const;
7659 void SetCorrelation(
const ostring& value);
7674 ostring GetExceptionQueue()
const;
7702 void SetExceptionQueue(
const ostring& value);
7712 Agent GetSender()
const;
7721 void SetSender(
const Agent& agent);
7734 void SetConsumers(std::vector<Agent>& agents);
7760 Before = OCI_ASD_BEFORE,
7782 Immediate = OCI_AMV_IMMEDIATE,
7784 OnCommit = OCI_AMV_ON_COMMIT
7826 void Put(
const Message& message);
7836 EnqueueVisibility GetVisibility()
const;
7848 void SetVisibility(EnqueueVisibility value);
7858 EnqueueMode GetMode()
const;
7878 void SetMode(EnqueueMode value);
7890 Raw GetRelativeMsgID()
const;
7905 void SetRelativeMsgID(
const Raw& value);
7917 friend class Environment;
7928 typedef void (*NotifyAQHandlerProc) (
Dequeue& dequeue);
7938 Browse = OCI_ADM_BROWSE,
7940 Locked = OCI_ADM_LOCKED,
7942 Remove = OCI_ADM_REMOVE,
7944 Confirm = OCI_ADM_REMOVE_NODATA
7964 Immediate = OCI_AMV_IMMEDIATE,
7966 OnCommit = OCI_AMV_ON_COMMIT
7986 FirstMessage = OCI_ADN_FIRST_MSG,
7988 NextMessage = OCI_ADN_NEXT_MSG,
7991 NextTransaction = OCI_ADN_NEXT_TRANSACTION
8043 Agent Listen(
int timeout);
8066 void SetConsumer(
const ostring& value);
8076 ostring GetCorrelation()
const;
8089 void SetCorrelation(
const ostring& value);
8099 Raw GetRelativeMsgID()
const;
8108 void SetRelativeMsgID(
const Raw& value);
8118 DequeueVisibility GetVisibility()
const;
8134 void SetVisibility(DequeueVisibility value);
8144 DequeueMode GetMode()
const;
8156 void SetMode(DequeueMode value);
8166 NavigationMode GetNavigation()
const;
8187 void SetNavigation(NavigationMode value);
8197 int GetWaitTime()
const;
8216 void SetWaitTime(
int value);
8225 void SetAgents(std::vector<Agent>& agents);
8243 void Subscribe(
unsigned int port,
unsigned int timeout, NotifyAQHandlerProc handler);
8277 NormalQueue = OCI_AQT_NORMAL,
8279 ExceptionQueue = OCI_AQT_EXCEPTION,
8281 NonPersistentQueue = OCI_AQT_NON_PERSISTENT
8317 static void Create(
const Connection& connection,
const ostring& queue,
const ostring& table, QueueType type = NormalQueue,
8318 unsigned int maxRetries = 0,
unsigned int retryDelay = 0,
unsigned int retentionTime = 0,
8319 bool dependencyTracking =
false,
const ostring& comment = OTEXT(
""));
8342 unsigned int maxRetries = 0,
unsigned int retryDelay = 0,
8343 unsigned int retentionTime = 0,
const ostring& comment = OTEXT(
""));
8379 static void Start(
const Connection& connection,
const ostring& queue,
bool enableEnqueue =
true,
bool enableDequeue =
true);
8399 static void Stop(
const Connection& connection,
const ostring& queue,
bool stopEnqueue =
true,
bool stopDequeue =
true,
bool wait =
true);
8420 None = OCI_AGM_NONE,
8423 Transactionnal = OCI_AGM_TRANSACTIONNAL
8444 Buffered = OCI_APM_BUFFERED,
8446 Persistent = OCI_APM_PERSISTENT,
8494 static void Create(
const Connection& connection,
const ostring& table,
const ostring& payloadType,
bool multipleConsumers,
8495 const ostring& storageClause = OTEXT(
""),
const ostring& sortList = OTEXT(
""),
8496 GroupingMode groupingMode = None,
const ostring& comment = OTEXT(
""),
8497 unsigned int primaryInstance = 0,
unsigned int secondaryInstance = 0,
8498 const ostring& compatible = OTEXT(
""));
8518 static void Alter(
const Connection& connection,
const ostring& table,
const ostring& comment,
unsigned int primaryInstance = 0,
unsigned int secondaryInstance = 0);
8540 static void Drop(
const Connection& connection,
const ostring& table,
bool force =
true);
8565 static void Purge(
const Connection& connection,
const ostring& table, PurgeMode mode,
const ostring& condition = OTEXT(
""),
bool block =
true);
8606 Default = OCI_DCM_DEFAULT,
8608 Force = OCI_DCM_FORCE
8628 ResultComplete = OCI_DPR_COMPLETE,
8630 ResultError = OCI_DPR_ERROR,
8632 ResultFull = OCI_DPR_FULL,
8634 ResultPartial = OCI_DPR_PARTIAL,
8636 ResultEmpty = OCI_DPR_EMPTY
8687 void SetColumn(
unsigned int colIndex,
const ostring& name,
unsigned int maxSize,
const ostring& format = OTEXT(
""));
8720 void SetEntry(
unsigned int rowIndex,
unsigned int colIndex,
const T& value,
bool complete =
true);
8826 void SetCurrentRows(
unsigned int value);
8836 unsigned int GetCurrentRows()
const;
8846 unsigned int GetMaxRows()
const;
8856 unsigned int GetRowCount()
const;
8870 unsigned int GetAffectedRows()
const;
8885 void SetDateFormat(
const ostring& format);
8913 void SetParallel(
bool value);
8929 void SetNoLog(
bool value);
8944 void SetCacheSize(
unsigned int value);
8956 void SetBufferSize(
unsigned int value);
8971 void SetConversionMode(ConversionMode value);
9001 unsigned int GetErrorColumn();
9036 unsigned int GetErrorRow();
9040 #define OCILIB_DEFINE_FLAG_OPERATORS(T) \ 9041 inline core::Flags<T> operator | (T a, T b) { return core::Flags<T>(a) | core::Flags<T>(b); } \ core::Enum< CharsetFormValues > CharsetForm
Type of charsetForm.
struct OCI_Agent OCI_Agent
OCILIB encapsulation of A/Q Agent.
CharsetModeValues
Charset mode enumerated values.
Encapsulate a Resultset column or object member properties.
core::Enum< ExceptionTypeValues > ExceptionType
Type of Exception.
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.
DequeueVisibilityValues
Message visibility enumerated values.
STL compliant Collection Random iterator class.
core::Flags< PropertyFlagsValues > PropertyFlags
Column properties flags.
Internal usage. Interface for handling ownership and relationship of a C API handle.
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.
core::Enum< CollationIDValues > CollationID
Type of Collation ID.
Provides SQL bind information.
TypeInfoTypeValues
Type of object information enumerated values.
const char * what() const noexcept override
Override the std::exception::what() method.
EventTypeValues
Event type enumerated values.
core::Enum< OpenModeValues > OpenMode
Open Modes.
LobTypeValues
Lob types enumerated values.
CollectionIterator< const CollectionElement< T > > const_iterator
Common const iterator declaration.
HAEventSourceValues
HA Event sources enumerated values.
FetchModeValues
Fetch Modes enumerated values.
TimeoutTypeValues
Timeout enumerated values.
HAEventTypeValues
HA Event types enumerated values.
core::Enum< FailoverRequestValues > FailoverRequest
Failover requests.
core::Enum< DataTypeValues > DataType
Column data type.
core::Flags< EnvironmentFlagsValues > EnvironmentFlags
Environment Flags.
Long< Raw, LongBinary > Blong
Class handling LONG RAW oracle type.
core::Enum< SessionTraceValues > SessionTrace
Session traces.
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.
core::Enum< EventTypeValues > EventType
Event type.
core::Enum< SeekModeValues > SeekMode
Seek Modes.
StatementTypeValues
Statement Type enumerated values.
core::Enum< DequeueModeValues > DequeueMode
Dequeue mode.
OCI_Mutex * MutexHandle
Alias for an OCI_Mutex pointer.
struct OCI_XID OCI_XID
Global transaction identifier.
core::Enum< FormatTypeValues > FormatType
Format type.
ostring GetMessage() const
Retrieve the error message.
Abstract class allowing derived classes to be compatible with any type supporting the operator << oci...
core::Enum< ResultValues > Result
Direct Operation Result.
Object used for executing SQL or PL/SQL statement and returning the produced results.
A connection or session with a specific database.
core::Enum< LobTypeValues > LobType
Type of Lob.
core::Enum< TimestampTypeValues > TimestampType
Type of timestamp.
static class allowing to manipulate threads
core::Enum< IntervalTypeValues > IntervalType
Interval types.
PoolTypeValues
Pool type enumerated values.
core::Enum< BindModeValues > BindMode
Bind Modes.
struct OCI_Interval OCI_Interval
Oracle internal interval representation.
Object identifying the SQL data type LONG.
core::Enum< CollectionTypeValues > CollectionType
Collection type.
Internal usage. Locker object.
struct OCI_Dequeue OCI_Dequeue
OCILIB encapsulation of A/Q dequeuing operations.
int GetOracleErrorCode() const
Return the Oracle error code.
static 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.
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.
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.
AQ identified agent for messages delivery.
Static class allowing managing mutexes.
Oracle Direct path loading encapsulation.
core::Enum< BindDirectionValues > BindDirection
Bind direction.
core::Enum< ObjectTypeValues > ObjectType
Object Type.
core::Enum< TimeoutTypeValues > TimeoutType
Timeout Types.
Internal usage. Map supporting concurrent access from multiple threads.
struct OCI_Timestamp OCI_Timestamp
Oracle internal timestamp representation.
EnqueueModeValues
Message enqueuing mode enumerated values.
void(* POCI_THREAD)(OCI_Thread *thread, void *arg)
Thread procedure prototype.
ConversionModeValues
Conversion mode enumerated values.
VectorTypeValues
Vector type values.
ShutdownModeValues
Oracle instance shutdown modes enumerated values.
struct OCI_Msg OCI_Msg
OCILIB encapsulation of A/Q message.
Internal usage. Class implementing bind translations between C++ vectors and C API arrays...
core::Flags< SessionFlagsValues > SessionFlags
Sessions flags.
core::Enum< ConversionModeValues > ConversionMode
Conversion Mode.
const void * ThreadId
Thread Unique ID.
Object identifying the SQL data type REF.
SeekModeValues
Seek Modes enumerated values.
PurgeModeValues
Purge mode enumerated values.
core::Enum< VectorTypeValues > VectorType
Vector type.
Internal usage. Smart pointer class with reference counting for managing OCILIB object handles...
Static class in charge of library initialization / cleanup.
core::Enum< DequeueVisibilityValues > DequeueVisibility
Message visibility after begin dequeued.
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.
FailoverEventValues
Failover events enumerated values.
struct OCI_Ref OCI_Ref
Oracle REF type representation.
ChangeTypesValues
Subscription changes flags values.
void * AnyPointer
Alias for the generic void pointer.
ExceptionType GetType() const
Return the Exception type.
Connection GetConnection() const
Return the connection within the error occurred.
core::Enum< FailoverResultValues > FailoverResult
Failover callback results.
Template Enumeration template class providing some type safety to some extends for manipulating enume...
core::Enum< LongModeValues > LongMode
LONG data type mapping modes.
core::Flags< ShutdownFlagsValues > ShutdownFlags
Oracle instance shutdown flags.
Object identifying the SQL data type BFILE.
Object identifying the SQL data types VARRAY and NESTED TABLE.
core::Enum< EnqueueVisibilityValues > EnqueueVisibility
Message visibility after begin queued.
struct OCI_Date OCI_Date
Oracle internal date representation.
core::Flags< ShutdownModeValues > ShutdownMode
Oracle instance shutdown modes.
ResultValues
Direct Operation Result enumerated values.
core::Enum< OracleVersionValues > OracleVersion
Oracle Version.
Object identifying the SQL data type INTERVAL.
int GetInternalErrorCode() const
Return the OCILIB error code.
CollectionTypeValues
Collection type enumerated values.
core::Enum< TypeInfoTypeValues > TypeInfoType
Type of object information.
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.
Enqueue object for queuing messages into an Oracle Queue.
struct OCI_Resultset OCI_Resultset
Collection of output columns from a select statement.
core::Enum< LongTypeValues > LongType
Type of Long.
SessionFlagsValues
Session flags enumerated values.
TransactionFlagsValues
Transaction flags enumerated values.
core::Enum< GroupingModeValues > GroupingMode
Grouping Mode.
core::Enum< StatementTypeValues > StatementType
Statement Type.
OpenModeValues
Open Modes enumerated values.
Long< ostring, LongCharacter > Clong
Class handling LONG oracle type.
A connection or session Pool.
core::Flags< AllocatedBytesValues > AllocatedBytesFlags
Allocated Bytes.
BindModeValues
Bind Modes enumerated values.
BindDirectionValues
Bind direction enumerated values.
struct OCI_File OCI_File
Oracle External Large objects:
ObjectEventValues
Object events enumerated values.
LongModeValues
LONG data type mapping modes enumerated values.
ObjectTypeValues
Object Type enumerated values.
struct OCI_Number OCI_Number
Oracle NUMBER representation.
core::Enum< NavigationModeValues > NavigationMode
Navigation Mode.
core::Enum< ObjectEventValues > ObjectEvent
Object events.
core::Enum< FetchModeValues > FetchMode
Fetch Modes.
CollectionIterator< CollectionElement< T > > iterator
Common iterator declaration.
NumericTypeValues
Numeric type enumerated values.
OCI_Thread * ThreadHandle
Alias for an OCI_Thread pointer.
core::Enum< SeekModeValues > SeekMode
Seek Modes.
CharsetFormValues
Charset form enumerated values.
core::Enum< PoolTypeValues > PoolType
Type of Pool.
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.
core::Enum< ImportModeValues > ImportMode
OCI libraries import mode.
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.
core::Flags< StartFlagsValues > StartFlags
Oracle instance start flags.
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.
core::Flags< TransactionFlagsValues > TransactionFlags
Transaction flags.
ImportModeValues
OCI libraries import mode enumerated values.
Lob< ostring, LobNationalCharacter > NClob
Class handling NCLOB oracle type.
MessageStateValues
Message state enumerated values.
OracleVersionValues
Oracle Version enumerated values.
core::Enum< HAEventSourceValues > HAEventSource
Source of HA events.
Object identifying the SQL data type LOB (CLOB, NCLOB and BLOB)
core::Enum< FailoverEventValues > FailoverEvent
Failover events.
SeekModeValues
Seek Modes enumerated values.
QueueTypeValues
Queue Type enumerated values.
ExceptionTypeValues
Exception type enumerated values.
Lob< ostring, LobCharacter > Clob
Class handling CLOB oracle type.
core::Enum< CharsetModeValues > CharsetMode
Environment charset mode.
struct OCI_Coll OCI_Coll
Oracle Collections (VARRAYs and Nested Tables) representation.
PropertyFlagsValues
Column properties flags values.
struct OCI_Elem OCI_Elem
Oracle Collection item representation.
FormatTypeValues
Format type enumerated values.
core::Enum< QueueTypeValues > QueueType
Queue Type.
core::Enum< EnqueueModeValues > EnqueueMode
Message enqueuing mode.
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.
core::Flags< StartModeValues > StartMode
Oracle instance start modes.
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.
core::Enum< MessageStateValues > MessageState
Message state.
Dequeue object for dequeuing messages into an Oracle Queue.
core::Enum< HAEventTypeValues > HAEventType
Type of HA events.
core::Flags< ChangeTypesValues > ChangeTypes
Subscription changes flags.
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.
core::Enum< PurgeModeValues > PurgeMode
Purge mode.
struct OCI_Lob OCI_Lob
Oracle Internal Large objects:
core::Enum< NumericTypeValues > NumericType
Numeric data type.
Internal usage. Class owning bind objects allowing to set/get C data prior/after a statement executio...
Object identifying the SQL data type DATE.