29 #ifndef OCILIBCPP_H_INCLUDED 30 #define OCILIBCPP_H_INCLUDED 160 typedef std::basic_string<otext, std::char_traits<otext>, std::allocator<otext> >
ostring;
178 typedef std::vector<unsigned char>
Raw;
220 #include "ocilib_core.hpp" 236 Oracle9iR1 = OCI_9_0,
237 Oracle9iR2 = OCI_9_2,
238 Oracle10gR1 = OCI_10_1,
239 Oracle10gR2 = OCI_10_2,
240 Oracle11gR1 = OCI_11_1,
241 Oracle11gR2 = OCI_11_2,
242 Oracle12cR1 = OCI_12_1,
243 Oracle12cR2 = OCI_12_2,
244 Oracle18cR1 = OCI_18_1,
245 Oracle18cR2 = OCI_18_2,
246 Oracle18cR3 = OCI_18_3,
247 Oracle18cR4 = OCI_18_4
462 LobBinary = OCI_BLOB,
464 LobCharacter = OCI_CLOB,
466 LobNationalCharacter = OCI_NCLOB
486 LongBinary = OCI_BLONG,
488 LongCharacter = OCI_CLONG
539 friend T
Check(T result);
623 unsigned int GetRow()
const;
633 const char *
what()
const throw() override;
681 SourceInstance = OCI_HES_INSTANCE,
683 SourceDatabase = OCI_HES_DATABASE,
685 SourceNode = OCI_HES_NODE,
687 SourceService = OCI_HES_SERVICE,
689 SourceServiceMember = OCI_HES_SERVICE_MEMBER,
691 SourceASMInstance = OCI_HES_ASM_INSTANCE,
693 SourcePreConnect = OCI_HES_PRECONNECT
713 EventDown = OCI_HET_DOWN,
735 Default = OCI_ENV_DEFAULT,
737 Threaded = OCI_ENV_THREADED,
739 Events = OCI_ENV_EVENTS
759 ImportLinkage = OCI_IMPORT_MODE_LINKAGE,
761 ImportRuntime = OCI_IMPORT_MODE_RUNTIME
781 CharsetAnsi = OCI_CHAR_ANSI,
783 CharsetWide = OCI_CHAR_WIDE
803 SessionDefault = OCI_SESSION_DEFAULT,
805 SessionXa = OCI_SESSION_XA,
807 SessionSysDba = OCI_SESSION_SYSDBA,
809 SessionSysOper = OCI_SESSION_SYSOPER,
811 SessionSysAsm = OCI_SESSION_SYSASM,
813 SessionSysBkp = OCI_SESSION_SYSBKP,
815 SessionSysDgD = OCI_SESSION_SYSDGD,
817 SessionSysKmt = OCI_SESSION_SYSKMT,
819 SessionSysRac = OCI_SESSION_SYSRAC,
821 SessionPreAuth = OCI_SESSION_PRELIM_AUTH
841 StartOnly = OCI_DB_SPM_START,
843 StartMount = OCI_DB_SPM_MOUNT,
845 StartOpen = OCI_DB_SPM_OPEN,
847 StartFull = OCI_DB_SPM_FULL
867 StartDefault = OCI_DB_SPF_DEFAULT,
869 StartForce = OCI_DB_SPF_FORCE,
871 StartRestrict = OCI_DB_SPF_RESTRICT
891 ShutdownOnly = OCI_DB_SDM_SHUTDOWN,
893 ShutdownClose = OCI_DB_SDM_CLOSE,
895 ShutdownDismount = OCI_DB_SDM_DISMOUNT,
897 ShutdownFull = OCI_DB_SDM_FULL
918 ShutdowntDefault = OCI_DB_SDF_DEFAULT,
921 ShutdowTrans = OCI_DB_SDF_TRANS,
925 ShutdownTransLocal = OCI_DB_SDF_TRANS_LOCAL,
928 ShutdownImmediate = OCI_DB_SDF_IMMEDIATE,
934 ShutdownAbort = OCI_DB_SDF_ABORT
954 OracleClientBytes = OCI_MEM_ORACLE,
956 OcilibBytes = OCI_MEM_OCILIB,
958 AllBytes = OCI_MEM_ALL
977 typedef void(*HAHandlerProc) (
Connection &con, HAEventSource eventSource, HAEventType eventType,
Timestamp &time);
1014 static void Cleanup();
1049 static unsigned int GetCharMaxSize();
1058 static big_uint GetAllocatedBytes(AllocatedBytesFlags type);
1065 static bool Initialized();
1077 static OracleVersion GetCompileVersion();
1084 static unsigned int GetCompileMajorVersion();
1091 static unsigned int GetCompileMinorVersion();
1098 static unsigned int GetCompileRevisionVersion();
1109 static OracleVersion GetRuntimeVersion();
1116 static unsigned int GetRuntimeMajorVersion();
1123 static unsigned int GetRuntimeMinorVersion();
1130 static unsigned int GetRuntimeRevisionVersion();
1142 static void EnableWarnings(
bool value);
1175 static bool SetFormat(FormatType formatType,
const ostring& format);
1187 static ostring GetFormat(FormatType formatType);
1219 const ostring& spfile = OTEXT(
""));
1279 static void SetHAHandler(HAHandlerProc handler);
1285 friend class Environment;
1289 static unsigned int TAFHandler(
OCI_Connection *pConnection,
unsigned int type,
unsigned int event);
1290 static void NotifyHandler(
OCI_Event *pEvent);
1291 static void NotifyHandlerAQ(
OCI_Dequeue *pDequeue);
1297 static void SetUserCallback(
AnyPointer ptr, T callback);
1300 static void SetSmartHandle(
AnyPointer ptr, T handle);
1305 static Handle * GetEnvironmentHandle();
1307 static Environment& GetInstance();
1311 void SelfInitialize(EnvironmentFlags mode,
const ostring& libpath);
1315 EnvironmentHandle _handle;
1316 ConcurrentMap<AnyPointer, Handle *> _handles;
1317 ConcurrentMap<AnyPointer, CallbackPointer> _callbacks;
1318 EnvironmentFlags _mode;
1319 unsigned int _charMaxSize;
1373 static void Run(
ThreadHandle handle, ThreadProc func,
void *args);
1482 static void Create(
const ostring& name, ThreadKeyFreeProc freeProc =
nullptr);
1526 ConnectionPool = OCI_POOL_CONNECTION,
1528 SessionPool = OCI_POOL_SESSION
1565 unsigned int minSize,
unsigned int maxSize,
unsigned int increment = 1,
1587 unsigned int minSize,
unsigned int maxSize,
unsigned int increment = 1,
1638 unsigned int GetTimeout()
const;
1653 void SetTimeout(
unsigned int value);
1664 bool GetNoWait()
const;
1678 void SetNoWait(
bool value);
1685 unsigned int GetBusyConnectionsCount()
const;
1692 unsigned int GetOpenedConnectionsCount()
const;
1699 unsigned int GetMinSize()
const;
1706 unsigned int GetMaxSize()
const;
1713 unsigned int GetIncrement()
const;
1723 unsigned int GetStatementCacheSize()
const;
1732 void SetStatementCacheSize(
unsigned int value);
1744 friend class Environment;
1745 friend class Exception;
1756 template<
class,
int>
1773 TimeoutSend = OCI_NTO_SEND,
1778 TimeoutReceive = OCI_NTO_RECEIVE,
1783 TimeoutCall = OCI_NTO_CALL
1803 FailoverRequestSession = OCI_FOT_SESSION,
1805 FailoverRequestSelect = OCI_FOT_SELECT
1825 FailoverEventEnd = OCI_FOE_END,
1827 FailoverEventAbort = OCI_FOE_ABORT,
1829 FailoverEventReauthentificate = OCI_FOE_REAUTH,
1831 FailoverEventBegin = OCI_FOE_BEGIN,
1833 FailoverEventError = OCI_FOE_ERROR
1853 FailoverOk = OCI_FOC_OK,
1855 FailoverRetry = OCI_FOC_RETRY
1875 TraceIdentity = OCI_TRC_IDENTITY,
1877 TraceModule = OCI_TRC_MODULE,
1879 TraceAction = OCI_TRC_ACTION,
1881 TraceDetail = OCI_TRC_DETAIL
1900 typedef FailoverResult(*TAFHandlerProc) (
Connection &con, FailoverRequest failoverRequest, FailoverEvent failoverEvent);
2006 void SetAutoCommit(
bool enabled);
2013 bool GetAutoCommit()
const;
2023 bool IsServerAlive()
const;
2033 bool PingServer()
const;
2043 ostring GetConnectionString()
const;
2073 ostring GetServerVersion()
const;
2083 OracleVersion GetVersion()
const;
2090 unsigned int GetServerMajorVersion()
const;
2097 unsigned int GetServerMinorVersion()
const;
2104 unsigned int GetServerRevisionVersion()
const;
2113 void ChangePassword(
const ostring& newPwd);
2120 ostring GetSessionTag()
const;
2136 void SetSessionTag(
const ostring& tag);
2158 void SetTransaction(
const Transaction &transaction);
2191 bool SetFormat(FormatType formatType,
const ostring& format);
2203 ostring GetFormat(FormatType formatType);
2224 void EnableServerOutput(
unsigned int bufsize,
unsigned int arrsize,
unsigned int lnsize);
2234 void DisableServerOutput();
2244 bool GetServerOutput(
ostring &line)
const;
2251 void GetServerOutput(std::vector<ostring> &lines)
const;
2281 void SetTrace(SessionTrace trace,
const ostring& value);
2293 ostring GetTrace(SessionTrace trace)
const;
2366 unsigned int GetStatementCacheSize()
const;
2378 void SetStatementCacheSize(
unsigned int value);
2396 unsigned int GetDefaultLobPrefetchSize()
const;
2422 void SetDefaultLobPrefetchSize(
unsigned int value);
2438 unsigned int GetMaxCursors()
const;
2448 bool IsTAFCapable()
const;
2463 void SetTAFHandler(TAFHandlerProc handler);
2494 unsigned int GetTimeout(TimeoutType timeout);
2523 void SetTimeout(TimeoutType timeout,
unsigned int value);
2550 Unknown = OCI_UNKNOWN,
2554 Tight = OCI_TRS_TIGHT,
2556 Loose = OCI_TRS_LOOSE,
2562 Serializable = OCI_TRS_SERIALIZABLE
2632 TransactionFlags GetFlags()
const;
2639 unsigned int GetTimeout()
const;
2660 friend class BindArray;
2674 Number(
bool create =
false);
2690 Number(
const otext* str,
const otext* format = OTEXT(
""));
2722 void FromString(
const ostring& str,
const ostring& format = OTEXT(
""))
const;
2744 ostring ToString()
const override;
2755 Number operator ++ (
int);
2756 Number operator -- (
int);
2758 bool operator == (
const Number& other)
const;
2759 bool operator != (
const Number& other)
const;
2760 bool operator > (
const Number& other)
const;
2761 bool operator < (
const Number& other)
const;
2762 bool operator >= (
const Number& other)
const;
2763 bool operator <= (
const Number& other)
const;
2766 Number& operator = (
const T &lhs);
2772 Number operator - (
const T &value);
2775 Number operator + (
const T &value);
2778 Number operator * (
const T &value);
2781 Number operator / (
const T &value);
2784 Number& operator += (
const T &value);
2787 Number& operator -= (
const T &value);
2790 Number& operator *= (
const T &value);
2793 Number& operator /= (
const T &value);
2801 int Compare(
const Number& other)
const;
2804 inline T GetValue()
const;
2807 Number& SetValue(
const T &value);
2810 void Add(
const T &value);
2813 void Sub(
const T &value);
2816 void Multiply(
const T &value);
2819 void Divide(
const T &value);
2835 friend class BindArray;
2848 static Date SysDate();
2857 Date(
bool create =
false);
2873 Date(
const otext* str,
const otext* format = OTEXT(
""));
2897 bool IsValid()
const;
2904 int GetYear()
const;
2911 void SetYear(
int value);
2918 int GetMonth()
const;
2925 void SetMonth(
int value);
2939 void SetDay(
int value);
2946 int GetHours()
const;
2953 void SetHours(
int value);
2960 int GetMinutes()
const;
2967 void SetMinutes(
int value);
2974 int GetSeconds()
const;
2981 void SetSeconds(
int value);
2990 int DaysBetween(
const Date& other)
const;
3001 void SetDate(
int year,
int month,
int day);
3012 void SetTime(
int hour,
int min,
int sec);
3026 void SetDateTime(
int year,
int month,
int day,
int hour,
int min,
int sec);
3037 void GetDate(
int &year,
int &month,
int &day)
const;
3048 void GetTime(
int &hour,
int &min,
int &sec)
const;
3062 void GetDateTime(
int &year,
int &month,
int &day,
int &hour,
int &min,
int &sec)
const;
3071 void AddDays(
int days);
3080 void AddMonths(
int months);
3096 Date LastDay()
const;
3122 void FromString(
const ostring& str,
const ostring& format = OTEXT(
""));
3144 ostring ToString()
const override;
3158 Date& operator ++ ();
3165 Date operator ++ (
int);
3172 Date& operator -- ();
3179 Date operator -- (
int);
3186 Date operator + (
int value)
const;
3193 Date operator - (
int value)
const;
3200 Date& operator += (
int value);
3207 Date& operator -= (
int value);
3214 bool operator == (
const Date& other)
const;
3221 bool operator != (
const Date& other)
const;
3228 bool operator > (
const Date& other)
const;
3235 bool operator < (
const Date& other)
const;
3242 bool operator >= (
const Date& other)
const;
3249 bool operator <= (
const Date& other)
const;
3253 int Compare(
const Date& other)
const;
3269 friend class Environment;
3272 friend class BindArray;
3287 YearMonth = OCI_INTERVAL_YM,
3289 DaySecond = OCI_INTERVAL_DS
3342 bool IsValid()
const;
3352 int GetYear()
const;
3362 void SetYear(
int value);
3372 int GetMonth()
const;
3382 void SetMonth(
int value);
3402 void SetDay(
int value);
3412 int GetHours()
const;
3422 void SetHours(
int value);
3432 int GetMinutes()
const;
3442 void SetMinutes(
int value);
3452 int GetSeconds()
const;
3462 void SetSeconds(
int value);
3469 int GetMilliSeconds()
const;
3476 void SetMilliSeconds(
int value);
3492 void GetDaySecond(
int &day,
int &hour,
int &min,
int &sec,
int &fsec)
const;
3508 void SetDaySecond(
int day,
int hour,
int min,
int sec,
int fsec);
3521 void GetYearMonth(
int &year,
int &month)
const;
3534 void SetYearMonth(
int year,
int month);
3543 void UpdateTimeZone(
const ostring& timeZone);
3555 void FromString(
const ostring& data);
3565 ostring ToString(
int leadingPrecision,
int fractionPrecision)
const;
3572 ostring ToString()
const override;
3614 bool operator == (
const Interval& other)
const;
3621 bool operator != (
const Interval& other)
const;
3628 bool operator > (
const Interval& other)
const;
3635 bool operator < (
const Interval& other)
const;
3642 bool operator >= (
const Interval& other)
const;
3649 bool operator <= (
const Interval& other)
const;
3653 int Compare(
const Interval& other)
const;
3668 friend class Environment;
3671 friend class BindArray;
3687 NoTimeZone = OCI_TIMESTAMP,
3689 WithTimeZone = OCI_TIMESTAMP_TZ,
3691 WithLocalTimeZone = OCI_TIMESTAMP_LTZ
3710 static Timestamp SysTimestamp(TimestampType type = NoTimeZone);
3747 TimestampType
GetType()
const;
3763 bool IsValid()
const;
3770 int GetYear()
const;
3777 void SetYear(
int value);
3784 int GetMonth()
const;
3791 void SetMonth(
int value);
3805 void SetDay(
int value);
3812 int GetHours()
const;
3819 void SetHours(
int value);
3826 int GetMinutes()
const;
3833 void SetMinutes(
int value);
3840 int GetSeconds()
const;
3847 void SetSeconds(
int value);
3854 int GetMilliSeconds()
const;
3861 void SetMilliSeconds(
int value);
3872 void GetDate(
int &year,
int &month,
int &day)
const;
3884 void GetTime(
int &hour,
int &min,
int &sec,
int &fsec)
const;
3895 void SetDate(
int year,
int month,
int day);
3907 void SetTime(
int hour,
int min,
int sec,
int fsec);
3922 void GetDateTime(
int &year,
int &month,
int &day,
int &hour,
int &min,
int &sec,
int &fsec)
const;
3938 void SetDateTime(
int year,
int month,
int day,
int hour,
int min,
int sec,
int fsec,
const ostring& timeZone = OTEXT(
""));
3959 void SetTimeZone(
const ostring& timeZone);
3969 void GetTimeZoneOffset(
int &hour,
int &min)
const;
3996 void FromString(
const ostring& data,
const ostring& format = OCI_STRING_FORMAT_DATE);
4016 ostring ToString()
const override;
4121 bool operator == (
const Timestamp& other)
const;
4128 bool operator != (
const Timestamp& other)
const;
4135 bool operator > (
const Timestamp& other)
const;
4142 bool operator < (
const Timestamp& other)
const;
4149 bool operator >= (
const Timestamp& other)
const;
4156 bool operator <= (
const Timestamp& other)
const;
4160 int Compare(
const Timestamp& other)
const;
4172 template<
class T,
int U>
4177 friend class BindArray;
4213 T Read(
unsigned int length);
4225 unsigned int Write(
const T &content);
4237 unsigned int Append(
const T& content);
4246 void Append(
const Lob& other);
4262 bool Seek(SeekMode seekMode, big_uint offset);
4276 big_uint GetOffset()
const;
4283 big_uint GetLength()
const;
4290 big_uint GetMaxSize()
const;
4303 big_uint GetChunkSize()
const;
4319 void Truncate(big_uint length);
4336 big_uint Erase(big_uint offset, big_uint length);
4351 void Copy(
Lob &dest, big_uint offset, big_uint offsetDest, big_uint length)
const;
4358 bool IsTemporary()
const;
4365 bool IsRemote()
const;
4379 void Open(OpenMode mode);
4416 void EnableBuffering(
bool value);
4430 Lob& operator += (
const Lob& other);
4437 bool operator == (
const Lob& other)
const;
4444 bool operator != (
const Lob& other)
const;
4448 bool Equals(
const Lob &other)
const;
4450 Lob(
OCI_Lob *pLob, Handle *parent =
nullptr);
4499 friend class BindArray;
4551 Raw Read(
unsigned int size);
4567 bool Seek(SeekMode seekMode, big_uint offset);
4577 bool Exists()
const;
4584 big_uint GetOffset()
const;
4591 big_uint GetLength()
const;
4647 bool IsOpened()
const;
4661 bool operator == (
const File& other)
const;
4668 bool operator != (
const File& other)
const;
4672 bool Equals(
const File &other)
const;
4701 Table = OCI_TIF_TABLE,
4703 View = OCI_TIF_VIEW,
4761 unsigned int GetColumnCount()
const;
4777 Column GetColumn(
unsigned int index)
const;
4791 boolean IsFinalType()
const;
4825 friend class BindArray;
4841 Persistent = OCI_OBJ_PERSISTENT,
4843 Transient = OCI_OBJ_TRANSIENT,
4845 Value = OCI_OBJ_VALUE
4880 bool IsAttributeNull(
const ostring& name)
const;
4889 void SetAttributeNull(
const ostring& name);
4925 T Get(
const ostring& name)
const;
4941 void Get(
const ostring& name, T &value)
const;
4973 void Set(
const ostring& name,
const T &value);
5005 friend class BindArray;
5043 Object GetObject()
const;
5050 bool IsReferenceNull()
const;
5060 void SetReferenceNull();
5074 ostring ToString()
const override;
5097 typedef T ValueType;
5105 bool IsNull()
const;
5110 CollectionType* _coll;
5129 typedef typename T::ValueType value_type;
5132 typedef std::random_access_iterator_tag iterator_category;
5133 typedef ptrdiff_t difference_type;
5134 typedef ptrdiff_t distance_type;
5135 typedef value_type* pointer;
5136 typedef value_type& reference;
5185 friend class BindArray;
5202 Varray = OCI_COLL_VARRAY,
5204 NestedTable = OCI_COLL_NESTED_TABLE,
5206 IndexedTable = OCI_COLL_INDEXED_TABLE
5239 CollectionType
GetType()
const;
5246 unsigned int GetMax()
const;
5253 unsigned int GetSize()
const;
5265 unsigned int GetCount()
const;
5274 void Truncate(
unsigned int size);
5294 bool IsElementNull(
unsigned int index)
const;
5306 void SetElementNull(
unsigned int index);
5325 bool Delete(
unsigned int index)
const;
5334 T Get(
unsigned int index)
const;
5344 void Set(
unsigned int index,
const T &value);
5354 void Append(
const T &data);
5375 ostring ToString()
const override;
5403 const_iterator begin()
const;
5417 const_iterator end()
const;
5435 static T GetElem(
OCI_Elem *elem, Handle *parent);
5437 static void SetElem(
OCI_Elem *elem,
const T &value);
5449 template<
class T,
int U>
5454 friend class BindArray;
5484 unsigned int Write(
const T& content);
5491 unsigned int GetLength()
const;
5498 T GetContent()
const;
5530 InOut = OCI_BDM_IN_OUT
5597 unsigned int GetSubType()
const;
5608 unsigned int GetDataCount()
const;
5637 void SetDataNull(
bool value,
unsigned int index = 1);
5653 bool IsDataNull(
unsigned int index = 1)
const;
5668 void SetCharsetForm(CharsetForm value);
5675 BindDirection GetDirection()
const;
5691 friend class Exception;
5693 template<
class,
int>
5696 friend class BindObject;
5708 TypeSelect = OCI_CST_SELECT,
5710 TypeUpdate = OCI_CST_UPDATE,
5712 TypeDelete = OCI_CST_DELETE,
5714 TypeInsert = OCI_CST_INSERT,
5716 TypeCreate = OCI_CST_CREATE,
5718 TypeDrop = OCI_CST_DROP,
5720 TypeAlter = OCI_CST_ALTER,
5722 TypeBegin = OCI_CST_BEGIN,
5724 TypeDeclare = OCI_CST_DECLARE,
5726 TypeCall = OCI_CST_CALL,
5728 TypeMerge = OCI_CST_MERGE
5748 FetchForward = OCI_SFM_DEFAULT,
5750 FetchScrollable = OCI_SFM_SCROLLABLE
5770 BindByPosition = OCI_BIND_BY_POS,
5772 BindByName = OCI_BIND_BY_NAME
5792 LongExplicit = OCI_LONG_EXPLICIT,
5794 LongImplicit = OCI_LONG_IMPLICIT
5858 void Describe(
const ostring& sql);
5883 void Parse(
const ostring& sql);
5895 void Prepare(
const ostring& sql);
5902 void ExecutePrepared();
5911 void Execute(
const ostring& sql);
5931 unsigned int ExecutePrepared(T callback);
5953 template<
class T,
class U>
5954 unsigned int ExecutePrepared(T callback, U adapter);
5975 unsigned int Execute(
const ostring& sql, T callback);
5998 template<
class T,
class U>
5999 unsigned int Execute(
const ostring& sql, T callback, U adapter);
6015 unsigned int GetAffectedRows()
const;
6029 ostring GetSqlIdentifier()
const;
6091 void SetBindArraySize(
unsigned int size);
6098 unsigned int GetBindArraySize()
const;
6115 void AllowRebinding(
bool value);
6125 bool IsRebindingAllowed()
const;
6143 unsigned int GetBindIndex(
const ostring& name)
const;
6150 unsigned int GetBindCount()
const;
6166 BindInfo GetBind(
unsigned int index)
const;
6223 template<
class T,
class U>
6325 template<
class T,
class U>
6349 void Register(
const ostring& name);
6368 template<
class T,
class U>
6369 void Register(
const ostring& name, U& extraInfo);
6389 template<
class T,
class U>
6390 void Register(
const ostring& name, U extraInfo);
6397 StatementType GetStatementType()
const;
6408 unsigned int GetSqlErrorPos()
const;
6420 void SetFetchMode(FetchMode value);
6430 FetchMode GetFetchMode()
const;
6439 void SetBindMode(BindMode value);
6449 BindMode GetBindMode()
const;
6458 void SetFetchSize(
unsigned int value);
6468 unsigned int GetFetchSize()
const;
6480 void SetPrefetchSize(
unsigned int value);
6490 unsigned int GetPrefetchSize()
const;
6510 void SetPrefetchMemory(
unsigned int value);
6520 unsigned int GetPrefetchMemory()
const;
6529 void SetLongMaxSize(
unsigned int value);
6539 unsigned int GetLongMaxSize()
const;
6551 void SetLongMode(LongMode value);
6558 LongMode GetLongMode()
const;
6572 unsigned int GetSQLCommand()
const;
6593 void GetBatchErrors(std::vector<Exception> &exceptions);
6597 static bool IsResultsetHandle(Handle *handle);
6598 static void OnFreeSmartHandle(SmartHandle *smartHandle);
6602 BindsHolder *GetBindsHolder(
bool allocate)
const;
6604 void ReleaseResultsets()
const;
6608 void SetInData()
const;
6609 void SetOutData()
const;
6610 void ClearBinds()
const;
6612 template<
typename M,
class T>
6615 template<
typename M,
class T>
6618 template<
typename M,
class T>
6621 template<
typename M,
class T,
class U>
6624 template<
typename T>
6625 unsigned int Fetch(T callback);
6627 template<
typename T,
typename U>
6628 unsigned int Fetch(T callback, U adapter);
6651 SeekAbsolute = OCI_SFD_ABSOLUTE,
6653 SeekRelative = OCI_SFD_RELATIVE
6678 T Get(
unsigned int index)
const;
6694 void Get(
unsigned int index, T &value)
const;
6709 T Get(
const ostring& name)
const;
6722 void Get(
const ostring &name, T &value)
const;
6738 template<
class T,
class U>
6739 bool Get(T& value, U adapter)
const;
6756 template<
typename T>
6757 unsigned int ForEach(T callback);
6781 template<
typename T,
typename U>
6782 unsigned int ForEach(T callback, U adapter);
6860 bool Seek(SeekMode mode,
int offset);
6867 unsigned int GetCount()
const;
6879 unsigned int GetCurrentRow()
const;
6894 unsigned int GetColumnIndex(
const ostring& name)
const;
6901 unsigned int GetColumnCount()
const;
6913 Column GetColumn(
unsigned int index)
const;
6937 bool IsColumnNull(
unsigned int index)
const;
6946 bool IsColumnNull(
const ostring& name)
const;
6960 bool operator ++ (
int);
6967 bool operator -- (
int);
6975 bool operator += (
int offset);
6983 bool operator -= (
int offset);
7012 NoFlags = OCI_CPF_NONE,
7015 IsIdentity = OCI_CPF_IS_IDENTITY,
7019 IsGeneratedAlways = OCI_CPF_IS_GEN_ALWAYS,
7022 IsGeneratedByDefaultOnNull = OCI_CPF_IS_GEN_BY_DEFAULT_ON_NULL,
7024 IsLogicalPartitioning = OCI_CPF_IS_LPART,
7026 IsGeneratedByContainers = OCI_CPF_IS_CONID
7064 ostring GetFullSQLType()
const;
7090 unsigned int GetSubType()
const;
7097 CharsetForm GetCharsetForm()
const;
7104 CollationID GetCollationID()
const;
7115 unsigned int GetSize()
const;
7122 int GetScale()
const;
7129 int GetPrecision()
const;
7136 int GetFractionalPrecision()
const;
7143 int GetLeadingPrecision()
const;
7155 PropertyFlags GetPropertyFlags()
const;
7162 bool IsNullable()
const;
7173 bool IsCharSemanticUsed()
const;
7214 typedef void (*NotifyHandlerProc) (
Event &evt);
7224 ObjectChanges = OCI_CNT_OBJECTS,
7226 RowChanges = OCI_CNT_ROWS,
7228 DatabaseChanges = OCI_CNT_DATABASES,
7230 AllChanges = OCI_CNT_ALL
7264 void Register(
const Connection &connection,
const ostring& name, ChangeTypes changeTypes, NotifyHandlerProc handler,
unsigned int port = 0,
unsigned int timeout = 0);
7287 void Watch(
const ostring& sql);
7301 unsigned int GetTimeout()
const;
7308 unsigned int GetPort()
const;
7338 friend class Environment;
7350 DatabaseStart = OCI_ENT_STARTUP,
7352 DatabaseShutdown = OCI_ENT_SHUTDOWN,
7354 DatabaseShutdownAny = OCI_ENT_SHUTDOWN_ANY,
7356 DatabaseDrop = OCI_ENT_DROP_DATABASE,
7358 Unregister = OCI_ENT_DEREGISTER,
7360 ObjectChanged = OCI_ENT_OBJECT_CHANGED
7380 ObjectInserted = OCI_ONT_INSERT,
7382 ObjectUpdated = OCI_ONT_UPDATE,
7384 ObjectDeleted = OCI_ONT_DELETE,
7386 ObjectAltered = OCI_ONT_ALTER,
7388 ObjectDropped = OCI_ONT_DROP,
7390 ObjectGeneric = OCI_ONT_GENERIC
7417 ObjectEvent GetObjectEvent()
const;
7424 ostring GetDatabaseName()
const;
7434 ostring GetObjectName()
const;
7513 void SetName(
const ostring& value);
7538 void SetAddress(
const ostring& value);
7566 Ready = OCI_AMS_READY,
7568 Waiting = OCI_AMS_WAITING,
7570 Processed = OCI_AMS_PROCESSED,
7572 Expired = OCI_AMS_EXPIRED
7641 void SetPayload(
const T &value);
7651 Date GetEnqueueTime()
const;
7658 int GetAttemptCount()
const;
7665 MessageState GetState()
const;
7687 int GetExpiration()
const;
7708 void SetExpiration(
int value);
7718 int GetEnqueueDelay()
const;
7742 void SetEnqueueDelay(
int value);
7752 int GetPriority()
const;
7766 void SetPriority(
int value);
7777 Raw GetOriginalID()
const;
7790 void SetOriginalID(
const Raw &value);
7800 ostring GetCorrelation()
const;
7812 void SetCorrelation(
const ostring& value);
7827 ostring GetExceptionQueue()
const;
7855 void SetExceptionQueue(
const ostring& value);
7865 Agent GetSender()
const;
7874 void SetSender(
const Agent &agent);
7887 void SetConsumers(std::vector<Agent> &agents);
7913 Before = OCI_ASD_BEFORE,
7935 Immediate = OCI_AMV_IMMEDIATE,
7937 OnCommit = OCI_AMV_ON_COMMIT
7979 void Put(
const Message &message);
7989 EnqueueVisibility GetVisibility()
const;
8001 void SetVisibility(EnqueueVisibility value);
8011 EnqueueMode GetMode()
const;
8031 void SetMode(EnqueueMode value);
8043 Raw GetRelativeMsgID()
const;
8058 void SetRelativeMsgID(
const Raw &value);
8070 friend class Environment;
8081 typedef void (*NotifyAQHandlerProc) (
Dequeue &dequeue);
8091 Browse = OCI_ADM_BROWSE,
8093 Locked = OCI_ADM_LOCKED,
8095 Remove = OCI_ADM_REMOVE,
8097 Confirm = OCI_ADM_REMOVE_NODATA
8117 Immediate = OCI_AMV_IMMEDIATE,
8119 OnCommit = OCI_AMV_ON_COMMIT
8139 FirstMessage = OCI_ADN_FIRST_MSG,
8141 NextMessage = OCI_ADN_NEXT_MSG,
8144 NextTransaction = OCI_ADN_NEXT_TRANSACTION
8196 Agent Listen(
int timeout);
8219 void SetConsumer(
const ostring& value);
8229 ostring GetCorrelation()
const;
8242 void SetCorrelation(
const ostring& value);
8252 Raw GetRelativeMsgID()
const;
8261 void SetRelativeMsgID(
const Raw &value);
8271 DequeueVisibility GetVisibility()
const;
8287 void SetVisibility(DequeueVisibility value);
8297 DequeueMode GetMode()
const;
8309 void SetMode(DequeueMode value);
8319 NavigationMode GetNavigation()
const;
8340 void SetNavigation(NavigationMode value);
8350 int GetWaitTime()
const;
8369 void SetWaitTime(
int value);
8378 void SetAgents(std::vector<Agent> &agents);
8396 void Subscribe(
unsigned int port,
unsigned int timeout, NotifyAQHandlerProc handler);
8430 NormalQueue = OCI_AQT_NORMAL,
8432 ExceptionQueue = OCI_AQT_EXCEPTION,
8434 NonPersistentQueue = OCI_AQT_NON_PERSISTENT
8470 static void Create(
const Connection &connection,
const ostring& queue,
const ostring& table, QueueType type = NormalQueue,
8471 unsigned int maxRetries = 0,
unsigned int retryDelay = 0,
unsigned int retentionTime = 0,
8472 bool dependencyTracking =
false,
const ostring& comment = OTEXT(
""));
8495 unsigned int maxRetries= 0,
unsigned int retryDelay= 0,
8496 unsigned int retentionTime= 0,
const ostring& comment = OTEXT(
""));
8532 static void Start(
const Connection &connection,
const ostring& queue,
bool enableEnqueue =
true,
bool enableDequeue =
true);
8552 static void Stop(
const Connection &connection,
const ostring& queue,
bool stopEnqueue =
true,
bool stopDequeue =
true,
bool wait =
true);
8573 None = OCI_AGM_NONE,
8576 Transactionnal = OCI_AGM_TRANSACTIONNAL
8597 Buffered = OCI_APM_BUFFERED,
8599 Persistent = OCI_APM_PERSISTENT,
8647 static void Create(
const Connection &connection,
const ostring& table,
const ostring& payloadType,
bool multipleConsumers,
8648 const ostring& storageClause = OTEXT(
""),
const ostring& sortList = OTEXT(
""),
8649 GroupingMode groupingMode = None,
const ostring& comment = OTEXT(
""),
8650 unsigned int primaryInstance = 0,
unsigned int secondaryInstance = 0,
8651 const ostring& compatible = OTEXT(
""));
8671 static void Alter(
const Connection &connection,
const ostring& table,
const ostring& comment,
unsigned int primaryInstance = 0,
unsigned int secondaryInstance = 0);
8693 static void Drop(
const Connection &connection,
const ostring& table,
bool force =
true);
8718 static void Purge(
const Connection &connection,
const ostring& table, PurgeMode mode,
const ostring& condition = OTEXT(
""),
bool block =
true);
8759 Default = OCI_DCM_DEFAULT,
8761 Force = OCI_DCM_FORCE
8781 ResultComplete = OCI_DPR_COMPLETE,
8783 ResultError = OCI_DPR_ERROR,
8785 ResultFull = OCI_DPR_FULL ,
8787 ResultPartial = OCI_DPR_PARTIAL,
8789 ResultEmpty = OCI_DPR_EMPTY
8840 void SetColumn(
unsigned int colIndex,
const ostring& name,
unsigned int maxSize,
const ostring& format = OTEXT(
""));
8873 void SetEntry(
unsigned int rowIndex,
unsigned int colIndex,
const T& value,
bool complete =
true);
8979 void SetCurrentRows(
unsigned int value);
8989 unsigned int GetCurrentRows()
const;
8999 unsigned int GetMaxRows()
const;
9009 unsigned int GetRowCount()
const;
9023 unsigned int GetAffectedRows()
const;
9038 void SetDateFormat(
const ostring& format);
9066 void SetParallel(
bool value);
9082 void SetNoLog(
bool value);
9097 void SetCacheSize(
unsigned int value);
9109 void SetBufferSize(
unsigned int value);
9124 void SetConversionMode(ConversionMode value);
9154 unsigned int GetErrorColumn();
9189 unsigned int GetErrorRow();
9194 #include "ocilib_impl.hpp" struct OCI_Mutex OCI_Mutex
OCILIB encapsulation of OCI mutexes.
struct OCI_Agent OCI_Agent
OCILIB encapsulation of A/Q Agent.
CharsetModeValues
Charset mode enumerated values.
Encapsulate a Resultset column or object member properties.
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.
DequeueVisibilityValues
Message visibility enumerated values.
STL compliant Collection Random iterator class.
Flags< SessionFlagsValues > SessionFlags
Sessions flags.
struct OCI_Connection OCI_Connection
Oracle physical connection.
Static class allowing to set/get thread local storage (TLS) values for a given unique key...
Exception class handling all OCILIB errors.
Provides SQL bind informations.
TypeInfoTypeValues
Type of object information enumerated values.
EventTypeValues
Event type enumerated values.
LobTypeValues
Lob types enumerated values.
CollectionIterator< const CollectionElement< T > > const_iterator
Common const iterator declaration.
Enum< BindModeValues > BindMode
Bind Modes.
HAEventSourceValues
HA Event sources enumerated values.
Enum< DequeueModeValues > DequeueMode
Dequeue mode.
Enum< PoolTypeValues > PoolType
Type of Pool.
Enum< CharsetFormValues > CharsetForm
Type of charsetForm.
FetchModeValues
Fetch Modes enumerated values.
TimeoutTypeValues
Timeout enumerated values.
HAEventTypeValues
HA Event types enumerated values.
unsigned int GetRow() const
Return the row index which caused an error during statement execution.
Class allowing the administration of Oracle Queues.
SessionTraceValues
Session trace enumerated values.
Enum< GroupingModeValues > GroupingMode
Grouping Mode.
StatementTypeValues
Statement Type enumerated values.
Enum< LobTypeValues > LobType
Type of Lob.
Enum< DataTypeValues > DataType
Column data type.
OCI_Mutex * MutexHandle
Alias for an OCI_Mutex pointer.
struct OCI_XID OCI_XID
Global transaction identifier.
ostring GetMessage() const
Retrieve the error message.
Object used for executing SQL or PL/SQL statement and returning the produced results.
A connection or session with a specific database.
Flags< PropertyFlagsValues > PropertyFlags
Column properties flags.
static class allowing to manipulate threads
PoolTypeValues
Pool type enumerated values.
struct OCI_Interval OCI_Interval
Oracle internal interval representation.
Object identifying the SQL data type LONG.
struct OCI_Dequeue OCI_Dequeue
OCILIB encapsulation of A/Q dequeuing operations.
int GetOracleErrorCode() const
Return the Oracle error code.
Oracle Transaction object.
FailoverResultValues
Failover callback results enumerated values.
struct OCI_Statement OCI_Statement
Oracle SQL or PL/SQL statement.
struct OCI_Bind OCI_Bind
Internal bind representation.
Enum< ObjectTypeValues > ObjectType
Object Type.
LongTypeValues
Long types enumerated values.
struct OCI_Subscription OCI_Subscription
OCILIB encapsulation of Oracle DCN notification.
TimestampTypeValues
Interval types enumerated values.
StartFlagsValues
Oracle instance start flags enumerated values.
Flags< ShutdownFlagsValues > ShutdownFlags
Oracle instance shutdown flags.
AQ identified agent for messages delivery.
Static class allowing managing mutexes.
Enum< DequeueVisibilityValues > DequeueVisibility
Message visibility after begin dequeued.
Enum< OracleVersionValues > OracleVersion
Oracle Version.
Oracle Direct path loading encapsulation.
Enum< EnqueueVisibilityValues > EnqueueVisibility
Message visibility after begin queued.
Enum< NavigationModeValues > NavigationMode
Navigation Mode.
struct OCI_Timestamp OCI_Timestamp
Oracle internal timestamp representation.
Enum< EventTypeValues > EventType
Event type.
EnqueueModeValues
Message enqueuing mode enumerated values.
void(* POCI_THREAD)(OCI_Thread *thread, void *arg)
Thread procedure prototype.
Template Enumeration template class providing some type safety to some extends for manipulating enume...
Flags< ChangeTypesValues > ChangeTypes
Subscription changes flags.
Enum< ExceptionTypeValues > ExceptionType
Type of Exception.
ConversionModeValues
Conversion mode enumerated values.
VectorTypeValues
Vector type values.
Flags< ShutdownModeValues > ShutdownMode
Oracle instance shutdown modes.
Flags< EnvironmentFlagsValues > EnvironmentFlags
Environment Flags.
ShutdownModeValues
Oracle instance shutdown modes enumerated values.
struct OCI_Msg OCI_Msg
OCILIB encapsulation of A/Q message.
const void * ThreadId
Thread Unique ID.
Object identifying the SQL data type REF.
Enum< IntervalTypeValues > IntervalType
Interval types.
SeekModeValues
Seek Modes enumerated values.
Enum< StatementTypeValues > StatementType
Statement Type.
PurgeModeValues
Purge mode enumerated values.
Static class in charge of library initialization / cleanup.
FailoverRequestValues
Failover request enumerated values.
Class used for handling transient collection value. it is used internally by the Collection<T> class:...
AllocatedBytesValues
Allocated Bytes enumerated values.
Enum< ObjectEventValues > ObjectEvent
Object events.
FailoverEventValues
Failover events enumerated values.
Enum< VectorTypeValues > VectorType
Vector type.
struct OCI_Ref OCI_Ref
Oracle REF type representation.
ChangeTypesValues
Subscription changes flags values.
Enum< SeekModeValues > SeekMode
Seek Modes.
void * AnyPointer
Alias for the generic void pointer.
const char * what() const override
Override the std::exception::what() method.
ExceptionType GetType() const
Return the Exception type.
Connection GetConnection() const
Return the connection within the error occurred.
Object identifying the SQL data type BFILE.
Object identifying the SQL data types VARRAY and NESTED TABLE.
Enum< MessageStateValues > MessageState
Message state.
struct OCI_Date OCI_Date
Oracle internal date representation.
Flags< AllocatedBytesValues > AllocatedBytesFlags
Allocated Bytes.
ResultValues
Direct Operation Result enumerated values.
friend T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so, it raises a C++ exception using the retrieved error handle.
Flags< StartFlagsValues > StartFlags
Oracle instance start flags.
Object identifying the SQL data type INTERVAL.
Enum< FormatTypeValues > FormatType
Format type.
int GetInternalErrorCode() const
Return the OCILIB error code.
Enum< TimeoutTypeValues > TimeoutType
Timeout Types.
CollectionTypeValues
Collection type enumerated values.
Enum< EnqueueModeValues > EnqueueMode
Message enqueuing mode.
struct OCI_Transaction OCI_Transaction
Oracle Transaction.
POCI_THREADKEYDEST ThreadKeyFreeProc
Thread Key callback for freeing resources.
GroupingModeValues
Grouping mode enumerated values.
Class allowing the administration of Oracle Queue tables.
Enum< LongModeValues > LongMode
LONG data type mapping modes.
Enum< TimestampTypeValues > TimestampType
Type of timestamp.
Enqueue object for queuing messages into an Oracle Queue.
struct OCI_Resultset OCI_Resultset
Collection of output columns from a select statement.
SessionFlagsValues
Session flags enumerated values.
TransactionFlagsValues
Transaction flags enumerated values.
Enum< FailoverEventValues > FailoverEvent
Failover events.
OpenModeValues
Open Modes enumerated values.
Enum< FetchModeValues > FetchMode
Fetch Modes.
A connection or session Pool.
BindModeValues
Bind Modes enumerated values.
Enum< PurgeModeValues > PurgeMode
Purge mode.
Enum< HAEventSourceValues > HAEventSource
Source of HA events.
BindDirectionValues
Bind direction enumerated values.
Enum< FailoverResultValues > FailoverResult
Failover callback results.
Enum< LongTypeValues > LongType
Type of Long.
struct OCI_File OCI_File
Oracle External Large objects:
struct OCI_Thread OCI_Thread
OCILIB encapsulation of OCI Threads.
Enum< HAEventTypeValues > HAEventType
Type of HA events.
ObjectEventValues
Object events enumerated values.
LongModeValues
LONG data type mapping modes enumerated values.
Abstract class allowing derived classes to be compatible with any type supporting the operator << oci...
Flags< StartModeValues > StartMode
Oracle instance start modes.
ObjectTypeValues
Object Type enumerated values.
Enum< ConversionModeValues > ConversionMode
Conversion Mode.
struct OCI_Number OCI_Number
Oracle NUMBER representation.
Enum< NumericTypeValues > NumericType
Numeric data type.
void * CallbackPointer
Alias used for storing user callback method pointers.
CollectionIterator< CollectionElement< T > > iterator
Common iterator declaration.
Enum< CharsetModeValues > CharsetMode
Environment charset mode.
Template class providing OCILIB handles auto memory, life cycle and scope management.
NumericTypeValues
Numeric type enumerated values.
Enum< TypeInfoTypeValues > TypeInfoType
Type of object information.
OCI_Thread * ThreadHandle
Alias for an OCI_Thread pointer.
Enum< ImportModeValues > ImportMode
OCI libraries import mode.
CharsetFormValues
Charset form enumerated values.
void(* POCI_THREADKEYDEST)(void *data)
Thread key destructor prototype.
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
CollationIDValues
Collation ID enumerated values.
struct OCI_Long OCI_Long
Oracle Long data type.
Provides type information on Oracle Database objects.
EnqueueVisibilityValues
Message visibility enumerated values.
struct OCI_TypeInfo OCI_TypeInfo
Type info metadata handle.
NavigationModeValues
Navigation Mode enumerated values.
Object identifying the SQL data type NUMBER.
IntervalTypeValues
Interval types enumerated values.
POCI_THREAD ThreadProc
Thread callback.
ShutdownFlagsValues
Oracle instance shutdown flags enumerated values.
DequeueModeValues
Dequeue mode enumerated values.
Statement GetStatement() const
Return the statement within the error occurred.
DataTypeValues
Data type enumerated values.
ImportModeValues
OCI libraries import mode enumerated values.
Enum< FailoverRequestValues > FailoverRequest
Failover requests.
Lob< ostring, LobNationalCharacter > NClob
Class handling NCLOB oracle type.
MessageStateValues
Message state enumerated values.
OracleVersionValues
Oracle Version enumerated values.
Enum< SeekModeValues > SeekMode
Seek Modes.
Object identifying the SQL data type LOB (CLOB, NCLOB and BLOB)
Enum< CollationIDValues > CollationID
Type of Collation ID.
SeekModeValues
Seek Modes enumerated values.
Enum< ResultValues > Result
Direct Operation Result.
QueueTypeValues
Queue Type enumerated values.
ExceptionTypeValues
Exception type enumerated values.
Lob< ostring, LobCharacter > Clob
Class handling CLOB oracle type.
Enum< BindDirectionValues > BindDirection
Bind direction.
struct OCI_Coll OCI_Coll
Oracle Collections (VARRAYs and Nested Tables) representation.
PropertyFlagsValues
Column properties flags values.
Enum< SessionTraceValues > SessionTrace
Session traces.
struct OCI_Elem OCI_Elem
Oracle Collection item representation.
FormatTypeValues
Format type enumerated values.
Flags< TransactionFlagsValues > TransactionFlags
Transaction flags.
std::basic_string< otext, std::char_traits< otext >, std::allocator< otext > > ostring
string class wrapping the OCILIB otext * type and OTEXT() macros ( see Character sets ) ...
struct OCI_Object OCI_Object
Oracle Named types representation.
StartModeValues
Oracle instance start modes enumerated values.
struct OCI_Column OCI_Column
Oracle SQL Column and Type member representation.
struct OCI_Error OCI_Error
Encapsulates an Oracle or OCILIB exception.
Object identifying the SQL data type TIMESTAMP.
Enum< QueueTypeValues > QueueType
Queue Type.
Dequeue object for dequeuing messages into an Oracle Queue.
Object identifying the SQL data type OBJECT.
EnvironmentFlagsValues
Environment Flags enumerated values.
struct OCI_Event OCI_Event
OCILIB encapsulation of Oracle DCN event.
Subscription to database or objects changes.
struct OCI_Lob OCI_Lob
Oracle Internal Large objects:
Enum< CollectionTypeValues > CollectionType
Collection type.
Object identifying the SQL data type DATE.
Enum< OpenModeValues > OpenMode
Open Modes.