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
411 LobBinary = OCI_BLOB,
413 LobCharacter = OCI_CLOB,
415 LobNationalCharacter = OCI_NCLOB
435 LongBinary = OCI_BLONG,
437 LongCharacter = OCI_CLONG
488 friend T
Check(T result);
572 unsigned int GetRow()
const;
582 const char *
what()
const throw() override;
630 SourceInstance = OCI_HES_INSTANCE,
632 SourceDatabase = OCI_HES_DATABASE,
634 SourceNode = OCI_HES_NODE,
636 SourceService = OCI_HES_SERVICE,
638 SourceServiceMember = OCI_HES_SERVICE_MEMBER,
640 SourceASMInstance = OCI_HES_ASM_INSTANCE,
642 SourcePreConnect = OCI_HES_PRECONNECT
662 EventDown = OCI_HET_DOWN,
684 Default = OCI_ENV_DEFAULT,
686 Threaded = OCI_ENV_THREADED,
688 Events = OCI_ENV_EVENTS
708 ImportLinkage = OCI_IMPORT_MODE_LINKAGE,
710 ImportRuntime = OCI_IMPORT_MODE_RUNTIME
730 CharsetAnsi = OCI_CHAR_ANSI,
732 CharsetWide = OCI_CHAR_WIDE
752 SessionDefault = OCI_SESSION_DEFAULT,
754 SessionXa = OCI_SESSION_XA,
756 SessionSysDba = OCI_SESSION_SYSDBA,
758 SessionSysOper = OCI_SESSION_SYSOPER
778 StartOnly = OCI_DB_SPM_START,
780 StartMount = OCI_DB_SPM_MOUNT,
782 StartOpen = OCI_DB_SPM_OPEN,
784 StartFull = OCI_DB_SPM_FULL
804 StartDefault = OCI_DB_SPF_DEFAULT,
806 StartForce = OCI_DB_SPF_FORCE,
808 StartRestrict = OCI_DB_SPF_RESTRICT
828 ShutdownOnly = OCI_DB_SDM_SHUTDOWN,
830 ShutdownClose = OCI_DB_SDM_CLOSE,
832 ShutdownDismount = OCI_DB_SDM_DISMOUNT,
834 ShutdownFull = OCI_DB_SDM_FULL
855 ShutdowntDefault = OCI_DB_SDF_DEFAULT,
858 ShutdowTrans = OCI_DB_SDF_TRANS,
862 ShutdownTransLocal = OCI_DB_SDF_TRANS_LOCAL,
865 ShutdownImmediate = OCI_DB_SDF_IMMEDIATE,
871 ShutdownAbort = OCI_DB_SDF_ABORT
891 OracleClientBytes = OCI_MEM_ORACLE,
893 OcilibBytes = OCI_MEM_OCILIB,
895 AllBytes = OCI_MEM_ALL
914 typedef void(*HAHandlerProc) (
Connection &con, HAEventSource eventSource, HAEventType eventType,
Timestamp &time);
949 static void Cleanup();
982 static big_uint GetAllocatedBytes(AllocatedBytesFlags type);
989 static bool Initialized();
1001 static OracleVersion GetCompileVersion();
1008 static unsigned int GetCompileMajorVersion();
1015 static unsigned int GetCompileMinorVersion();
1022 static unsigned int GetCompileRevisionVersion();
1033 static OracleVersion GetRuntimeVersion();
1040 static unsigned int GetRuntimeMajorVersion();
1047 static unsigned int GetRuntimeMinorVersion();
1054 static unsigned int GetRuntimeRevisionVersion();
1066 static void EnableWarnings(
bool value);
1099 static bool SetFormat(FormatType formatType,
const ostring& format);
1111 static ostring GetFormat(FormatType formatType);
1143 const ostring& spfile = OTEXT(
""));
1203 static void SetHAHandler(HAHandlerProc handler);
1209 friend class Environment;
1213 static unsigned int TAFHandler(
OCI_Connection *pConnection,
unsigned int type,
unsigned int event);
1214 static void NotifyHandler(
OCI_Event *pEvent);
1215 static void NotifyHandlerAQ(
OCI_Dequeue *pDequeue);
1221 static void SetUserCallback(
AnyPointer ptr, T callback);
1224 static void SetSmartHandle(
AnyPointer ptr, T handle);
1229 static Handle * GetEnvironmentHandle();
1231 static Environment& GetInstance();
1235 void SelfInitialize(EnvironmentFlags mode,
const ostring& libpath);
1239 EnvironmentHandle _handle;
1240 ConcurrentMap<AnyPointer, Handle *> _handles;
1241 ConcurrentMap<AnyPointer, CallbackPointer> _callbacks;
1242 EnvironmentFlags _mode;
1296 static void Run(
ThreadHandle handle, ThreadProc func,
void *args);
1405 static void Create(
const ostring& name, ThreadKeyFreeProc freeProc =
nullptr);
1449 ConnectionPool = OCI_POOL_CONNECTION,
1451 SessionPool = OCI_POOL_SESSION
1488 unsigned int minSize,
unsigned int maxSize,
unsigned int increment = 1,
1510 unsigned int minSize,
unsigned int maxSize,
unsigned int increment = 1,
1561 unsigned int GetTimeout()
const;
1576 void SetTimeout(
unsigned int value);
1587 bool GetNoWait()
const;
1601 void SetNoWait(
bool value);
1608 unsigned int GetBusyConnectionsCount()
const;
1615 unsigned int GetOpenedConnectionsCount()
const;
1622 unsigned int GetMinSize()
const;
1629 unsigned int GetMaxSize()
const;
1636 unsigned int GetIncrement()
const;
1646 unsigned int GetStatementCacheSize()
const;
1655 void SetStatementCacheSize(
unsigned int value);
1667 friend class Environment;
1668 friend class Exception;
1679 template<
class,
int>
1693 FailoverRequestSession = OCI_FOT_SESSION,
1695 FailoverRequestSelect = OCI_FOT_SELECT
1715 FailoverEventEnd = OCI_FOE_END,
1717 FailoverEventAbort = OCI_FOE_ABORT,
1719 FailoverEventReauthentificate = OCI_FOE_REAUTH,
1721 FailoverEventBegin = OCI_FOE_BEGIN,
1723 FailoverEventError = OCI_FOE_ERROR
1743 FailoverOk = OCI_FOC_OK,
1745 FailoverRetry = OCI_FOC_RETRY
1765 TraceIdentity = OCI_TRC_IDENTITY,
1767 TraceModule = OCI_TRC_MODULE,
1769 TraceAction = OCI_TRC_ACTION,
1771 TraceDetail = OCI_TRC_DETAIL
1790 typedef FailoverResult(*TAFHandlerProc) (
Connection &con, FailoverRequest failoverRequest, FailoverEvent failoverEvent);
1896 void SetAutoCommit(
bool enabled);
1903 bool GetAutoCommit()
const;
1913 bool IsServerAlive()
const;
1923 bool PingServer()
const;
1933 ostring GetConnectionString()
const;
1963 ostring GetServerVersion()
const;
1973 OracleVersion GetVersion()
const;
1980 unsigned int GetServerMajorVersion()
const;
1987 unsigned int GetServerMinorVersion()
const;
1994 unsigned int GetServerRevisionVersion()
const;
2003 void ChangePassword(
const ostring& newPwd);
2010 ostring GetSessionTag()
const;
2026 void SetSessionTag(
const ostring& tag);
2048 void SetTransaction(
const Transaction &transaction);
2081 bool SetFormat(FormatType formatType,
const ostring& format);
2093 ostring GetFormat(FormatType formatType);
2114 void EnableServerOutput(
unsigned int bufsize,
unsigned int arrsize,
unsigned int lnsize);
2124 void DisableServerOutput();
2134 bool GetServerOutput(
ostring &line)
const;
2141 void GetServerOutput(std::vector<ostring> &lines)
const;
2171 void SetTrace(SessionTrace trace,
const ostring& value);
2183 ostring GetTrace(SessionTrace trace)
const;
2256 unsigned int GetStatementCacheSize()
const;
2268 void SetStatementCacheSize(
unsigned int value);
2286 unsigned int GetDefaultLobPrefetchSize()
const;
2312 void SetDefaultLobPrefetchSize(
unsigned int value);
2328 unsigned int GetMaxCursors()
const;
2338 bool IsTAFCapable()
const;
2353 void SetTAFHandler(TAFHandlerProc handler);
2396 Unknown = OCI_UNKNOWN,
2400 Tight = OCI_TRS_TIGHT,
2402 Loose = OCI_TRS_LOOSE,
2408 Serializable = OCI_TRS_SERIALIZABLE
2478 TransactionFlags GetFlags()
const;
2485 unsigned int GetTimeout()
const;
2506 friend class BindArray;
2520 Number(
bool create =
false);
2536 Number(
const otext* str,
const otext* format = OTEXT(
""));
2568 void FromString(
const ostring& str,
const ostring& format = OTEXT(
""))
const;
2590 ostring ToString()
const override;
2601 Number operator ++ (
int);
2602 Number operator -- (
int);
2604 bool operator == (
const Number& other)
const;
2605 bool operator != (
const Number& other)
const;
2606 bool operator > (
const Number& other)
const;
2607 bool operator < (
const Number& other)
const;
2608 bool operator >= (
const Number& other)
const;
2609 bool operator <= (
const Number& other)
const;
2612 Number& operator = (
const T &lhs);
2618 Number operator - (
const T &value);
2621 Number operator + (
const T &value);
2624 Number operator * (
const T &value);
2627 Number operator / (
const T &value);
2630 Number& operator += (
const T &value);
2633 Number& operator -= (
const T &value);
2636 Number& operator *= (
const T &value);
2639 Number& operator /= (
const T &value);
2647 int Compare(
const Number& other)
const;
2650 inline T GetValue()
const;
2653 Number& SetValue(
const T &value);
2656 void Add(
const T &value);
2659 void Sub(
const T &value);
2662 void Multiply(
const T &value);
2665 void Divide(
const T &value);
2681 friend class BindArray;
2694 static Date SysDate();
2703 Date(
bool create =
false);
2719 Date(
const otext* str,
const otext* format = OTEXT(
""));
2743 bool IsValid()
const;
2750 int GetYear()
const;
2757 void SetYear(
int value);
2764 int GetMonth()
const;
2771 void SetMonth(
int value);
2785 void SetDay(
int value);
2792 int GetHours()
const;
2799 void SetHours(
int value);
2806 int GetMinutes()
const;
2813 void SetMinutes(
int value);
2820 int GetSeconds()
const;
2827 void SetSeconds(
int value);
2836 int DaysBetween(
const Date& other)
const;
2847 void SetDate(
int year,
int month,
int day);
2858 void SetTime(
int hour,
int min,
int sec);
2872 void SetDateTime(
int year,
int month,
int day,
int hour,
int min,
int sec);
2883 void GetDate(
int &year,
int &month,
int &day)
const;
2894 void GetTime(
int &hour,
int &min,
int &sec)
const;
2908 void GetDateTime(
int &year,
int &month,
int &day,
int &hour,
int &min,
int &sec)
const;
2917 void AddDays(
int days);
2926 void AddMonths(
int months);
2942 Date LastDay()
const;
2968 void FromString(
const ostring& str,
const ostring& format = OTEXT(
""));
2990 ostring ToString()
const override;
3004 Date& operator ++ ();
3011 Date operator ++ (
int);
3018 Date& operator -- ();
3025 Date operator -- (
int);
3032 Date operator + (
int value)
const;
3039 Date operator - (
int value)
const;
3046 Date& operator += (
int value);
3053 Date& operator -= (
int value);
3060 bool operator == (
const Date& other)
const;
3067 bool operator != (
const Date& other)
const;
3074 bool operator > (
const Date& other)
const;
3081 bool operator < (
const Date& other)
const;
3088 bool operator >= (
const Date& other)
const;
3095 bool operator <= (
const Date& other)
const;
3099 int Compare(
const Date& other)
const;
3115 friend class Environment;
3118 friend class BindArray;
3133 YearMonth = OCI_INTERVAL_YM,
3135 DaySecond = OCI_INTERVAL_DS
3188 bool IsValid()
const;
3198 int GetYear()
const;
3208 void SetYear(
int value);
3218 int GetMonth()
const;
3228 void SetMonth(
int value);
3248 void SetDay(
int value);
3258 int GetHours()
const;
3268 void SetHours(
int value);
3278 int GetMinutes()
const;
3288 void SetMinutes(
int value);
3298 int GetSeconds()
const;
3308 void SetSeconds(
int value);
3315 int GetMilliSeconds()
const;
3322 void SetMilliSeconds(
int value);
3338 void GetDaySecond(
int &day,
int &hour,
int &min,
int &sec,
int &fsec)
const;
3354 void SetDaySecond(
int day,
int hour,
int min,
int sec,
int fsec);
3367 void GetYearMonth(
int &year,
int &month)
const;
3380 void SetYearMonth(
int year,
int month);
3389 void UpdateTimeZone(
const ostring& timeZone);
3401 void FromString(
const ostring& data);
3411 ostring ToString(
int leadingPrecision,
int fractionPrecision)
const;
3418 ostring ToString()
const override;
3460 bool operator == (
const Interval& other)
const;
3467 bool operator != (
const Interval& other)
const;
3474 bool operator > (
const Interval& other)
const;
3481 bool operator < (
const Interval& other)
const;
3488 bool operator >= (
const Interval& other)
const;
3495 bool operator <= (
const Interval& other)
const;
3499 int Compare(
const Interval& other)
const;
3514 friend class Environment;
3517 friend class BindArray;
3533 NoTimeZone = OCI_TIMESTAMP,
3535 WithTimeZone = OCI_TIMESTAMP_TZ,
3537 WithLocalTimeZone = OCI_TIMESTAMP_LTZ
3556 static Timestamp SysTimestamp(TimestampType type = NoTimeZone);
3593 TimestampType
GetType()
const;
3609 bool IsValid()
const;
3616 int GetYear()
const;
3623 void SetYear(
int value);
3630 int GetMonth()
const;
3637 void SetMonth(
int value);
3651 void SetDay(
int value);
3658 int GetHours()
const;
3665 void SetHours(
int value);
3672 int GetMinutes()
const;
3679 void SetMinutes(
int value);
3686 int GetSeconds()
const;
3693 void SetSeconds(
int value);
3700 int GetMilliSeconds()
const;
3707 void SetMilliSeconds(
int value);
3718 void GetDate(
int &year,
int &month,
int &day)
const;
3730 void GetTime(
int &hour,
int &min,
int &sec,
int &fsec)
const;
3741 void SetDate(
int year,
int month,
int day);
3753 void SetTime(
int hour,
int min,
int sec,
int fsec);
3768 void GetDateTime(
int &year,
int &month,
int &day,
int &hour,
int &min,
int &sec,
int &fsec)
const;
3784 void SetDateTime(
int year,
int month,
int day,
int hour,
int min,
int sec,
int fsec,
const ostring& timeZone = OTEXT(
""));
3805 void SetTimeZone(
const ostring& timeZone);
3815 void GetTimeZoneOffset(
int &hour,
int &min)
const;
3842 void FromString(
const ostring& data,
const ostring& format = OCI_STRING_FORMAT_DATE);
3862 ostring ToString()
const override;
3967 bool operator == (
const Timestamp& other)
const;
3974 bool operator != (
const Timestamp& other)
const;
3981 bool operator > (
const Timestamp& other)
const;
3988 bool operator < (
const Timestamp& other)
const;
3995 bool operator >= (
const Timestamp& other)
const;
4002 bool operator <= (
const Timestamp& other)
const;
4006 int Compare(
const Timestamp& other)
const;
4018 template<
class T,
int U>
4023 friend class BindArray;
4059 T Read(
unsigned int length);
4071 unsigned int Write(
const T &content);
4083 unsigned int Append(
const T& content);
4092 void Append(
const Lob& other);
4108 bool Seek(SeekMode seekMode, big_uint offset);
4122 big_uint GetOffset()
const;
4129 big_uint GetLength()
const;
4136 big_uint GetMaxSize()
const;
4149 big_uint GetChunkSize()
const;
4165 void Truncate(big_uint length);
4182 big_uint Erase(big_uint offset, big_uint length);
4197 void Copy(
Lob &dest, big_uint offset, big_uint offsetDest, big_uint length)
const;
4204 bool IsTemporary()
const;
4218 void Open(OpenMode mode);
4255 void EnableBuffering(
bool value);
4269 Lob& operator += (
const Lob& other);
4276 bool operator == (
const Lob& other)
const;
4283 bool operator != (
const Lob& other)
const;
4287 bool Equals(
const Lob &other)
const;
4289 Lob(
OCI_Lob *pLob, Handle *parent =
nullptr);
4338 friend class BindArray;
4390 Raw Read(
unsigned int size);
4406 bool Seek(SeekMode seekMode, big_uint offset);
4416 bool Exists()
const;
4423 big_uint GetOffset()
const;
4430 big_uint GetLength()
const;
4486 bool IsOpened()
const;
4500 bool operator == (
const File& other)
const;
4507 bool operator != (
const File& other)
const;
4511 bool Equals(
const File &other)
const;
4540 Table = OCI_TIF_TABLE,
4542 View = OCI_TIF_VIEW,
4600 unsigned int GetColumnCount()
const;
4616 Column GetColumn(
unsigned int index)
const;
4634 friend class BindArray;
4650 Persistent = OCI_OBJ_PERSISTENT,
4652 Transient = OCI_OBJ_TRANSIENT,
4654 Value = OCI_OBJ_VALUE
4689 bool IsAttributeNull(
const ostring& name)
const;
4698 void SetAttributeNull(
const ostring& name);
4734 T Get(
const ostring& name)
const;
4750 void Get(
const ostring& name, T &value)
const;
4782 void Set(
const ostring& name,
const T &value);
4814 friend class BindArray;
4852 Object GetObject()
const;
4859 bool IsReferenceNull()
const;
4869 void SetReferenceNull();
4883 ostring ToString()
const override;
4906 typedef T ValueType;
4914 bool IsNull()
const;
4919 CollectionType* _coll;
4938 typedef typename T::ValueType value_type;
4941 typedef std::random_access_iterator_tag iterator_category;
4942 typedef ptrdiff_t difference_type;
4943 typedef ptrdiff_t distance_type;
4944 typedef value_type* pointer;
4945 typedef value_type& reference;
4994 friend class BindArray;
5011 Varray = OCI_COLL_VARRAY,
5013 NestedTable = OCI_COLL_NESTED_TABLE,
5015 IndexedTable = OCI_COLL_INDEXED_TABLE
5048 CollectionType
GetType()
const;
5055 unsigned int GetMax()
const;
5062 unsigned int GetSize()
const;
5074 unsigned int GetCount()
const;
5083 void Truncate(
unsigned int size);
5103 bool IsElementNull(
unsigned int index)
const;
5115 void SetElementNull(
unsigned int index);
5134 bool Delete(
unsigned int index)
const;
5143 T Get(
unsigned int index)
const;
5153 void Set(
unsigned int index,
const T &value);
5163 void Append(
const T &data);
5184 ostring ToString()
const override;
5212 const_iterator begin()
const;
5226 const_iterator end()
const;
5244 static T GetElem(
OCI_Elem *elem, Handle *parent);
5246 static void SetElem(
OCI_Elem *elem,
const T &value);
5258 template<
class T,
int U>
5263 friend class BindArray;
5293 unsigned int Write(
const T& content);
5300 unsigned int GetLength()
const;
5307 T GetContent()
const;
5339 InOut = OCI_BDM_IN_OUT
5384 unsigned int GetSubType()
const;
5395 unsigned int GetDataCount()
const;
5424 void SetDataNull(
bool value,
unsigned int index = 1);
5440 bool IsDataNull(
unsigned int index = 1)
const;
5455 void SetCharsetForm(CharsetForm value);
5462 BindDirection GetDirection()
const;
5478 friend class Exception;
5480 template<
class,
int>
5483 friend class BindObject;
5495 TypeSelect = OCI_CST_SELECT,
5497 TypeUpdate = OCI_CST_UPDATE,
5499 TypeDelete = OCI_CST_DELETE,
5501 TypeInsert = OCI_CST_INSERT,
5503 TypeCreate = OCI_CST_CREATE,
5505 TypeDrop = OCI_CST_DROP,
5507 TypeAlter = OCI_CST_ALTER,
5509 TypeBegin = OCI_CST_BEGIN,
5511 TypeDeclare = OCI_CST_DECLARE,
5513 TypeCall = OCI_CST_CALL
5533 FetchForward = OCI_SFM_DEFAULT,
5535 FetchScrollable = OCI_SFM_SCROLLABLE
5555 BindByPosition = OCI_BIND_BY_POS,
5557 BindByName = OCI_BIND_BY_NAME
5577 LongExplicit = OCI_LONG_EXPLICIT,
5579 LongImplicit = OCI_LONG_IMPLICIT
5643 void Describe(
const ostring& sql);
5668 void Parse(
const ostring& sql);
5680 void Prepare(
const ostring& sql);
5687 void ExecutePrepared();
5696 void Execute(
const ostring& sql);
5716 unsigned int ExecutePrepared(T callback);
5738 template<
class T,
class U>
5739 unsigned int ExecutePrepared(T callback, U adapter);
5760 unsigned int Execute(
const ostring& sql, T callback);
5783 template<
class T,
class U>
5784 unsigned int Execute(
const ostring& sql, T callback, U adapter);
5800 unsigned int GetAffectedRows()
const;
5869 void SetBindArraySize(
unsigned int size);
5876 unsigned int GetBindArraySize()
const;
5893 void AllowRebinding(
bool value);
5903 bool IsRebindingAllowed()
const;
5921 unsigned int GetBindIndex(
const ostring& name)
const;
5928 unsigned int GetBindCount()
const;
5944 BindInfo GetBind(
unsigned int index)
const;
6001 template<
class T,
class U>
6099 template<
class T,
class U>
6123 void Register(
const ostring& name);
6142 template<
class T,
class U>
6143 void Register(
const ostring& name, U& extraInfo);
6163 template<
class T,
class U>
6164 void Register(
const ostring& name, U extraInfo);
6171 StatementType GetStatementType()
const;
6182 unsigned int GetSqlErrorPos()
const;
6194 void SetFetchMode(FetchMode value);
6204 FetchMode GetFetchMode()
const;
6213 void SetBindMode(BindMode value);
6223 BindMode GetBindMode()
const;
6232 void SetFetchSize(
unsigned int value);
6242 unsigned int GetFetchSize()
const;
6254 void SetPrefetchSize(
unsigned int value);
6264 unsigned int GetPrefetchSize()
const;
6284 void SetPrefetchMemory(
unsigned int value);
6294 unsigned int GetPrefetchMemory()
const;
6303 void SetLongMaxSize(
unsigned int value);
6313 unsigned int GetLongMaxSize()
const;
6325 void SetLongMode(LongMode value);
6332 LongMode GetLongMode()
const;
6346 unsigned int GetSQLCommand()
const;
6367 void GetBatchErrors(std::vector<Exception> &exceptions);
6371 static bool IsResultsetHandle(Handle *handle);
6372 static void OnFreeSmartHandle(SmartHandle *smartHandle);
6376 BindsHolder *GetBindsHolder(
bool allocate)
const;
6378 void ReleaseResultsets()
const;
6382 void SetInData()
const;
6383 void SetOutData()
const;
6384 void ClearBinds()
const;
6386 template<
typename M,
class T>
6389 template<
typename M,
class T>
6392 template<
typename M,
class T>
6395 template<
typename M,
class T,
class U>
6398 template<
typename T>
6399 unsigned int Fetch(T callback);
6401 template<
typename T,
typename U>
6402 unsigned int Fetch(T callback, U adapter);
6425 SeekAbsolute = OCI_SFD_ABSOLUTE,
6427 SeekRelative = OCI_SFD_RELATIVE
6452 T Get(
unsigned int index)
const;
6468 void Get(
unsigned int index, T &value)
const;
6483 T Get(
const ostring& name)
const;
6496 void Get(
const ostring &name, T &value)
const;
6512 template<
class T,
class U>
6513 bool Get(T& value, U adapter)
const;
6530 template<
typename T>
6531 unsigned int ForEach(T callback);
6555 template<
typename T,
typename U>
6556 unsigned int ForEach(T callback, U adapter);
6634 bool Seek(SeekMode mode,
int offset);
6641 unsigned int GetCount()
const;
6653 unsigned int GetCurrentRow()
const;
6668 unsigned int GetColumnIndex(
const ostring& name)
const;
6675 unsigned int GetColumnCount()
const;
6687 Column GetColumn(
unsigned int index)
const;
6711 bool IsColumnNull(
unsigned int index)
const;
6720 bool IsColumnNull(
const ostring& name)
const;
6734 bool operator ++ (
int);
6741 bool operator -- (
int);
6749 bool operator += (
int offset);
6757 bool operator -= (
int offset);
6786 NoFlags = OCI_CPF_NONE,
6789 IsIdentity = OCI_CPF_IS_IDENTITY,
6793 IsGeneratedAlways = OCI_CPF_IS_GEN_ALWAYS,
6796 IsGeneratedByDefaultOnNull = OCI_CPF_IS_GEN_BY_DEFAULT_ON_NULL
6829 ostring GetFullSQLType()
const;
6855 unsigned int GetSubType()
const;
6862 CharsetForm GetCharsetForm()
const;
6873 unsigned int GetSize()
const;
6880 int GetScale()
const;
6887 int GetPrecision()
const;
6894 int GetFractionalPrecision()
const;
6901 int GetLeadingPrecision()
const;
6913 PropertyFlags GetPropertyFlags()
const;
6920 bool IsNullable()
const;
6931 bool IsCharSemanticUsed()
const;
6972 typedef void (*NotifyHandlerProc) (
Event &evt);
6982 ObjectChanges = OCI_CNT_OBJECTS,
6984 RowChanges = OCI_CNT_ROWS,
6986 DatabaseChanges = OCI_CNT_DATABASES,
6988 AllChanges = OCI_CNT_ALL
7022 void Register(
const Connection &connection,
const ostring& name, ChangeTypes changeTypes, NotifyHandlerProc handler,
unsigned int port = 0,
unsigned int timeout = 0);
7045 void Watch(
const ostring& sql);
7059 unsigned int GetTimeout()
const;
7066 unsigned int GetPort()
const;
7096 friend class Environment;
7108 DatabaseStart = OCI_ENT_STARTUP,
7110 DatabaseShutdown = OCI_ENT_SHUTDOWN,
7112 DatabaseShutdownAny = OCI_ENT_SHUTDOWN_ANY,
7114 DatabaseDrop = OCI_ENT_DROP_DATABASE,
7116 Unregister = OCI_ENT_DEREGISTER,
7118 ObjectChanged = OCI_ENT_OBJECT_CHANGED
7138 ObjectInserted = OCI_ONT_INSERT,
7140 ObjectUpdated = OCI_ONT_UPDATE,
7142 ObjectDeleted = OCI_ONT_DELETE,
7144 ObjectAltered = OCI_ONT_ALTER,
7146 ObjectDropped = OCI_ONT_DROP,
7148 ObjectGeneric = OCI_ONT_GENERIC
7175 ObjectEvent GetObjectEvent()
const;
7182 ostring GetDatabaseName()
const;
7192 ostring GetObjectName()
const;
7271 void SetName(
const ostring& value);
7296 void SetAddress(
const ostring& value);
7324 Ready = OCI_AMS_READY,
7326 Waiting = OCI_AMS_WAITING,
7328 Processed = OCI_AMS_PROCESSED,
7330 Expired = OCI_AMS_EXPIRED
7399 void SetPayload(
const T &value);
7409 Date GetEnqueueTime()
const;
7416 int GetAttemptCount()
const;
7423 MessageState GetState()
const;
7445 int GetExpiration()
const;
7466 void SetExpiration(
int value);
7476 int GetEnqueueDelay()
const;
7500 void SetEnqueueDelay(
int value);
7510 int GetPriority()
const;
7524 void SetPriority(
int value);
7535 Raw GetOriginalID()
const;
7548 void SetOriginalID(
const Raw &value);
7558 ostring GetCorrelation()
const;
7570 void SetCorrelation(
const ostring& value);
7585 ostring GetExceptionQueue()
const;
7613 void SetExceptionQueue(
const ostring& value);
7623 Agent GetSender()
const;
7632 void SetSender(
const Agent &agent);
7645 void SetConsumers(std::vector<Agent> &agents);
7671 Before = OCI_ASD_BEFORE,
7693 Immediate = OCI_AMV_IMMEDIATE,
7695 OnCommit = OCI_AMV_ON_COMMIT
7737 void Put(
const Message &message);
7747 EnqueueVisibility GetVisibility()
const;
7759 void SetVisibility(EnqueueVisibility value);
7769 EnqueueMode GetMode()
const;
7789 void SetMode(EnqueueMode value);
7801 Raw GetRelativeMsgID()
const;
7816 void SetRelativeMsgID(
const Raw &value);
7828 friend class Environment;
7839 typedef void (*NotifyAQHandlerProc) (
Dequeue &dequeue);
7849 Browse = OCI_ADM_BROWSE,
7851 Locked = OCI_ADM_LOCKED,
7853 Remove = OCI_ADM_REMOVE,
7855 Confirm = OCI_ADM_REMOVE_NODATA
7875 Immediate = OCI_AMV_IMMEDIATE,
7877 OnCommit = OCI_AMV_ON_COMMIT
7897 FirstMessage = OCI_ADN_FIRST_MSG,
7899 NextMessage = OCI_ADN_NEXT_MSG,
7902 NextTransaction = OCI_ADN_NEXT_TRANSACTION
7954 Agent Listen(
int timeout);
7977 void SetConsumer(
const ostring& value);
7987 ostring GetCorrelation()
const;
8000 void SetCorrelation(
const ostring& value);
8010 Raw GetRelativeMsgID()
const;
8019 void SetRelativeMsgID(
const Raw &value);
8029 DequeueVisibility GetVisibility()
const;
8045 void SetVisibility(DequeueVisibility value);
8055 DequeueMode GetMode()
const;
8067 void SetMode(DequeueMode value);
8077 NavigationMode GetNavigation()
const;
8098 void SetNavigation(NavigationMode value);
8108 int GetWaitTime()
const;
8127 void SetWaitTime(
int value);
8136 void SetAgents(std::vector<Agent> &agents);
8154 void Subscribe(
unsigned int port,
unsigned int timeout, NotifyAQHandlerProc handler);
8188 NormalQueue = OCI_AQT_NORMAL,
8190 ExceptionQueue = OCI_AQT_EXCEPTION,
8192 NonPersistentQueue = OCI_AQT_NON_PERSISTENT
8228 static void Create(
const Connection &connection,
const ostring& queue,
const ostring& table, QueueType type = NormalQueue,
8229 unsigned int maxRetries = 0,
unsigned int retryDelay = 0,
unsigned int retentionTime = 0,
8230 bool dependencyTracking =
false,
const ostring& comment = OTEXT(
""));
8253 unsigned int maxRetries= 0,
unsigned int retryDelay= 0,
8254 unsigned int retentionTime= 0,
const ostring& comment = OTEXT(
""));
8290 static void Start(
const Connection &connection,
const ostring& queue,
bool enableEnqueue =
true,
bool enableDequeue =
true);
8310 static void Stop(
const Connection &connection,
const ostring& queue,
bool stopEnqueue =
true,
bool stopDequeue =
true,
bool wait =
true);
8331 None = OCI_AGM_NONE,
8334 Transactionnal = OCI_AGM_TRANSACTIONNAL
8355 Buffered = OCI_APM_BUFFERED,
8357 Persistent = OCI_APM_PERSISTENT,
8405 static void Create(
const Connection &connection,
const ostring& table,
const ostring& payloadType,
bool multipleConsumers,
8406 const ostring& storageClause = OTEXT(
""),
const ostring& sortList = OTEXT(
""),
8407 GroupingMode groupingMode = None,
const ostring& comment = OTEXT(
""),
8408 unsigned int primaryInstance = 0,
unsigned int secondaryInstance = 0,
8409 const ostring& compatible = OTEXT(
""));
8429 static void Alter(
const Connection &connection,
const ostring& table,
const ostring& comment,
unsigned int primaryInstance = 0,
unsigned int secondaryInstance = 0);
8451 static void Drop(
const Connection &connection,
const ostring& table,
bool force =
true);
8476 static void Purge(
const Connection &connection,
const ostring& table, PurgeMode mode,
const ostring& condition = OTEXT(
""),
bool block =
true);
8517 Default = OCI_DCM_DEFAULT,
8519 Force = OCI_DCM_FORCE
8539 ResultComplete = OCI_DPR_COMPLETE,
8541 ResultError = OCI_DPR_ERROR,
8543 ResultFull = OCI_DPR_FULL ,
8545 ResultPartial = OCI_DPR_PARTIAL,
8547 ResultEmpty = OCI_DPR_EMPTY
8598 void SetColumn(
unsigned int colIndex,
const ostring& name,
unsigned int maxSize,
const ostring& format = OTEXT(
""));
8631 void SetEntry(
unsigned int rowIndex,
unsigned int colIndex,
const T& value,
bool complete =
true);
8737 void SetCurrentRows(
unsigned int value);
8747 unsigned int GetCurrentRows()
const;
8757 unsigned int GetMaxRows()
const;
8767 unsigned int GetRowCount()
const;
8781 unsigned int GetAffectedRows()
const;
8796 void SetDateFormat(
const ostring& format);
8824 void SetParallel(
bool value);
8840 void SetNoLog(
bool value);
8855 void SetCacheSize(
unsigned int value);
8867 void SetBufferSize(
unsigned int value);
8882 void SetConversionMode(ConversionMode value);
8912 unsigned int GetErrorColumn();
8947 unsigned int GetErrorRow();
8952 #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.
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.
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.
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.
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.
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)
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.