45 #ifndef OCILIBCPP_H_INCLUDED
46 #define OCILIBCPP_H_INCLUDED
173 typedef std::basic_string<otext, std::char_traits<otext>, std::allocator<otext> >
ostring;
191 typedef std::vector<unsigned char>
Raw;
233 #include "ocilib_core.hpp"
249 Oracle9iR1 = OCI_9_0,
250 Oracle9iR2 = OCI_9_2,
251 Oracle10gR1 = OCI_10_1,
252 Oracle10gR2 = OCI_10_2,
253 Oracle11gR1 = OCI_11_1,
254 Oracle11gR2 = OCI_11_2,
255 Oracle12cR1 = OCI_12_1
421 LobBinary = OCI_BLOB,
423 LobCharacter = OCI_CLOB,
425 LobNationalCharacter = OCI_NCLOB
446 LongBinary = OCI_BLONG,
448 LongCharacter = OCI_CLONG
499 template<
class TResultType>
500 friend TResultType
Check(TResultType result);
584 unsigned int GetRow()
const;
594 virtual const char *
what()
const throw();
613 unsigned int _errLib;
614 unsigned int _errOracle;
629 template<
class THandleType>
642 SourceInstance = OCI_HES_INSTANCE,
644 SourceDatabase = OCI_HES_DATABASE,
646 SourceNode = OCI_HES_NODE,
648 SourceService = OCI_HES_SERVICE,
650 SourceServiceMember = OCI_HES_SERVICE_MEMBER,
652 SourceASMInstance = OCI_HES_ASM_INSTANCE,
654 SourcePreConnect = OCI_HES_PRECONNECT
674 EventDown = OCI_HET_DOWN,
696 Default = OCI_ENV_DEFAULT,
698 Threaded = OCI_ENV_THREADED,
700 Events = OCI_ENV_EVENTS
720 ImportLinkage = OCI_IMPORT_MODE_LINKAGE,
722 ImportRuntime = OCI_IMPORT_MODE_RUNTIME
742 CharsetAnsi = OCI_CHAR_ANSI,
744 CharsetWide = OCI_CHAR_WIDE
764 SessionDefault = OCI_SESSION_DEFAULT,
766 SessionXa = OCI_SESSION_XA,
768 SessionSysDba = OCI_SESSION_SYSDBA,
770 SessionSysOper = OCI_SESSION_SYSOPER
790 StartOnly = OCI_DB_SPM_START,
792 StartMount = OCI_DB_SPM_MOUNT,
794 StartOpen = OCI_DB_SPM_OPEN,
796 StartFull = OCI_DB_SPM_FULL
816 StartDefault = OCI_DB_SPF_DEFAULT,
818 StartForce = OCI_DB_SPF_FORCE,
820 StartRestrict = OCI_DB_SPF_RESTRICT
840 ShutdownOnly = OCI_DB_SDM_SHUTDOWN,
842 ShutdownClose = OCI_DB_SDM_CLOSE,
844 ShutdownDismount = OCI_DB_SDM_DISMOUNT,
846 ShutdownFull = OCI_DB_SDM_FULL
867 ShutdowntDefault = OCI_DB_SDF_DEFAULT,
870 ShutdowTrans = OCI_DB_SDF_TRANS,
874 ShutdownTransLocal = OCI_DB_SDF_TRANS_LOCAL,
877 ShutdownImmediate = OCI_DB_SDF_IMMEDIATE,
883 ShutdownAbort = OCI_DB_SDF_ABORT
902 typedef void(*HAHandlerProc) (
Connection &con, HAEventSource eventSource, HAEventType eventType,
Timestamp &time);
937 static void Cleanup();
968 static bool Initialized();
987 static unsigned int GetCompileMajorVersion();
994 static unsigned int GetCompileMinorVersion();
1001 static unsigned int GetCompileRevisionVersion();
1019 static unsigned int GetRuntimeMajorVersion();
1026 static unsigned int GetRuntimeMinorVersion();
1033 static unsigned int GetRuntimeRevisionVersion();
1045 static void EnableWarnings(
bool value);
1122 const ostring& spfile = OTEXT(
""));
1182 static void SetHAHandler(HAHandlerProc handler);
1188 friend class Environment;
1192 static unsigned int TAFHandler(
OCI_Connection *pConnection,
unsigned int type,
unsigned int event);
1193 static void NotifyHandler(
OCI_Event *pEvent);
1194 static void NotifyHandlerAQ(
OCI_Dequeue *pDequeue);
1196 template <
class TCallbackType>
1197 static TCallbackType GetUserCallback(
AnyPointer ptr);
1199 template <
class TCallbackType>
1200 static void SetUserCallback(
AnyPointer ptr, TCallbackType callback);
1202 template <
class THandleType>
1203 static void SetSmartHandle(
AnyPointer ptr, THandleType handle);
1205 template <
class THandleType>
1206 static THandleType GetSmartHandle(
AnyPointer ptr);
1208 static Handle * GetEnvironmentHandle();
1210 static Environment& GetInstance();
1214 void SelfInitialize(EnvironmentFlags mode,
const ostring& libpath);
1218 EnvironmentHandle _handle;
1219 ConcurrentMap<AnyPointer, Handle *> _handles;
1220 ConcurrentMap<AnyPointer, CallbackPointer> _callbacks;
1221 EnvironmentFlags _mode;
1428 ConnectionPool = OCI_POOL_CONNECTION,
1430 SessionPool = OCI_POOL_SESSION
1467 unsigned int minSize,
unsigned int maxSize,
unsigned int increment = 1,
1489 unsigned int minSize,
unsigned int maxSize,
unsigned int increment = 1,
1540 unsigned int GetTimeout()
const;
1555 void SetTimeout(
unsigned int value);
1566 bool GetNoWait()
const;
1580 void SetNoWait(
bool value);
1587 unsigned int GetBusyConnectionsCount()
const;
1594 unsigned int GetOpenedConnectionsCount()
const;
1601 unsigned int GetMinSize()
const;
1608 unsigned int GetMaxSize()
const;
1615 unsigned int GetIncrement()
const;
1625 unsigned int GetStatementCacheSize()
const;
1634 void SetStatementCacheSize(
unsigned int value);
1646 friend class Environment;
1647 friend class Exception;
1658 template<
class TLobObjectType,
int TLobOracleType>
1660 template <
class TDataType>
1672 FailoverRequestSession = OCI_FOT_SESSION,
1674 FailoverRequestSelect = OCI_FOT_SELECT
1694 FailoverEventEnd = OCI_FOE_END,
1696 FailoverEventAbort = OCI_FOE_ABORT,
1698 FailoverEventReauthentificate = OCI_FOE_REAUTH,
1700 FailoverEventBegin = OCI_FOE_BEGIN,
1702 FailoverEventError = OCI_FOE_ERROR
1722 FailoverOk = OCI_FOC_OK,
1724 FailoverRetry = OCI_FOC_RETRY
1744 TraceIdentity = OCI_TRC_IDENTITY,
1746 TraceModule = OCI_TRC_MODULE,
1748 TraceAction = OCI_TRC_ACTION,
1750 TraceDetail = OCI_TRC_DETAIL
1875 void SetAutoCommit(
bool enabled);
1882 bool GetAutoCommit()
const;
1892 bool IsServerAlive()
const;
1902 bool PingServer()
const;
1912 ostring GetConnectionString()
const;
1942 ostring GetServerVersion()
const;
1959 unsigned int GetServerMajorVersion()
const;
1966 unsigned int GetServerMinorVersion()
const;
1973 unsigned int GetServerRevisionVersion()
const;
1982 void ChangePassword(
const ostring& newPwd);
1989 ostring GetSessionTag()
const;
2005 void SetSessionTag(
const ostring& tag);
2027 void SetTransaction(
const Transaction &transaction);
2093 void EnableServerOutput(
unsigned int bufsize,
unsigned int arrsize,
unsigned int lnsize);
2103 void DisableServerOutput();
2113 bool GetServerOutput(
ostring &line)
const;
2120 void GetServerOutput(std::vector<ostring> &lines)
const;
2236 unsigned int GetStatementCacheSize()
const;
2248 void SetStatementCacheSize(
unsigned int value);
2266 unsigned int GetDefaultLobPrefetchSize()
const;
2292 void SetDefaultLobPrefetchSize(
unsigned int value);
2302 bool IsTAFCapable()
const;
2317 void SetTAFHandler(TAFHandlerProc handler);
2360 Unknown = OCI_UNKNOWN,
2364 Tight = OCI_TRS_TIGHT,
2366 Loose = OCI_TRS_LOOSE,
2372 Serializable = OCI_TRS_SERIALIZABLE
2449 unsigned int GetTimeout()
const;
2467 friend class BindArray;
2469 template <
class TDataType>
2480 static Date SysDate();
2510 bool IsValid()
const;
2517 int GetYear()
const;
2524 void SetYear(
int value);
2531 int GetMonth()
const;
2538 void SetMonth(
int value);
2552 void SetDay(
int value);
2559 int GetHours()
const;
2566 void SetHours(
int value);
2573 int GetMinutes()
const;
2580 void SetMinutes(
int value);
2587 int GetSeconds()
const;
2594 void SetSeconds(
int value);
2603 int DaysBetween(
const Date& other)
const;
2614 void SetDate(
int year,
int month,
int day);
2625 void SetTime(
int hour,
int min,
int sec);
2639 void SetDateTime(
int year,
int month,
int day,
int hour,
int min,
int sec);
2650 void GetDate(
int &year,
int &month,
int &day)
const;
2661 void GetTime(
int &hour,
int &min,
int &sec)
const;
2675 void GetDateTime(
int &year,
int &month,
int &day,
int &hour,
int &min,
int &sec)
const;
2684 void AddDays(
int days);
2693 void AddMonths(
int months);
2709 Date LastDay()
const;
2735 void FromString(
const ostring& str,
const ostring& format = OTEXT(
""));
2771 Date& operator ++ ();
2778 Date operator ++ (
int);
2785 Date& operator -- ();
2792 Date operator -- (
int);
2799 Date operator + (
int value);
2806 Date operator - (
int value);
2813 Date& operator += (
int value);
2820 Date& operator -= (
int value);
2827 bool operator == (
const Date& other)
const;
2834 bool operator != (
const Date& other)
const;
2841 bool operator > (
const Date& other)
const;
2848 bool operator < (
const Date& other)
const;
2855 bool operator >= (
const Date& other)
const;
2862 bool operator <= (
const Date& other)
const;
2866 int Compare(
const Date& other)
const;
2882 friend class Environment;
2885 friend class BindArray;
2887 template <
class TDataType>
2900 YearMonth = OCI_INTERVAL_YM,
2902 DaySecond = OCI_INTERVAL_DS
2955 bool IsValid()
const;
2965 int GetYear()
const;
2975 void SetYear(
int value);
2985 int GetMonth()
const;
2995 void SetMonth(
int value);
3015 void SetDay(
int value);
3025 int GetHours()
const;
3035 void SetHours(
int value);
3045 int GetMinutes()
const;
3055 void SetMinutes(
int value);
3065 int GetSeconds()
const;
3075 void SetSeconds(
int value);
3082 int GetMilliSeconds()
const;
3089 void SetMilliSeconds(
int value);
3105 void GetDaySecond(
int &day,
int &hour,
int &min,
int &sec,
int &fsec)
const;
3121 void SetDaySecond(
int day,
int hour,
int min,
int sec,
int fsec);
3134 void GetYearMonth(
int &year,
int &month)
const;
3147 void SetYearMonth(
int year,
int month);
3156 void UpdateTimeZone(
const ostring& timeZone);
3168 void FromString(
const ostring& data);
3178 ostring ToString(
int leadingPrecision,
int fractionPrecision)
const;
3227 bool operator == (
const Interval& other)
const;
3234 bool operator != (
const Interval& other)
const;
3241 bool operator > (
const Interval& other)
const;
3248 bool operator < (
const Interval& other)
const;
3255 bool operator >= (
const Interval& other)
const;
3262 bool operator <= (
const Interval& other)
const;
3266 int Compare(
const Interval& other)
const;
3281 friend class Environment;
3284 friend class BindArray;
3287 template <
class TDataType>
3300 NoTimeZone = OCI_TIMESTAMP,
3302 WithTimeZone = OCI_TIMESTAMP_TZ,
3304 WithLocalTimeZone = OCI_TIMESTAMP_LTZ
3376 bool IsValid()
const;
3383 int GetYear()
const;
3390 void SetYear(
int value);
3397 int GetMonth()
const;
3404 void SetMonth(
int value);
3418 void SetDay(
int value);
3425 int GetHours()
const;
3432 void SetHours(
int value);
3439 int GetMinutes()
const;
3446 void SetMinutes(
int value);
3453 int GetSeconds()
const;
3460 void SetSeconds(
int value);
3467 int GetMilliSeconds()
const;
3474 void SetMilliSeconds(
int value);
3485 void GetDate(
int &year,
int &month,
int &day)
const;
3497 void GetTime(
int &hour,
int &min,
int &sec,
int &fsec)
const;
3508 void SetDate(
int year,
int month,
int day);
3520 void SetTime(
int hour,
int min,
int sec,
int fsec);
3535 void GetDateTime(
int &year,
int &month,
int &day,
int &hour,
int &min,
int &sec,
int &fsec)
const;
3551 void SetDateTime(
int year,
int month,
int day,
int hour,
int min,
int sec,
int fsec,
const ostring& timeZone = OTEXT(
""));
3572 void SetTimeZone(
const ostring& timeZone);
3582 void GetTimeZoneOffset(
int &hour,
int &min)
const;
3609 void FromString(
const ostring& data,
const ostring& format = OCI_STRING_FORMAT_DATE);
3735 bool operator == (
const Timestamp& other)
const;
3742 bool operator != (
const Timestamp& other)
const;
3749 bool operator > (
const Timestamp& other)
const;
3756 bool operator < (
const Timestamp& other)
const;
3763 bool operator >= (
const Timestamp& other)
const;
3770 bool operator <= (
const Timestamp& other)
const;
3774 int Compare(
const Timestamp& other)
const;
3786 template<
class TLobObjectType,
int TLobOracleType>
3791 friend class BindArray;
3793 template <
class TDataType>
3827 TLobObjectType Read(
unsigned int length);
3839 unsigned int Write(
const TLobObjectType &content);
3851 unsigned int Append(
const TLobObjectType& content);
3860 void Append(
const Lob& other);
3876 bool Seek(
SeekMode seekMode, big_uint offset);
3890 big_uint GetOffset()
const;
3897 big_uint GetLength()
const;
3904 big_uint GetMaxSize()
const;
3917 big_uint GetChunkSize()
const;
3933 void Truncate(big_uint length);
3950 big_uint Erase(big_uint offset, big_uint length);
3965 void Copy(
Lob &dest, big_uint offset, big_uint offsetDest, big_uint length)
const;
3972 bool IsTemporary()
const;
4023 void EnableBuffering(
bool value);
4037 Lob& operator += (
const Lob& other);
4044 bool operator == (
const Lob& other)
const;
4051 bool operator != (
const Lob& other)
const;
4055 bool Equals(
const Lob &other)
const;
4106 friend class BindArray;
4108 template <
class TDataType>
4158 Raw Read(
unsigned int size);
4174 bool Seek(
SeekMode seekMode, big_uint offset);
4184 bool Exists()
const;
4191 big_uint GetOffset()
const;
4198 big_uint GetLength()
const;
4254 bool IsOpened()
const;
4268 bool operator == (
const File& other)
const;
4275 bool operator != (
const File& other)
const;
4279 bool Equals(
const File &other)
const;
4295 template <
class TDataType>
4308 Table = OCI_TIF_TABLE,
4310 View = OCI_TIF_VIEW,
4368 unsigned int GetColumnCount()
const;
4384 Column GetColumn(
unsigned int index)
const;
4402 friend class BindArray;
4404 template <
class TDataType>
4418 Persistent = OCI_OBJ_PERSISTENT,
4420 Transient = OCI_OBJ_TRANSIENT,
4422 Value = OCI_OBJ_VALUE
4457 bool IsAttributeNull(
const ostring& name)
const;
4466 void SetAttributeNull(
const ostring& name);
4501 template<
class TDataType>
4502 TDataType Get(
const ostring& name)
const;
4517 template<
class TDataType>
4518 void Get(
const ostring& name, TDataType &value)
const;
4533 template<
class TDataType>
4549 template<
class TDataType>
4550 void Set(
const ostring& name,
const TDataType &value);
4582 friend class BindArray;
4584 template <
class TDataType>
4620 Object GetObject()
const;
4627 bool IsReferenceNull()
const;
4637 void SetReferenceNull();
4665 template <
class TDataType>
4670 friend class BindArray;
4672 template <
class TOtherDataType>
4673 friend class CollectionIterator;
4675 template <
class TOtherDataType>
4690 Varray = OCI_COLL_VARRAY,
4692 NestedTable = OCI_COLL_NESTED_TABLE
4732 unsigned int GetMax()
const;
4739 unsigned int GetSize()
const;
4751 unsigned int GetCount()
const;
4760 void Truncate(
unsigned int size);
4780 bool IsElementNull(
unsigned int index)
const;
4792 void SetElementNull(
unsigned int index);
4811 bool Delete(
unsigned int index)
const;
4820 TDataType Get(
unsigned int index)
const;
4830 void Set(
unsigned int index,
const TDataType &value);
4840 void Append(
const TDataType &data);
4877 Element(Collection &coll, unsigned int pos);
4878 operator TDataType() const;
4879 Element& operator = (TDataType value);
4880 bool IsNull() const;
4893 class
Iterator :
public std::iterator<std::bidirectional_iterator_tag, TDataType>
4901 bool operator== (
const Iterator& other);
4902 bool operator!= (
const Iterator& other);
4943 Element operator [] (
unsigned int index);
4947 TDataType GetElem(
OCI_Elem *elem, Handle *parent)
const;
4949 void SetElem(
OCI_Elem *elem,
const TDataType &value);
4961 template<
class TLongObjectType,
int TLongOracleType>
4966 friend class BindArray;
4997 unsigned int Write(
const TLongObjectType& content);
5004 unsigned int GetLength()
const;
5011 TLongObjectType GetContent()
const;
5043 InOut = OCI_BDM_IN_OUT
5088 unsigned int GetSubType()
const;
5099 unsigned int GetDataCount()
const;
5128 void SetDataNull(
bool value,
unsigned int index = 1);
5144 bool IsDataNull(
unsigned int index = 1)
const;
5182 friend class Exception;
5184 template<
class TLongObjectType,
int TLongOracleType>
5187 friend class BindObject;
5199 TypeSelect = OCI_CST_SELECT,
5201 TypeUpdate = OCI_CST_UPDATE,
5203 TypeDelete = OCI_CST_DELETE,
5205 TypeInsert = OCI_CST_INSERT,
5207 TypeCreate = OCI_CST_CREATE,
5209 TypeDrop = OCI_CST_DROP,
5211 TypeAlter = OCI_CST_ALTER,
5213 TypeBegin = OCI_CST_BEGIN,
5215 TypeDeclare = OCI_CST_DECLARE,
5217 TypeCall = OCI_CST_CALL
5237 FetchForward = OCI_SFM_DEFAULT,
5239 FetchScrollable = OCI_SFM_SCROLLABLE
5259 BindByPosition = OCI_BIND_BY_POS,
5261 BindByName = OCI_BIND_BY_NAME
5281 LongExplicit = OCI_LONG_EXPLICIT,
5283 LongImplicit = OCI_LONG_IMPLICIT
5353 void Describe(
const ostring& sql);
5378 void Parse(
const ostring& sql);
5390 void Prepare(
const ostring& sql);
5397 void ExecutePrepared();
5406 void Execute(
const ostring& sql);
5425 template<
class TFetchCallback>
5426 unsigned int ExecutePrepared(TFetchCallback callback);
5448 template<
class TAdapter,
class TFetchCallback>
5449 unsigned int ExecutePrepared(TFetchCallback callback, TAdapter adapter);
5469 template<
class TFetchCallback>
5470 unsigned int Execute(
const ostring& sql, TFetchCallback callback);
5493 template<
class TAdapter,
class TFetchCallback>
5494 unsigned int Execute(
const ostring& sql, TFetchCallback callback, TAdapter adapter);
5510 unsigned int GetAffectedRows()
const;
5579 void SetBindArraySize(
unsigned int size);
5586 unsigned int GetBindArraySize()
const;
5603 void AllowRebinding(
bool value);
5613 bool IsRebindingAllowed()
const;
5631 unsigned int GetBindIndex(
const ostring& name)
const;
5638 unsigned int GetBindCount()
const;
5654 BindInfo GetBind(
unsigned int index)
const;
5687 template <
class TDataType>
5711 template <
class TDataType,
class TExtraInfo>
5725 template <
class TDataType>
5747 template <
class TDataType>
5769 template <
class TDataType>
5784 template <
class TDataType>
5809 template <
class TDataType,
class TExtraInfo>
5832 template <
class TDataType>
5833 void Register(
const ostring& name);
5852 template <
class TDataType,
class TExtraInfo>
5853 void Register(
const ostring& name, TExtraInfo& extraInfo);
5873 template <
class TDataType,
class TExtraInfo>
5874 void Register(
const ostring& name, TExtraInfo extraInfo);
5892 unsigned int GetSqlErrorPos()
const;
5942 void SetFetchSize(
unsigned int value);
5952 unsigned int GetFetchSize()
const;
5964 void SetPrefetchSize(
unsigned int value);
5974 unsigned int GetPrefetchSize()
const;
5994 void SetPrefetchMemory(
unsigned int value);
6004 unsigned int GetPrefetchMemory()
const;
6013 void SetLongMaxSize(
unsigned int value);
6023 unsigned int GetLongMaxSize()
const;
6056 unsigned int GetSQLCommand()
const;
6077 void GetBatchErrors(std::vector<Exception> &exceptions);
6081 static bool IsResultsetHandle(Handle *handle);
6085 BindsHolder *GetBindsHolder(
bool allocate);
6087 void ReleaseResultsets();
6095 template <
typename TBindMethod,
class TDataType>
6098 template <
typename TBindMethod,
class TObjectType,
class TDataType>
6101 template <
typename TBindMethod,
class TObjectType,
class TDataType>
6102 void Bind (TBindMethod &method,
const ostring& name, std::vector<TObjectType> &values, BindValue<TDataType> datatype,
BindInfo::BindDirection mode);
6104 template <
typename TBindMethod,
class TObjectType,
class TDataType,
class TElemType>
6105 void Bind (TBindMethod &method,
const ostring& name, std::vector<TObjectType> &values, BindValue<TDataType> datatype,
BindInfo::BindDirection mode, TElemType type);
6107 template<
typename TFetchCallback>
6108 unsigned int Fetch(TFetchCallback callback);
6110 template<
typename TAdapter,
typename TFetchCallback>
6111 unsigned int Fetch(TFetchCallback callback, TAdapter adapter);
6134 SeekAbsolute = OCI_SFD_ABSOLUTE,
6136 SeekRelative = OCI_SFD_RELATIVE
6160 template<
class TDataType>
6161 TDataType Get(
unsigned int index)
const;
6176 template<
class TDataType>
6177 void Get(
unsigned int index, TDataType &value)
const;
6191 template<
class TDataType>
6192 TDataType Get(
const ostring& name)
const;
6204 template<
class TDataType>
6205 void Get(
const ostring &name, TDataType &value)
const;
6221 template<
class TDataType,
class TAdapter>
6222 bool Get(TDataType& value, TAdapter adapter)
const;
6239 template<
typename TCallback>
6240 unsigned int ForEach(TCallback callback);
6264 template<
typename TAdapter,
typename TCallback>
6265 unsigned int ForEach(TCallback callback, TAdapter adapter);
6343 bool Seek(
SeekMode mode,
int offset);
6350 unsigned int GetCount()
const;
6362 unsigned int GetCurrentRow()
const;
6377 unsigned int GetColumnIndex(
const ostring& name)
const;
6384 unsigned int GetColumnCount()
const;
6396 Column GetColumn(
unsigned int index)
const;
6420 bool IsColumnNull(
unsigned int index)
const;
6429 bool IsColumnNull(
const ostring& name)
const;
6443 bool operator ++ (
int);
6450 bool operator -- (
int);
6458 bool operator += (
int offset);
6466 bool operator -= (
int offset);
6495 NoFlags = OCI_CPF_NONE,
6498 IsIdentity = OCI_CPF_IS_IDENTITY,
6502 IsGeneratedAlways = OCI_CPF_IS_GEN_ALWAYS,
6505 IsGeneratedByDefaultOnNull = OCI_CPF_IS_GEN_BY_DEFAULT_ON_NULL
6538 ostring GetFullSQLType()
const;
6564 unsigned int GetSubType()
const;
6582 unsigned int GetSize()
const;
6589 int GetScale()
const;
6596 int GetPrecision()
const;
6603 int GetFractionalPrecision()
const;
6610 int GetLeadingPrecision()
const;
6629 bool IsNullable()
const;
6640 bool IsCharSemanticUsed()
const;
6681 typedef void (*NotifyHandlerProc) (
Event &evt);
6692 ObjectChanges = OCI_CNT_OBJECTS,
6694 RowChanges = OCI_CNT_ROWS,
6696 DatabaseChanges = OCI_CNT_DATABASES,
6698 AllChanges = OCI_CNT_ALL
6732 void Register(
const Connection &connection,
const ostring& name,
ChangeTypes changeTypes, NotifyHandlerProc handler,
unsigned int port = 0,
unsigned int timeout = 0);
6755 void Watch(
const ostring& sql);
6769 unsigned int GetTimeout()
const;
6776 unsigned int GetPort()
const;
6806 friend class Environment;
6818 DatabaseStart = OCI_ENT_STARTUP,
6820 DatabaseShutdown = OCI_ENT_SHUTDOWN,
6822 DatabaseShutdownAny = OCI_ENT_SHUTDOWN_ANY,
6824 DatabaseDrop = OCI_ENT_DROP_DATABASE,
6826 Unregister = OCI_ENT_DEREGISTER,
6828 ObjectChanged = OCI_ENT_OBJECT_CHANGED
6848 ObjectInserted = OCI_ONT_INSERT,
6850 ObjectUpdated = OCI_ONT_UPDATE,
6852 ObjectDeleted = OCI_ONT_DELETE,
6854 ObjectAltered = OCI_ONT_ALTER,
6856 ObjectDropped = OCI_ONT_DROP,
6858 ObjectGeneric = OCI_ONT_GENERIC
6892 ostring GetDatabaseName()
const;
6902 ostring GetObjectName()
const;
6982 void SetName(
const ostring& value);
7007 void SetAddress(
const ostring& value);
7035 Ready = OCI_AMS_READY,
7037 Waiting = OCI_AMS_WAITING,
7039 Processed = OCI_AMS_PROCESSED,
7041 Expired = OCI_AMS_EXPIRED
7099 template <
class TPayloadType>
7100 TPayloadType GetPayload();
7109 template <
class TPayloadType>
7110 void SetPayload(
const TPayloadType &value);
7120 Date GetEnqueueTime()
const;
7127 int GetAttemptCount()
const;
7156 int GetExpiration()
const;
7177 void SetExpiration(
int value);
7187 int GetEnqueueDelay()
const;
7211 void SetEnqueueDelay(
int value);
7221 int GetPriority()
const;
7235 void SetPriority(
int value);
7246 Raw GetOriginalID()
const;
7259 void SetOriginalID(
const Raw &value);
7269 ostring GetCorrelation()
const;
7281 void SetCorrelation(
const ostring& value);
7296 ostring GetExceptionQueue()
const;
7324 void SetExceptionQueue(
const ostring& value);
7334 Agent GetSender()
const;
7343 void SetSender(
const Agent &agent);
7356 void SetConsumers(std::vector<Agent> &agents);
7382 Before = OCI_ASD_BEFORE,
7404 Immediate = OCI_AMV_IMMEDIATE,
7406 OnCommit = OCI_AMV_ON_COMMIT
7448 void Put(
const Message &message);
7512 Raw GetRelativeMsgID()
const;
7527 void SetRelativeMsgID(
const Raw &value);
7539 friend class Environment;
7550 typedef void (*NotifyAQHandlerProc) (
Dequeue &dequeue);
7560 Browse = OCI_ADM_BROWSE,
7562 Locked = OCI_ADM_LOCKED,
7564 Remove = OCI_ADM_REMOVE,
7566 Confirm = OCI_ADM_REMOVE_NODATA
7586 Immediate = OCI_AMV_IMMEDIATE,
7588 OnCommit = OCI_AMV_ON_COMMIT
7608 FirstMessage = OCI_ADN_FIRST_MSG,
7610 NextMessage = OCI_ADN_NEXT_MSG,
7613 NextTransaction = OCI_ADN_NEXT_TRANSACTION
7665 Agent Listen(
int timeout);
7688 void SetConsumer(
const ostring& value);
7698 ostring GetCorrelation()
const;
7711 void SetCorrelation(
const ostring& value);
7721 Raw GetRelativeMsgID()
const;
7730 void SetRelativeMsgID(
const Raw &value);
7819 int GetWaitTime()
const;
7838 void SetWaitTime(
int value);
7847 void SetAgents(std::vector<Agent> &agents);
7865 void Subscribe(
unsigned int port,
unsigned int timeout, NotifyAQHandlerProc handler);
7899 NormalQueue = OCI_AQT_NORMAL,
7901 ExceptionQueue = OCI_AQT_EXCEPTION,
7903 NonPersistentQueue = OCI_AQT_NON_PERSISTENT
7940 unsigned int maxRetries = 0,
unsigned int retryDelay = 0,
unsigned int retentionTime = 0,
7941 bool dependencyTracking =
false,
const ostring& comment = OTEXT(
""));
7964 unsigned int maxRetries= 0,
unsigned int retryDelay= 0,
7965 unsigned int retentionTime= 0,
const ostring& comment = OTEXT(
""));
8001 static void Start(
const Connection &connection,
const ostring& queue,
bool enableEnqueue =
true,
bool enableDequeue =
true);
8021 static void Stop(
const Connection &connection,
const ostring& queue,
bool stopEnqueue =
true,
bool stopDequeue =
true,
bool wait =
true);
8042 None = OCI_AGM_NONE,
8045 Transactionnal = OCI_AGM_TRANSACTIONNAL
8066 Buffered = OCI_APM_BUFFERED,
8068 Persistent = OCI_APM_PERSISTENT,
8116 static void Create(
const Connection &connection,
const ostring& table,
const ostring& payloadType,
bool multipleConsumers,
8117 const ostring& storageClause = OTEXT(
""),
const ostring& sortList = OTEXT(
""),
8119 unsigned int primaryInstance = 0,
unsigned int secondaryInstance = 0,
8120 const ostring& compatible = OTEXT(
""));
8140 static void Alter(
const Connection &connection,
const ostring& table,
const ostring& comment,
unsigned int primaryInstance = 0,
unsigned int secondaryInstance = 0);
8162 static void Drop(
const Connection &connection,
const ostring& table,
bool force =
true);
8228 Default = OCI_DCM_DEFAULT,
8230 Force = OCI_DCM_FORCE
8250 ResultComplete = OCI_DPR_COMPLETE,
8252 ResultError = OCI_DPR_ERROR,
8254 ResultFull = OCI_DPR_FULL ,
8256 ResultPartial = OCI_DPR_PARTIAL,
8258 ResultEmpty = OCI_DPR_EMPTY
8309 void SetColumn(
unsigned int colIndex,
const ostring& name,
unsigned int maxSize,
const ostring& format = OTEXT(
""));
8341 template <
class TDataType>
8342 void SetEntry(
unsigned int rowIndex,
unsigned int colIndex,
const TDataType& value,
bool complete =
true);
8448 void SetCurrentRows(
unsigned int value);
8458 unsigned int GetCurrentRows()
const;
8468 unsigned int GetMaxRows()
const;
8478 unsigned int GetRowCount()
const;
8492 unsigned int GetAffectedRows()
const;
8507 void SetDateFormat(
const ostring& format);
8535 void SetParallel(
bool value);
8551 void SetNoLog(
bool value);
8566 void SetCacheSize(
unsigned int value);
8578 void SetBufferSize(
unsigned int value);
8623 unsigned int GetErrorColumn();
8658 unsigned int GetErrorRow();
8663 #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.
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.
int GetOracleErrorCode() const
Return the Oracle error code.
Provides SQL bind informations.
TypeInfoTypeValues
Type of object information enumerated values.
EventTypeValues
Event type enumerated values.
LobTypeValues
Lob types enumerated values.
Enum< BindModeValues > BindMode
Bind Modes.
HAEventSourceValues
HA Event sources enumerated values.
int GetInternalErrorCode() const
Return the OCILIB error code.
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.
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.
Statement GetStatement() const
Return the statement within the error occurred.
Enum< DataTypeValues > DataType
Column data type.
OCI_Mutex * MutexHandle
Alias for an OCI_Mutex pointer.
struct OCI_XID OCI_XID
Global transaction identifier.
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.
friend TResultType Check(TResultType 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.
struct OCI_Dequeue OCI_Dequeue
OCILIB encapsulation of A/Q dequeuing operations.
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.
Class used for handling transient collection value. it is used internally by:
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 Enum template class providing some type safety to some extends for manipulating enum variabl...
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.
ostring GetMessage() const
Retrieve the error message.
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.
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.
Connection GetConnection() const
Return the connection within the error occurred.
void * AnyPointer
Alias for the generic void pointer.
ExceptionType GetType() const
Return the Exception type.
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.
ResultValues
Direct Operation Result enumerated values.
Flags< StartFlagsValues > StartFlags
Oracle instance start flags.
Object identifying the SQL data type INTERVAL.
Enum< FormatTypeValues > FormatType
Format type.
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.
virtual const char * what() const
Override the std::exception::what() method.
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.
Enum< CollectionTypeValues > CollectionType
Collection type.
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.
Iterator iterator
common iterator declaration
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.
STL compliant bi-directional iterator class.
Enum< NumericTypeValues > NumericType
Numeric data type.
void * CallbackPointer
Alias used for storing user callback method pointers.
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.
IntervalTypeValues
Interval types enumerated values.
POCI_THREAD ThreadProc
Thread callback.
ShutdownFlagsValues
Oracle instance shutdown flags enumerated values.
DequeueModeValues
Dequeue mode enumerated values.
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.
unsigned int GetRow() const
Return the row index which caused an error during statement execution.
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:
Object identifying the SQL data type DATE.
Enum< OpenModeValues > OpenMode
Open Modes.