OCILIB (C and C++ Driver for Oracle)  4.7.7
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
Loading...
Searching...
No Matches
types.hpp
1/*
2 * OCILIB - C Driver for Oracle (C Wrapper for Oracle OCI)
3 *
4 * Website: http://www.ocilib.net
5 *
6 * Copyright (c) 2007-2025 Vincent ROGIER <vince.rogier@ocilib.net>
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20
21#pragma once
22
23#include <cstddef>
24#include <iterator>
25#include <vector>
26
27#include "ocilibcpp/core.hpp"
28#include "ocilibcpp/support.hpp"
29
30// ReSharper disable CppClangTidyCppcoreguidelinesMacroUsage
31// ReSharper disable CppClangTidyModernizeUseNodiscard
32// ReSharper disable CppClangTidyHicppSpecialMemberFunctions
33// ReSharper disable CppClangTidyReadabilityRedundantDeclaration
34// ReSharper disable CppFunctionIsNotImplemented
35// ReSharper disable CppClangTidyCppcoreguidelinesSpecialMemberFunctions
36// ReSharper disable CppClassCanBeFinal
37
38namespace ocilib
39{
40
50 {
51 Oracle80 = OCI_8_0,
52 Oracle8i = OCI_8_1,
53 Oracle9iR1 = OCI_9_0,
54 Oracle9iR2 = OCI_9_2,
55 Oracle10gR1 = OCI_10_1,
56 Oracle10gR2 = OCI_10_2,
57 Oracle11gR1 = OCI_11_1,
58 Oracle11gR2 = OCI_11_2,
59 Oracle12cR1 = OCI_12_1,
60 Oracle12cR2 = OCI_12_2,
61 Oracle18cR1 = OCI_18_1,
62 Oracle18cR2 = OCI_18_2,
63 Oracle18cR3 = OCI_18_3,
64 Oracle18cR4 = OCI_18_4,
65 Oracle18cR5 = OCI_18_5,
66 Oracle19cR3 = OCI_19_3,
67 Oracle19cR5 = OCI_19_5,
68 Oracle21cR3 = OCI_21_3
69 };
70
79
86 {
88 TypeNumeric = OCI_CDT_NUMERIC,
90 TypeDate = OCI_CDT_DATETIME,
92 TypeString = OCI_CDT_TEXT,
94 TypeLong = OCI_CDT_LONG,
96 TypeStatement = OCI_CDT_CURSOR,
98 TypeLob = OCI_CDT_LOB,
100 TypeFile = OCI_CDT_FILE,
102 TypeTimestamp = OCI_CDT_TIMESTAMP,
104 TypeInterval = OCI_CDT_INTERVAL,
106 TypeRaw = OCI_CDT_RAW,
108 TypeObject = OCI_CDT_OBJECT,
110 TypeCollection = OCI_CDT_COLLECTION,
112 TypeReference = OCI_CDT_REF,
114 TypeBoolean = OCI_CDT_BOOLEAN,
116 TypeXmlType = OCI_CDT_XMLTYPE
117 };
118
127
134 {
136 NumericShort = OCI_NUM_SHORT,
138 NumericInt = OCI_NUM_INT,
140 NumericBigInt = OCI_NUM_BIGINT,
142 NumericUnsignedShort = OCI_NUM_USHORT,
144 NumericUnsignedInt = OCI_NUM_UINT,
146 NumericUnsignedBigInt = OCI_NUM_BIGUINT,
148 NumericDouble = OCI_NUM_DOUBLE,
150 NumericFloat = OCI_NUM_FLOAT,
152 NumericNumber = OCI_NUM_NUMBER
153 };
154
163
170 {
172 CharsetFormDefault = OCI_CSF_DEFAULT,
174 CharsetFormNational = OCI_CSF_NATIONAL
175 };
176
185
192 {
194 CollationIDNone = OCI_CCI_NONE,
196 CollationIDNlsComp = OCI_CCI_NLS_COMP,
198 CollationIDNlsSort = OCI_CCI_NLS_SORT,
200 CollationIDNlsSortCI = OCI_CCI_NLS_SORT_CI,
202 CollationIDNlsSortAI = OCI_CCI_NLS_SORT_AI,
204 CollationIDNlsSortCS = OCI_CCI_NLS_SORT_CS,
206 CollationIDNlsSortVar1 = OCI_CCI_NLS_SORT_VAR1,
208 CollationIDNlsSortVar1CI = OCI_CCI_NLS_SORT_VAR1_CI,
210 CollationIDNlsSortVar1AI = OCI_CCI_NLS_SORT_VAR1_AI,
212 CollationIDNlsSortVar1CS = OCI_CCI_NLS_SORT_VAR1_CS,
214 CollationIDBinary = OCI_CCI_BINARY,
216 CollationIDBinaryCI = OCI_CCI_BINARY_CI,
218 CollationIDBinaryAI = OCI_CCI_BINARY_AI
219 };
220
229
230
237 {
239 SeekSet = OCI_SEEK_SET,
241 SeekEnd = OCI_SEEK_END,
243 SeekOffset = OCI_SEEK_CUR
244 };
245
254
261 {
263 ReadOnly = OCI_LOB_READONLY,
265 ReadWrite = OCI_LOB_READWRITE
266 };
267
276
283 {
285 LobBinary = OCI_BLOB,
287 LobCharacter = OCI_CLOB,
289 LobNationalCharacter = OCI_NCLOB
290 };
291
300
307 {
309 LongBinary = OCI_BLONG,
311 LongCharacter = OCI_CLONG
312 };
313
322
329 {
331 FormatDate = OCI_FMT_DATE,
333 FormatTimestamp = OCI_FMT_TIMESTAMP,
335 FormatNumeric = OCI_FMT_NUMERIC,
337 FormatBinaryDouble = OCI_FMT_BINARY_DOUBLE,
339 FormatBinaryFloat = OCI_FMT_BINARY_FLOAT
340 };
341
350
359 class Exception : public std::exception
360 {
361 template<class T>
362 friend T core::Check(T result);
363 friend class Statement;
364
365 public:
366
373 {
375 OracleError = OCI_ERR_ORACLE,
377 OcilibError = OCI_ERR_OCILIB,
379 OracleWarning = OCI_ERR_WARNING
380 };
381
390
396 ostring GetMessage() const;
397
404 ExceptionType GetType() const;
405
411 int GetOracleErrorCode() const;
412
418 int GetInternalErrorCode() const;
419
425 Statement GetStatement() const;
426
433
446 unsigned int GetRow() const;
447
456 const char* what() const noexcept override;
457
458 Exception(const Exception& other) noexcept;
459
460 Exception& operator = (const Exception& other) noexcept;
461
467 virtual ~Exception() noexcept;
468
469 private:
470
471 Exception() noexcept;
472 Exception(OCI_Error* err) noexcept;
473
474 void SetWhat(const otext* value) noexcept;
475 void CopyWhat(const char* value) noexcept;
476
477 char* _what;
478 OCI_Statement* _pStatement;
479 OCI_Connection* _pConnnection;
480 unsigned int _row;
481 ExceptionType _type;
482 int _errLib;
483 int _errOracle;
484 };
485
492 {
493 friend class Mutex;
494 friend class Connection;
495 friend class Pool;
496 friend class TypeInfo;
497 friend class Subscription;
498 friend class Dequeue;
499 friend class Date;
500 friend class Timestamp;
501 friend class Number;
502 friend class Interval;
503 friend class Agent;
504 friend class Transaction;
505 friend class Exception;
506 friend class File;
507 friend class Log;
508 friend class Statement;
509 friend class Object;
510 friend class Reference;
511 friend class Message;
512 friend class Event;
513 friend class Column;
514 template<class, int>
515 friend class Lob;
516
517 friend class core::HandleStore;
518
519 public:
520
527 {
529 SourceInstance = OCI_HES_INSTANCE,
531 SourceDatabase = OCI_HES_DATABASE,
533 SourceNode = OCI_HES_NODE,
535 SourceService = OCI_HES_SERVICE,
537 SourceServiceMember = OCI_HES_SERVICE_MEMBER,
539 SourceASMInstance = OCI_HES_ASM_INSTANCE,
541 SourcePreConnect = OCI_HES_PRECONNECT
542 };
543
552
559 {
561 EventDown = OCI_HET_DOWN,
563 EventUp = OCI_HET_UP
564 };
565
574
581 {
583 Default = OCI_ENV_DEFAULT,
585 Threaded = OCI_ENV_THREADED,
587 Events = OCI_ENV_EVENTS
588 };
589
598
605 {
607 ImportLinkage = OCI_IMPORT_MODE_LINKAGE,
609 ImportRuntime = OCI_IMPORT_MODE_RUNTIME
610 };
611
620
627 {
629 CharsetAnsi = OCI_CHAR_ANSI,
631 CharsetWide = OCI_CHAR_WIDE
632 };
633
642
649 {
651 SessionDefault = OCI_SESSION_DEFAULT,
653 SessionXa = OCI_SESSION_XA,
655 SessionSysDba = OCI_SESSION_SYSDBA,
657 SessionSysOper = OCI_SESSION_SYSOPER,
659 SessionSysAsm = OCI_SESSION_SYSASM,
661 SessionSysBkp = OCI_SESSION_SYSBKP,
663 SessionSysDgD = OCI_SESSION_SYSDGD,
665 SessionSysKmt = OCI_SESSION_SYSKMT,
667 SessionSysRac = OCI_SESSION_SYSRAC,
669 SessionPreAuth = OCI_SESSION_PRELIM_AUTH
670 };
671
680
687 {
689 StartOnly = OCI_DB_SPM_START,
691 StartMount = OCI_DB_SPM_MOUNT,
693 StartOpen = OCI_DB_SPM_OPEN,
695 StartFull = OCI_DB_SPM_FULL
696 };
697
706
713 {
715 StartDefault = OCI_DB_SPF_DEFAULT,
717 StartForce = OCI_DB_SPF_FORCE,
719 StartRestrict = OCI_DB_SPF_RESTRICT
720 };
721
730
737 {
739 ShutdownOnly = OCI_DB_SDM_SHUTDOWN,
741 ShutdownClose = OCI_DB_SDM_CLOSE,
743 ShutdownDismount = OCI_DB_SDM_DISMOUNT,
745 ShutdownFull = OCI_DB_SDM_FULL
746 };
747
756
763 {
766 ShutdowntDefault = OCI_DB_SDF_DEFAULT,
769 ShutdowTrans = OCI_DB_SDF_TRANS,
773 ShutdownTransLocal = OCI_DB_SDF_TRANS_LOCAL,
776 ShutdownImmediate = OCI_DB_SDF_IMMEDIATE,
782 ShutdownAbort = OCI_DB_SDF_ABORT
783 };
784
793
800 {
802 OracleClientBytes = OCI_MEM_ORACLE,
804 OcilibBytes = OCI_MEM_OCILIB,
806 AllBytes = OCI_MEM_ALL
807 };
808
817
825 typedef void(*HAHandlerProc) (Connection& con, HAEventSource eventSource, HAEventType eventType, Timestamp& time);
826
846 static void Initialize(EnvironmentFlags mode = Environment::Default, const ostring& libpath = OTEXT(""));
847
862 static void Cleanup();
863
872 static Environment::EnvironmentFlags GetMode();
873
879 static Environment::ImportMode GetImportMode();
880
886 static Environment::CharsetMode GetCharset();
887
897 static unsigned int GetCharMaxSize();
898
906 static big_uint GetAllocatedBytes(AllocatedBytesFlags type);
907
913 static bool Initialized();
914
925 static OracleVersion GetCompileVersion();
926
932 static unsigned int GetCompileMajorVersion();
933
939 static unsigned int GetCompileMinorVersion();
940
946 static unsigned int GetCompileRevisionVersion();
947
957 static OracleVersion GetRuntimeVersion();
958
964 static unsigned int GetRuntimeMajorVersion();
965
971 static unsigned int GetRuntimeMinorVersion();
972
978 static unsigned int GetRuntimeRevisionVersion();
979
990 static void EnableWarnings(bool value);
991
1023 static bool SetFormat(FormatType formatType, const ostring& format);
1024
1035 static ostring GetFormat(FormatType formatType);
1036
1063 static void StartDatabase(const ostring& db, const ostring& user, const ostring& pwd,
1064 Environment::StartFlags startFlags,
1065 Environment::StartMode startMode,
1066 Environment::SessionFlags sessionFlags = SessionSysDba,
1067 const ostring& spfile = OTEXT(""));
1068
1094 static void ShutdownDatabase(const ostring& db, const ostring& user, const ostring& pwd,
1095 Environment::ShutdownFlags shutdownFlags,
1096 Environment::ShutdownMode shutdownMode,
1097 Environment::SessionFlags sessionFlags = SessionSysDba);
1098
1109 static void ChangeUserPassword(const ostring& db, const ostring& user, const ostring& pwd, const ostring& newPwd);
1110
1127 static void SetHAHandler(HAHandlerProc handler);
1128
1129 private:
1130
1131 class EnvironmentHandle : core::HandleHolder<OCI_Environment*>
1132 {
1133 friend class Environment;
1134 };
1135
1136 static void HAHandler(OCI_Connection* pConnection, unsigned int source, unsigned int event, OCI_Timestamp* pTimestamp);
1137 static unsigned int TAFHandler(OCI_Connection* pConnection, unsigned int type, unsigned int event);
1138 static void NotifyHandler(OCI_Event* pEvent);
1139 static void NotifyHandlerAQ(OCI_Dequeue* pDequeue);
1140
1141 template<class T>
1142 static T GetUserCallback(AnyPointer ptr);
1143
1144 template<class T>
1145 static void SetUserCallback(AnyPointer ptr, T callback);
1146
1147 static core::Handle* GetEnvironmentHandle();
1148 static Environment* GetInstance();
1149
1150 static core::HandleStore& GetDefaultStore();
1151
1152 Environment(EnvironmentFlags mode, const ostring& libpath);
1153 ~Environment();
1154
1157 core::HandleStore _defaultStore;
1158 EnvironmentHandle _handle;
1159 EnvironmentFlags _mode;
1160 unsigned int _charMaxSize;
1161 bool _initialized;
1162 };
1163
1175 {
1176 public:
1177
1185
1194 static ThreadHandle Create();
1195
1203 static void Destroy(ThreadHandle handle);
1204
1214 static void Run(ThreadHandle handle, ThreadProc func, AnyPointer arg);
1215
1226 static void Join(ThreadHandle handle);
1227
1235 static ThreadId GetThreadId(ThreadHandle handle);
1236 };
1237
1247 class Mutex
1248 {
1249 public:
1250
1259 static MutexHandle Create();
1260
1268 static void Destroy(MutexHandle handle);
1269
1277 static void Acquire(MutexHandle handle);
1278
1286 static void Release(MutexHandle handle);
1287 };
1288
1300 {
1301 public:
1302
1310
1323 static void Create(const ostring& name, ThreadKeyFreeProc freeProc = nullptr);
1324
1333 static void SetValue(const ostring& name, AnyPointer value);
1334
1345 static AnyPointer GetValue(const ostring& name);
1346 };
1347
1355 class Pool : public core::HandleHolder<OCI_Pool*>
1356 {
1357 public:
1358
1365 {
1367 ConnectionPool = OCI_POOL_CONNECTION,
1369 SessionPool = OCI_POOL_SESSION
1371
1380
1386 Pool();
1387
1405 Pool(const ostring& db, const ostring& user, const ostring& pwd, Pool::PoolType poolType,
1406 unsigned int minSize, unsigned int maxSize, unsigned int increment = 1,
1407 Environment::SessionFlags sessionFlags = Environment::SessionDefault);
1408
1427 void Open(const ostring& db, const ostring& user, const ostring& pwd, Pool::PoolType poolType,
1428 unsigned int minSize, unsigned int maxSize, unsigned int increment = 1,
1429 Environment::SessionFlags sessionFlags = Environment::SessionDefault);
1430
1436 void Close();
1437
1466 Connection GetConnection(const ostring& sessionTag = OTEXT(""));
1467
1479 unsigned int GetTimeout() const;
1480
1494 void SetTimeout(unsigned int value);
1495
1505 bool GetNoWait() const;
1506
1522 void SetNoWait(bool value);
1523
1529 unsigned int GetBusyConnectionsCount() const;
1530
1536 unsigned int GetOpenedConnectionsCount() const;
1537
1543 unsigned int GetMinSize() const;
1544
1550 unsigned int GetMaxSize() const;
1551
1557 unsigned int GetIncrement() const;
1558
1567 unsigned int GetStatementCacheSize() const;
1568
1576 void SetStatementCacheSize(unsigned int value);
1577 };
1578
1586 class Connection : public core::HandleHolder<OCI_Connection*>
1587 {
1588 friend class Environment;
1589 friend class Exception;
1590 friend class Statement;
1591 friend class File;
1592 friend class Timestamp;
1593 friend class Pool;
1594 friend class Object;
1595 friend class TypeInfo;
1596 friend class Reference;
1597 friend class Resultset;
1598 friend class Subscription;
1599 friend class Agent;
1600 friend class Dequeue;
1601 friend class Enqueue;
1602 friend class Column;
1603 friend class Message;
1604 friend class DirectPath;
1605
1606 template<class, int>
1607 friend class Lob;
1608 template<class>
1609 friend class Collection;
1610 public:
1611
1618 {
1623 TimeoutSend = OCI_NTO_SEND,
1628 TimeoutReceive = OCI_NTO_RECEIVE,
1633 TimeoutCall = OCI_NTO_CALL
1635
1644
1651 {
1653 FailoverRequestSession = OCI_FOT_SESSION,
1655 FailoverRequestSelect = OCI_FOT_SELECT
1657
1666
1673 {
1675 FailoverEventEnd = OCI_FOE_END,
1677 FailoverEventAbort = OCI_FOE_ABORT,
1679 FailoverEventReauthentificate = OCI_FOE_REAUTH,
1681 FailoverEventBegin = OCI_FOE_BEGIN,
1683 FailoverEventError = OCI_FOE_ERROR
1685
1694
1701 {
1703 FailoverOk = OCI_FOC_OK,
1705 FailoverRetry = OCI_FOC_RETRY
1707
1716
1723 {
1725 TraceIdentity = OCI_TRC_IDENTITY,
1727 TraceModule = OCI_TRC_MODULE,
1729 TraceAction = OCI_TRC_ACTION,
1731 TraceDetail = OCI_TRC_DETAIL
1733
1742
1750 typedef FailoverResult(*TAFHandlerProc) (Connection& con, FailoverRequest failoverRequest, FailoverEvent failoverEvent);
1751
1757 Connection();
1758
1772 Connection(const ostring& db, const ostring& user, const ostring& pwd, Environment::SessionFlags sessionFlags = Environment::SessionDefault);
1773
1816 void Open(const ostring& db, const ostring& user, const ostring& pwd, Environment::SessionFlags sessionFlags = Environment::SessionDefault);
1817
1823 void Close();
1824
1830 void Commit();
1831
1837 void Rollback();
1838
1847 void Break();
1848
1856 void SetAutoCommit(bool enabled);
1857
1863 bool GetAutoCommit() const;
1864
1873 bool IsServerAlive() const;
1874
1883 bool PingServer() const;
1884
1893 ostring GetConnectionString() const;
1894
1903 ostring GetUserName() const;
1904
1913 ostring GetPassword() const;
1914
1923 ostring GetServerVersion() const;
1924
1933 OracleVersion GetVersion() const;
1934
1940 unsigned int GetServerMajorVersion() const;
1941
1947 unsigned int GetServerMinorVersion() const;
1948
1954 unsigned int GetServerRevisionVersion() const;
1955
1963 void ChangePassword(const ostring& newPwd);
1964
1970 ostring GetSessionTag() const;
1971
1986 void SetSessionTag(const ostring& tag);
1987
1993 Transaction GetTransaction() const;
1994
2008 void SetTransaction(const Transaction& transaction);
2009
2041 bool SetFormat(FormatType formatType, const ostring& format);
2042
2053 ostring GetFormat(FormatType formatType);
2054
2074 void EnableServerOutput(unsigned int bufsize, unsigned int arrsize, unsigned int lnsize);
2075
2084 void DisableServerOutput();
2085
2094 bool GetServerOutput(ostring& line) const;
2095
2101 void GetServerOutput(std::vector<ostring>& lines) const;
2102
2131 void SetTrace(SessionTrace trace, const ostring& value);
2132
2143 ostring GetTrace(SessionTrace trace) const;
2144
2153 ostring GetDatabase() const;
2154
2163 ostring GetInstance() const;
2164
2173 ostring GetService() const;
2174
2183 ostring GetServer() const;
2184
2193 ostring GetDomain() const;
2194
2203 Timestamp GetInstanceStartTime() const;
2204
2216 unsigned int GetStatementCacheSize() const;
2217
2228 void SetStatementCacheSize(unsigned int value);
2229
2246 unsigned int GetDefaultLobPrefetchSize() const;
2247
2272 void SetDefaultLobPrefetchSize(unsigned int value);
2273
2288 unsigned int GetMaxCursors() const;
2289
2298 bool IsTAFCapable() const;
2299
2313 void SetTAFHandler(TAFHandlerProc handler);
2314
2320 AnyPointer GetUserData();
2321
2329 void SetUserData(AnyPointer value);
2330
2344 unsigned int GetTimeout(TimeoutType timeout);
2345
2373 void SetTimeout(TimeoutType timeout, unsigned int value);
2374
2375 private:
2376
2377 Connection(OCI_Connection* con, core::Handle* parent, bool allocated);
2378 };
2379
2387 class Transaction : public core::HandleHolder<OCI_Transaction*>
2388 {
2389 friend class Connection;
2390
2391 public:
2392
2399 {
2400 Unknown = OCI_UNKNOWN,
2402 New = OCI_TRS_NEW,
2404 Tight = OCI_TRS_TIGHT,
2406 Loose = OCI_TRS_LOOSE,
2408 ReadOnly = OCI_TRS_READONLY,
2410 ReadWrite = OCI_TRS_READWRITE,
2412 Serializable = OCI_TRS_SERIALIZABLE
2414
2423
2437 Transaction(const Connection& connection, unsigned int timeout, TransactionFlags flags, OCI_XID* pxid = nullptr);
2438
2444 void Prepare();
2445
2451 void Start();
2452
2458 void Stop();
2459
2465 void Resume();
2466
2472 void Forget();
2473
2482 TransactionFlags GetFlags() const;
2483
2489 unsigned int GetTimeout() const;
2490
2491 private:
2492
2494 };
2495
2506 class Number : public core::HandleHolder<OCI_Number*>, public core::Streamable
2507 {
2508 friend class Statement;
2509 friend class Resultset;
2510 friend class support::BindArray;
2511 friend class Object;
2512 template<class>
2513 friend class Collection;
2514
2515 public:
2516
2524 Number(bool create = false);
2525
2533 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2534 Number(const T& value);
2535
2536
2545 Number(const Number& other);
2546
2555 Number& operator= (const Number& other) noexcept;
2556
2571 Number(const otext* str, const otext* format = OTEXT(""));
2572
2587 Number(const ostring& str, const ostring& format = OTEXT(""));
2588
2603 void FromString(const ostring& str, const ostring& format = OTEXT("")) const;
2604
2615 ostring ToString(const ostring& format) const;
2616
2625 ostring ToString() const override;
2626
2632 Number Clone() const;
2633
2634 Number& operator ++ ();
2635 Number& operator -- ();
2636 Number operator ++ (int);
2637 Number operator -- (int);
2638
2639 bool operator == (const Number& other) const;
2640 bool operator != (const Number& other) const;
2641 bool operator > (const Number& other) const;
2642 bool operator < (const Number& other) const;
2643 bool operator >= (const Number& other) const;
2644 bool operator <= (const Number& other) const;
2645
2646 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2647 Number& operator = (const T& lhs);
2648
2649 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2650 operator T() const;
2651
2652 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2653 Number operator - (const T& value);
2654
2655 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2656 Number operator + (const T& value);
2657
2658 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2659 Number operator * (const T& value);
2660
2661 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2662 Number operator / (const T& value);
2663
2664 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2665 Number& operator += (const T& value);
2666
2667 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2668 Number& operator -= (const T& value);
2669
2670 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2671 Number& operator *= (const T& value);
2672
2673 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2674 Number& operator /= (const T& value);
2675
2676 private:
2677
2678 template<class T>
2679 static AnyPointer GetNativeValue(const T& value);
2680
2681 Number(OCI_Number* pNumber, core::Handle* parent = nullptr);
2682
2683 void Allocate();
2684
2685 int Compare(const Number& other) const;
2686
2687 template<class T>
2688 inline T GetValue() const;
2689
2690 template<class T>
2691 Number& SetValue(const T& value);
2692
2693 template<class T>
2694 void Add(const T& value);
2695
2696 template<class T>
2697 void Sub(const T& value);
2698
2699 template<class T>
2700 void Multiply(const T& value);
2701
2702 template<class T>
2703 void Divide(const T& value);
2704
2705 Number& operator = (OCI_Number*& lhs);
2706 };
2707
2715 class Date : public core::HandleHolder<OCI_Date*>, public core::Streamable
2716 {
2717 friend class Statement;
2718 friend class Resultset;
2719 friend class support::BindArray;
2720 friend class Object;
2721 template<class>
2722 friend class Collection;
2723 friend class Message;
2724
2725 public:
2726
2732 static Date SysDate();
2733
2741 Date(bool create = false);
2742
2751 Date(const Date& other);
2752
2761 Date& operator= (const Date& other) noexcept;
2762
2777 Date(const otext* str, const otext* format = OTEXT(""));
2778
2794 Date(const ostring& str, const ostring& format = OTEXT(""));
2795
2801 bool IsValid() const;
2802
2808 int GetYear() const;
2809
2815 void SetYear(int value);
2816
2822 int GetMonth() const;
2823
2829 void SetMonth(int value);
2830
2836 int GetDay() const;
2837
2843 void SetDay(int value);
2844
2850 int GetHours() const;
2851
2857 void SetHours(int value);
2858
2864 int GetMinutes() const;
2865
2871 void SetMinutes(int value);
2872
2878 int GetSeconds() const;
2879
2885 void SetSeconds(int value);
2886
2894 int DaysBetween(const Date& other) const;
2895
2905 void SetDate(int year, int month, int day);
2906
2916 void SetTime(int hour, int min, int sec);
2917
2930 void SetDateTime(int year, int month, int day, int hour, int min, int sec);
2931
2941 void GetDate(int& year, int& month, int& day) const;
2942
2952 void GetTime(int& hour, int& min, int& sec) const;
2953
2966 void GetDateTime(int& year, int& month, int& day, int& hour, int& min, int& sec) const;
2967
2975 void AddDays(int days);
2976
2984 void AddMonths(int months);
2985
2993 Date NextDay(const ostring& day) const;
2994
3000 Date LastDay() const;
3001
3010 void ChangeTimeZone(const ostring& tzSrc, const ostring& tzDst);
3011
3026 void FromString(const ostring& str, const ostring& format = OTEXT(""));
3027
3038 ostring ToString(const ostring& format) const;
3039
3048 ostring ToString() const override;
3049
3055 Date Clone() const;
3056
3062 Date& operator ++ ();
3063
3069 Date operator ++ (int);
3070
3076 Date& operator -- ();
3077
3083 Date operator -- (int);
3084
3090 Date operator + (int value) const;
3091
3097 Date operator - (int value) const;
3098
3104 Date& operator += (int value);
3105
3111 Date& operator -= (int value);
3112
3118 bool operator == (const Date& other) const;
3119
3125 bool operator != (const Date& other) const;
3126
3132 bool operator > (const Date& other) const;
3133
3139 bool operator < (const Date& other) const;
3140
3146 bool operator >= (const Date& other) const;
3147
3153 bool operator <= (const Date& other) const;
3154
3155 private:
3156
3157 int Compare(const Date& other) const;
3158
3159 Date(OCI_Date* pDate, core::Handle* parent = nullptr);
3160
3161 void Allocate();
3162 };
3163
3171 class Interval : public core::HandleHolder<OCI_Interval*>, public core::Streamable
3172 {
3173 friend class Environment;
3174 friend class Statement;
3175 friend class Resultset;
3176 friend class support::BindArray;
3177 friend class Object;
3178 template<class>
3179 friend class Collection;
3180
3181 public:
3182
3189 {
3191 YearMonth = OCI_INTERVAL_YM,
3193 DaySecond = OCI_INTERVAL_DS
3195
3204
3210 Interval();
3211
3219 Interval(IntervalType type);
3220
3229 Interval(const Interval& other);
3230
3239 Interval& operator= (const Interval& other) noexcept;
3240
3252 Interval(IntervalType type, const ostring& data);
3253
3259 IntervalType GetType() const;
3260
3266 bool IsValid() const;
3267
3276 int GetYear() const;
3277
3286 void SetYear(int value);
3287
3296 int GetMonth() const;
3297
3306 void SetMonth(int value);
3307
3316 int GetDay() const;
3317
3326 void SetDay(int value);
3327
3336 int GetHours() const;
3337
3346 void SetHours(int value);
3347
3356 int GetMinutes() const;
3357
3366 void SetMinutes(int value);
3367
3376 int GetSeconds() const;
3377
3386 void SetSeconds(int value);
3387
3393 int GetMilliSeconds() const;
3394
3400 void SetMilliSeconds(int value);
3401
3407 int GetNanoSeconds() const;
3408
3414 void SetNanoSeconds(int value);
3415
3430 void GetDaySecond(int& day, int& hour, int& min, int& sec, int& nsec) const;
3431
3446 void SetDaySecond(int day, int hour, int min, int sec, int nsec);
3447
3459 void GetYearMonth(int& year, int& month) const;
3460
3472 void SetYearMonth(int year, int month);
3473
3481 void UpdateTimeZone(const ostring& timeZone);
3482
3493 void FromString(const ostring& data);
3494
3503 ostring ToString(int leadingPrecision, int fractionPrecision) const;
3504
3510 ostring ToString() const override;
3511
3517 Interval Clone() const;
3518
3524 Interval operator + (const Interval& other) const;
3525
3531 Interval operator - (const Interval& other) const;
3532
3538 Interval& operator += (const Interval& other);
3539
3545 Interval& operator -= (const Interval& other);
3546
3552 bool operator == (const Interval& other) const;
3553
3559 bool operator != (const Interval& other) const;
3560
3566 bool operator > (const Interval& other) const;
3567
3573 bool operator < (const Interval& other) const;
3574
3580 bool operator >= (const Interval& other) const;
3581
3587 bool operator <= (const Interval& other) const;
3588
3589 private:
3590
3591 int Compare(const Interval& other) const;
3592
3593 void Allocate(IntervalType type);
3594
3595 Interval(OCI_Interval* pInterval, core::Handle* parent = nullptr);
3596 };
3597
3606 class Timestamp : public core::HandleHolder<OCI_Timestamp*>, public core::Streamable
3607 {
3608 friend class Environment;
3609 friend class Statement;
3610 friend class Resultset;
3611 friend class support::BindArray;
3612 friend class Object;
3613 friend class Connection;
3614 template<class>
3615 friend class Collection;
3616
3617 public:
3618
3625 {
3627 NoTimeZone = OCI_TIMESTAMP,
3629 WithTimeZone = OCI_TIMESTAMP_TZ,
3631 WithLocalTimeZone = OCI_TIMESTAMP_LTZ
3633
3642
3650 static Timestamp SysTimestamp(TimestampType type = NoTimeZone);
3651
3657 Timestamp();
3658
3667 Timestamp(const Timestamp& other);
3668
3677 Timestamp& operator= (const Timestamp& other) noexcept;
3678
3687
3700 Timestamp(TimestampType type, const ostring& data, const ostring& format = OTEXT(""));
3701
3707 TimestampType GetType() const;
3708
3716 void Convert(const Timestamp& other);
3717
3723 bool IsValid() const;
3724
3730 int GetYear() const;
3731
3737 void SetYear(int value);
3738
3744 int GetMonth() const;
3745
3751 void SetMonth(int value);
3752
3758 int GetDay() const;
3759
3765 void SetDay(int value);
3766
3772 int GetHours() const;
3773
3779 void SetHours(int value);
3780
3786 int GetMinutes() const;
3787
3793 void SetMinutes(int value);
3794
3800 int GetSeconds() const;
3801
3807 void SetSeconds(int value);
3808
3814 int GetMilliSeconds() const;
3815
3821 void SetMilliSeconds(int value);
3822
3832 void GetDate(int& year, int& month, int& day) const;
3833
3844 void GetTime(int& hour, int& min, int& sec, int& fsec) const;
3845
3855 void SetDate(int year, int month, int day);
3856
3867 void SetTime(int hour, int min, int sec, int fsec);
3868
3882 void GetDateTime(int& year, int& month, int& day, int& hour, int& min, int& sec, int& fsec) const;
3883
3898 void SetDateTime(int year, int month, int day, int hour, int min, int sec, int fsec, const ostring& timeZone = OTEXT(""));
3899
3908 ostring GetTimeZone() const;
3909
3919 void SetTimeZone(const ostring& timeZone);
3920
3929 void GetTimeZoneOffset(int& hour, int& min) const;
3930
3943 static void Substract(const Timestamp& lsh, const Timestamp& rsh, Interval& result);
3944
3956 void FromString(const ostring& data, const ostring& format = OCI_STRING_FORMAT_DATE);
3957
3969 ostring ToString(const ostring& format, int precision) const;
3970
3976 ostring ToString() const override;
3977
3983 Timestamp Clone() const;
3984
3990 Timestamp& operator ++ ();
3991
3997 Timestamp operator ++ (int);
3998
4004 Timestamp& operator -- ();
4005
4011 Timestamp operator -- (int);
4012
4018 Timestamp operator + (int value) const;
4019
4025 Timestamp operator - (int value) const;
4026
4032 Interval operator - (const Timestamp& other);
4033
4039 Timestamp& operator += (int value);
4040
4046 Timestamp& operator -= (int value);
4047
4053 Timestamp operator + (const Interval& other) const;
4054
4060 Timestamp operator - (const Interval& other) const;
4061
4067 Timestamp& operator += (const Interval& other);
4068
4074 Timestamp& operator -= (const Interval& other);
4075
4081 bool operator == (const Timestamp& other) const;
4082
4088 bool operator != (const Timestamp& other) const;
4089
4095 bool operator > (const Timestamp& other) const;
4096
4102 bool operator < (const Timestamp& other) const;
4103
4109 bool operator >= (const Timestamp& other) const;
4110
4116 bool operator <= (const Timestamp& other) const;
4117
4118 private:
4119
4120 int Compare(const Timestamp& other) const;
4121
4122 void Allocate(TimestampType type);
4123
4124 Timestamp(OCI_Timestamp* pTimestamp, core::Handle* parent = nullptr);
4125 };
4126
4134 template<class T, int U>
4135 class Lob : public core::HandleHolder<OCI_Lob*>
4136 {
4137 friend class Statement;
4138 friend class Resultset;
4139 friend class support::BindArray;
4140 friend class Object;
4141 template<class>
4142 friend class Collection;
4143
4144 public:
4145
4151 Lob();
4152
4163 Lob(const Connection& connection);
4164
4175 T Read(unsigned int length);
4176
4187 unsigned int Write(const T& content);
4188
4199 unsigned int Append(const T& content);
4200
4208 void Append(const Lob& other);
4209
4224 bool Seek(SeekMode seekMode, big_uint offset);
4225
4231 LobType GetType() const;
4232
4238 big_uint GetOffset() const;
4239
4245 big_uint GetLength() const;
4246
4252 big_uint GetMaxSize() const;
4253
4265 big_uint GetChunkSize() const;
4266
4272 Connection GetConnection() const;
4273
4281 void Truncate(big_uint length);
4282
4298 big_uint Erase(big_uint offset, big_uint length);
4299
4313 void Copy(Lob& dest, big_uint offset, big_uint offsetDest, big_uint length) const;
4314
4320 bool IsTemporary() const;
4321
4327 bool IsRemote() const;
4328
4341 void Open(OpenMode mode);
4342
4348 void Flush();
4349
4358 void Close();
4359
4378 void EnableBuffering(bool value);
4379
4385 Lob Clone() const;
4386
4392 Lob& operator += (const Lob& other);
4393
4399 bool operator == (const Lob& other) const;
4400
4406 bool operator != (const Lob& other) const;
4407
4408 private:
4409
4410 bool Equals(const Lob& other) const;
4411
4412 Lob(OCI_Lob* pLob, core::Handle* parent = nullptr);
4413
4414 };
4415
4426
4437
4448
4457 class File : public core::HandleHolder<OCI_File*>
4458 {
4459 friend class Statement;
4460 friend class Resultset;
4461 friend class support::BindArray;
4462 friend class Object;
4463 template<class>
4464 friend class Collection;
4465
4466 public:
4467
4473 File();
4474
4485 File(const Connection& connection);
4486
4501 File(const Connection& connection, const ostring& directory, const ostring& name);
4502
4513 Raw Read(unsigned int size);
4514
4529 bool Seek(SeekMode seekMode, big_uint offset);
4530
4539 bool Exists() const;
4540
4546 big_uint GetOffset() const;
4547
4553 big_uint GetLength() const;
4554
4560 Connection GetConnection() const;
4561
4574 void SetInfos(const ostring& directory, const ostring& name);
4575
4581 ostring GetName() const;
4582
4588 ostring GetDirectory() const;
4589
4595 void Open();
4596
4602 void Close();
4603
4609 bool IsOpened() const;
4610
4616 File Clone() const;
4617
4623 bool operator == (const File& other) const;
4624
4630 bool operator != (const File& other) const;
4631
4632 private:
4633
4634 bool Equals(const File& other) const;
4635
4636 File(OCI_File* pFile, core::Handle* parent = nullptr);
4637 };
4638
4646 class TypeInfo : public core::HandleHolder<OCI_TypeInfo*>
4647 {
4648 friend class Object;
4649 friend class Reference;
4650 template<class>
4651 friend class Collection;
4652 friend class Column;
4653 public:
4654
4661 {
4663 Table = OCI_TIF_TABLE,
4665 View = OCI_TIF_VIEW,
4667 Type = OCI_TIF_TYPE
4669
4678
4691 TypeInfo(const Connection& connection, const ostring& name, TypeInfoType type);
4692
4698 TypeInfoType GetType() const;
4699
4705 ostring GetName() const;
4706
4712 Connection GetConnection() const;
4713
4723 unsigned int GetColumnCount() const;
4724
4739 Column GetColumn(unsigned int index) const;
4740
4753 boolean IsFinalType() const;
4754
4769 TypeInfo GetSuperType() const;
4770
4771 private:
4772
4773 TypeInfo(OCI_TypeInfo* pTypeInfo, core::Handle* parent);
4774 };
4775
4783 class Object : public core::HandleHolder<OCI_Object*>, public core::Streamable
4784 {
4785 friend class Statement;
4786 friend class Resultset;
4787 friend class support::BindArray;
4788 friend class Reference;
4789 template<class>
4790 friend class Collection;
4791 friend class Message;
4792
4793 public:
4794
4801 {
4803 Persistent = OCI_OBJ_PERSISTENT,
4805 Transient = OCI_OBJ_TRANSIENT,
4807 Value = OCI_OBJ_VALUE
4809
4818
4824 Object();
4825
4833 Object(const TypeInfo& typeInfo);
4834
4842 bool IsAttributeNull(const ostring& name) const;
4843
4851 void SetAttributeNull(const ostring& name);
4852
4858 TypeInfo GetTypeInfo() const;
4859
4865 Reference GetReference() const;
4866
4872 ObjectType GetType() const;
4873
4886 template<class T>
4887 T Get(const ostring& name) const;
4888
4902 template<class T>
4903 void Get(const ostring& name, T& value) const;
4904
4918 template<class T>
4919 void Get(const ostring& name, Collection<T>& value) const;
4920
4934 template<class T>
4935 void Set(const ostring& name, const T& value);
4936
4942 Object Clone() const;
4943
4949 ostring ToString() const override;
4950
4951 private:
4952
4953 Object(OCI_Object* pObject, core::Handle* parent = nullptr);
4954 };
4955
4963 class Reference : public core::HandleHolder<OCI_Ref*>, public core::Streamable
4964 {
4965 friend class Statement;
4966 friend class Resultset;
4967 friend class support::BindArray;
4968 friend class Object;
4969 template<class>
4970 friend class Collection;
4971
4972 public:
4973
4979 Reference();
4980
4988 Reference(const TypeInfo& typeInfo);
4989
4995 TypeInfo GetTypeInfo() const;
4996
5005 Object GetObject() const;
5006
5012 bool IsReferenceNull() const;
5013
5022 void SetReferenceNull();
5023
5029 Reference Clone() const;
5030
5036 ostring ToString() const override;
5037
5038 private:
5039
5040 Reference(OCI_Ref* pRef, core::Handle* parent = nullptr);
5041 };
5042
5050 class XmlType : public core::HandleHolder<OCI_XmlType*>, public core::Streamable
5051 {
5052 friend class Resultset;
5053
5054 public:
5055
5061 ostring ToString() const override;
5062
5063 private:
5064
5065 XmlType(OCI_XmlType* pXmlType, core::Handle* parent = nullptr);
5066 };
5067
5076 template<class T>
5078 {
5079 template<class>
5080 friend class CollectionIterator;
5081
5082 public:
5083
5084 typedef T ValueType;
5086
5088 CollectionElement(CollectionType* coll, unsigned int pos);
5089 operator T() const;
5090 CollectionElement& operator = (const ValueType& other);
5091 CollectionElement& operator = (const CollectionElement& other);
5092 bool IsNull() const;
5093 void SetNull();
5094
5095 private:
5096
5097 CollectionType* _coll;
5098 unsigned int _pos;
5099 };
5100
5108 template<class T>
5110 {
5111 public:
5112
5113 template<class>
5114 friend class Collection;
5115
5116 typedef typename T::ValueType value_type;
5118
5119 typedef std::random_access_iterator_tag iterator_category;
5120 typedef ptrdiff_t difference_type;
5121 typedef ptrdiff_t distance_type;
5122 typedef value_type* pointer;
5123 typedef value_type& reference;
5124
5127
5128 CollectionIterator& operator = (const CollectionIterator& other);
5129
5130 CollectionIterator& operator += (difference_type value);
5131 CollectionIterator& operator -= (difference_type value);
5132
5133 T& operator*();
5134 T* operator->();
5135
5136 CollectionIterator& operator++();
5137 CollectionIterator& operator--();
5138
5139 CollectionIterator operator++(int);
5140 CollectionIterator operator--(int);
5141
5142 CollectionIterator operator + (difference_type value);
5143 CollectionIterator operator - (difference_type value);
5144
5145 difference_type operator - (const CollectionIterator& other);
5146
5147 bool operator == (const CollectionIterator& other);
5148 bool operator != (const CollectionIterator& other);
5149 bool operator > (const CollectionIterator& other);
5150 bool operator < (const CollectionIterator& other);
5151 bool operator >= (const CollectionIterator& other);
5152 bool operator <= (const CollectionIterator& other);
5153
5154 protected:
5155
5156 CollectionIterator(CollectionType* collection, unsigned int pos);
5157
5158 T _elem;
5159 };
5160
5168 template<class T>
5169 class Collection : public core::HandleHolder<OCI_Coll*>, public core::Streamable
5170 {
5171 friend class Statement;
5172 friend class Resultset;
5173 friend class support::BindArray;
5174 friend class Object;
5175 template<class>
5176 friend class CollectionIterator;
5177 template<class>
5178 friend class Collection;
5179
5180 public:
5181
5188 {
5190 Varray = OCI_COLL_VARRAY,
5192 NestedTable = OCI_COLL_NESTED_TABLE,
5194 IndexedTable = OCI_COLL_INDEXED_TABLE
5196
5205
5211 Collection();
5212
5220 Collection(const TypeInfo& typeInfo);
5221
5227 CollectionType GetType() const;
5228
5234 unsigned int GetMax() const;
5235
5241 unsigned int GetSize() const;
5242
5253 unsigned int GetCount() const;
5254
5262 void Truncate(unsigned int size);
5263
5270 void Clear();
5271
5282 bool IsElementNull(unsigned int index) const;
5283
5294 void SetElementNull(unsigned int index);
5295
5313 bool Delete(unsigned int index) const;
5314
5322 T Get(unsigned int index) const;
5323
5332 void Set(unsigned int index, const T& value);
5333
5342 void Append(const T& value);
5343
5349 TypeInfo GetTypeInfo() const;
5350
5356 Collection Clone() const;
5357
5363 ostring ToString() const override;
5364
5371
5378
5384 iterator begin();
5385
5391 const_iterator begin() const;
5392
5398 iterator end();
5399
5405 const_iterator end() const;
5406
5412 CollectionElement<T> operator [] (unsigned int index);
5413
5419 CollectionElement<T> operator [](unsigned int index) const;
5420
5421 private:
5422
5423 static T GetElem(OCI_Elem* elem, core::Handle* parent);
5424
5425 static void SetElem(OCI_Elem* elem, const T& value);
5426
5427 Collection(OCI_Coll* pColl, core::Handle* parent = nullptr);
5428 };
5429
5437 template<class T, int U>
5438 class Long : public core::HandleHolder<OCI_Long*>
5439 {
5440 friend class Statement;
5441 friend class Resultset;
5442 friend class support::BindArray;
5443
5444 public:
5445
5451 Long();
5452
5460 Long(const Statement& statement);
5461
5472 unsigned int Write(const T& content);
5473
5479 unsigned int GetLength() const;
5480
5486 T GetContent() const;
5487
5488 private:
5489
5490 Long(OCI_Long* pLong, core::Handle* parent = nullptr);
5491 };
5492
5503
5514
5522 class BindInfo : public core::HandleHolder<OCI_Bind*>
5523 {
5524 friend class Statement;
5525
5526 public:
5527
5534 {
5536 In = OCI_BDM_IN,
5538 Out = OCI_BDM_OUT,
5540 InOut = OCI_BDM_IN_OUT
5542
5551
5558 {
5560 AsArray = 1,
5562 AsPlSqlTable = 2
5564
5573
5579 ostring GetName() const;
5580
5586 DataType GetType() const;
5587
5607 unsigned int GetSubType() const;
5608
5618 unsigned int GetDataCount() const;
5619
5625 Statement GetStatement() const;
5626
5647 void SetDataNull(bool value, unsigned int index = 1);
5648
5663 bool IsDataNull(unsigned int index = 1) const;
5664
5678 void SetCharsetForm(CharsetForm value);
5679
5685 BindDirection GetDirection() const;
5686
5687 private:
5688
5689 BindInfo(OCI_Bind* pBind, core::Handle* parent);
5690 };
5691
5699 class Statement : public core::HandleHolder<OCI_Statement*>
5700 {
5701 friend class Exception;
5702 friend class Resultset;
5703 template<class, int>
5704 friend class Long;
5705 friend class BindInfo;
5706 friend class BindObject;
5707
5708 public:
5709
5716 {
5718 TypeSelect = OCI_CST_SELECT,
5720 TypeUpdate = OCI_CST_UPDATE,
5722 TypeDelete = OCI_CST_DELETE,
5724 TypeInsert = OCI_CST_INSERT,
5726 TypeCreate = OCI_CST_CREATE,
5728 TypeDrop = OCI_CST_DROP,
5730 TypeAlter = OCI_CST_ALTER,
5732 TypeBegin = OCI_CST_BEGIN,
5734 TypeDeclare = OCI_CST_DECLARE,
5736 TypeCall = OCI_CST_CALL,
5738 TypeMerge = OCI_CST_MERGE
5740
5749
5756 {
5758 FetchForward = OCI_SFM_DEFAULT,
5760 FetchScrollable = OCI_SFM_SCROLLABLE
5762
5771
5778 {
5780 BindByPosition = OCI_BIND_BY_POS,
5782 BindByName = OCI_BIND_BY_NAME
5784
5793
5800 {
5802 LongExplicit = OCI_LONG_EXPLICIT,
5804 LongImplicit = OCI_LONG_IMPLICIT
5806
5815
5821 Statement();
5822
5833 Statement(const Connection& connection);
5834
5840 Connection GetConnection() const;
5841
5868 void Describe(const ostring& sql);
5869
5893 void Parse(const ostring& sql);
5894
5905 void Prepare(const ostring& sql);
5906
5912 void ExecutePrepared();
5913
5921 void Execute(const ostring& sql);
5922
5940 template<class T>
5941 unsigned int ExecutePrepared(T callback);
5942
5963 template<class T, class U>
5964 unsigned int ExecutePrepared(T callback, U adapter);
5965
5984 template<class T>
5985 unsigned int Execute(const ostring& sql, T callback);
5986
6008 template<class T, class U>
6009 unsigned int Execute(const ostring& sql, T callback, U adapter);
6010
6025 unsigned int GetAffectedRows() const;
6026
6032 ostring GetSql() const;
6033
6039 ostring GetSqlIdentifier() const;
6040
6052 Resultset GetResultset();
6053
6075 Resultset GetNextResultset();
6076
6101 void SetBindArraySize(unsigned int size);
6102
6108 unsigned int GetBindArraySize() const;
6109
6125 void AllowRebinding(bool value);
6126
6135 bool IsRebindingAllowed() const;
6136
6153 unsigned int GetBindIndex(const ostring& name) const;
6154
6160 unsigned int GetBindCount() const;
6161
6176 BindInfo GetBind(unsigned int index) const;
6177
6188 BindInfo GetBind(const ostring& name) const;
6189
6209 template<class T>
6210 void Bind(const ostring& name, T& value, BindInfo::BindDirection mode);
6211
6233 template<class T, class U>
6234 void Bind(const ostring& name, T& value, U extraInfo, BindInfo::BindDirection mode);
6235
6247 template<class T>
6248 void Bind(const ostring& name, Collection<T>& value, BindInfo::BindDirection mode);
6249
6270 template<class T>
6271 void Bind(const ostring& name, std::vector<T>& values, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6272
6293 template<class T>
6294 void Bind(const ostring& name, std::vector<T>& values, TypeInfo& typeInfo, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6295
6309 template<class T>
6310 void Bind(const ostring& name, std::vector<Collection<T> >& values, TypeInfo& typeInfo, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6311
6335 template<class T, class U>
6336 void Bind(const ostring& name, std::vector<T>& values, U extraInfo, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6337
6358 template<class T>
6359 void Register(const ostring& name);
6360
6378 template<class T, class U>
6379 void Register(const ostring& name, U& extraInfo);
6380
6399 template<class T, class U>
6400 void Register(const ostring& name, U extraInfo);
6401
6407 StatementType GetStatementType() const;
6408
6418 unsigned int GetSqlErrorPos() const;
6419
6430 void SetFetchMode(FetchMode value);
6431
6440 FetchMode GetFetchMode() const;
6441
6449 void SetBindMode(BindMode value);
6450
6459 BindMode GetBindMode() const;
6460
6468 void SetFetchSize(unsigned int value);
6469
6478 unsigned int GetFetchSize() const;
6479
6490 void SetPrefetchSize(unsigned int value);
6491
6500 unsigned int GetPrefetchSize() const;
6501
6520 void SetPrefetchMemory(unsigned int value);
6521
6530 unsigned int GetPrefetchMemory() const;
6531
6539 void SetPieceSize(unsigned int value);
6540
6549 unsigned int GetPieceSize() const;
6550
6561 void SetLongMode(LongMode value);
6562
6568 LongMode GetLongMode() const;
6569
6582 unsigned int GetSQLCommand() const;
6583
6596 ostring GetSQLVerb() const;
6597
6603 void GetBatchErrors(std::vector<Exception>& exceptions);
6604
6605 private:
6606
6607 static bool IsResultsetHandle(core::Handle* handle);
6608 static void OnFreeSmartHandle(SmartHandle* smartHandle);
6609
6610 Statement(OCI_Statement* stmt, core::Handle* parent = nullptr);
6611
6612 support::BindsHolder* GetBindsHolder(bool create) const;
6613
6614 void ReleaseResultsets() const;
6615
6616 void SetLastBindMode(BindInfo::BindDirection mode);
6617
6618 void SetInData() const;
6619 void SetOutData() const;
6620 void ClearBinds() const;
6621
6622 template<typename M, class T>
6623 void Bind1(M& method, const ostring& name, T& value, BindInfo::BindDirection mode);
6624
6625 template<typename M, class T>
6626 void Bind2(M& method, const ostring& name, T& value, BindInfo::BindDirection mode);
6627
6628 template<typename M, class T>
6629 void BindVector1(M& method, const ostring& name, std::vector<T>& values, BindInfo::BindDirection mode, BindInfo::VectorType type);
6630
6631 template<typename M, class T, class U>
6632 void BindVector2(M& method, const ostring& name, std::vector<T>& values, BindInfo::BindDirection mode, U subType, BindInfo::VectorType type);
6633
6634 template<typename T>
6635 unsigned int Fetch(T callback);
6636
6637 template<typename T, typename U>
6638 unsigned int Fetch(T callback, U adapter);
6639 };
6640
6648 class Resultset : public core::HandleHolder<OCI_Resultset*>
6649 {
6650 friend class Statement;
6651 public:
6652
6659 {
6661 SeekAbsolute = OCI_SFD_ABSOLUTE,
6663 SeekRelative = OCI_SFD_RELATIVE
6665
6674
6687 template<class T>
6688 T Get(unsigned int index) const;
6689
6703 template<class T>
6704 void Get(unsigned int index, T& value) const;
6705
6718 template<class T>
6719 T Get(const ostring& name) const;
6720
6731 template<class T>
6732 void Get(const ostring& name, T& value) const;
6733
6748 template<class T, class U>
6749 bool Get(T& value, U adapter) const;
6750
6766 template<typename T>
6767 unsigned int ForEach(T callback);
6768
6791 template<typename T, typename U>
6792 unsigned int ForEach(T callback, U adapter);
6793
6807 bool Next();
6808
6822 bool Prev();
6823
6835 bool First();
6836
6848 bool Last();
6849
6870 bool Seek(SeekMode mode, int offset);
6871
6877 unsigned int GetCount() const;
6878
6889 unsigned int GetCurrentRow() const;
6890
6904 unsigned int GetColumnIndex(const ostring& name) const;
6905
6911 unsigned int GetColumnCount() const;
6912
6923 Column GetColumn(unsigned int index) const;
6924
6935 Column GetColumn(const ostring& name) const;
6936
6947 bool IsColumnNull(unsigned int index) const;
6948
6956 bool IsColumnNull(const ostring& name) const;
6957
6963 Statement GetStatement() const;
6964
6970 bool operator ++ (int);
6971
6977 bool operator -- (int);
6978
6985 bool operator += (int offset);
6986
6993 bool operator -= (int offset);
6994
6995 private:
6996
6997 Resultset(OCI_Resultset* resultset, core::Handle* parent);
6998 };
6999
7007 class Column : public core::HandleHolder<OCI_Column*>
7008 {
7009 friend class TypeInfo;
7010 friend class Resultset;
7011
7012 public:
7013
7020 {
7022 NoFlags = OCI_CPF_NONE,
7025 IsIdentity = OCI_CPF_IS_IDENTITY,
7029 IsGeneratedAlways = OCI_CPF_IS_GEN_ALWAYS,
7032 IsGeneratedByDefaultOnNull = OCI_CPF_IS_GEN_BY_DEFAULT_ON_NULL,
7034 IsLogicalPartitioning = OCI_CPF_IS_LPART,
7036 IsGeneratedByContainers = OCI_CPF_IS_CONID
7038
7047
7053 ostring GetName() const;
7054
7063 ostring GetSQLType() const;
7064
7074 ostring GetFullSQLType() const;
7075
7081 DataType GetType() const;
7082
7100 unsigned int GetSubType() const;
7101
7107 CharsetForm GetCharsetForm() const;
7108
7114 CollationID GetCollationID() const;
7115
7125 unsigned int GetSize() const;
7126
7132 int GetScale() const;
7133
7139 int GetPrecision() const;
7140
7146 int GetFractionalPrecision() const;
7147
7153 int GetLeadingPrecision() const;
7154
7165 PropertyFlags GetPropertyFlags() const;
7166
7172 bool IsNullable() const;
7173
7183 bool IsCharSemanticUsed() const;
7184
7194 TypeInfo GetTypeInfo() const;
7195
7196 private:
7197
7198 Column(OCI_Column* pColumn, core::Handle* parent);
7199 };
7200
7211 class Subscription : public core::HandleHolder<OCI_Subscription*>
7212 {
7213 friend class Event;
7214
7215 public:
7216
7224 typedef void (*NotifyHandlerProc) (Event& evt);
7225
7232 {
7234 ObjectChanges = OCI_CNT_OBJECTS,
7236 RowChanges = OCI_CNT_ROWS,
7238 DatabaseChanges = OCI_CNT_DATABASES,
7240 AllChanges = OCI_CNT_ALL
7242
7251
7257 Subscription();
7258
7274 void Register(const Connection& connection, const ostring& name, ChangeTypes changeTypes, NotifyHandlerProc handler, unsigned int port = 0, unsigned int timeout = 0);
7275
7290 void Unregister();
7291
7297 void Watch(const ostring& sql);
7298
7304 ostring GetName() const;
7305
7311 unsigned int GetTimeout() const;
7312
7318 unsigned int GetPort() const;
7319
7328 Connection GetConnection() const;
7329
7330 private:
7331
7332 Subscription(OCI_Subscription* pSubcription);
7333 };
7334
7345 class Event : public core::HandleHolder<OCI_Event*>
7346 {
7347 friend class Subscription;
7348 friend class Environment;
7349
7350 public:
7351
7358 {
7360 DatabaseStart = OCI_ENT_STARTUP,
7362 DatabaseShutdown = OCI_ENT_SHUTDOWN,
7364 DatabaseShutdownAny = OCI_ENT_SHUTDOWN_ANY,
7366 DatabaseDrop = OCI_ENT_DROP_DATABASE,
7368 Unregister = OCI_ENT_DEREGISTER,
7370 ObjectChanged = OCI_ENT_OBJECT_CHANGED
7372
7381
7388 {
7390 ObjectInserted = OCI_ONT_INSERT,
7392 ObjectUpdated = OCI_ONT_UPDATE,
7394 ObjectDeleted = OCI_ONT_DELETE,
7396 ObjectAltered = OCI_ONT_ALTER,
7398 ObjectDropped = OCI_ONT_DROP,
7400 ObjectGeneric = OCI_ONT_GENERIC
7402
7411
7417 EventType GetType() const;
7418
7427 ObjectEvent GetObjectEvent() const;
7428
7434 ostring GetDatabaseName() const;
7435
7444 ostring GetObjectName() const;
7445
7451 ostring GetRowID() const;
7452
7458 Subscription GetSubscription() const;
7459
7460 private:
7461
7462 Event(OCI_Event* pEvent);
7463 };
7464
7472 class Agent : public core::HandleHolder<OCI_Agent*>
7473 {
7474 friend class Message;
7475 friend class Dequeue;
7476
7477 public:
7478
7501 Agent(const Connection& connection, const ostring& name = OTEXT(""), const ostring& address = OTEXT(""));
7502
7508 ostring GetName() const;
7509
7523 void SetName(const ostring& value);
7524
7533 ostring GetAddress() const;
7534
7548 void SetAddress(const ostring& value);
7549
7550 private:
7551
7552 Agent(OCI_Agent* pAgent, core::Handle* parent);
7553 };
7554
7562 class Message : public core::HandleHolder<OCI_Msg*>
7563 {
7564 friend class Dequeue;
7565
7566 public:
7567
7574 {
7576 Ready = OCI_AMS_READY,
7578 Waiting = OCI_AMS_WAITING,
7580 Processed = OCI_AMS_PROCESSED,
7582 Expired = OCI_AMS_EXPIRED
7584
7593
7623 Message(const TypeInfo& typeInfo);
7624
7633 void Reset();
7634
7640 template<class T>
7642
7650 template<class T>
7651 void SetPayload(const T& value);
7652
7661 Date GetEnqueueTime() const;
7662
7668 int GetAttemptCount() const;
7669
7675 MessageState GetState() const;
7676
7687 Raw GetID() const;
7688
7697 int GetExpiration() const;
7698
7718 void SetExpiration(int value);
7719
7728 int GetEnqueueDelay() const;
7729
7752 void SetEnqueueDelay(int value);
7753
7762 int GetPriority() const;
7763
7776 void SetPriority(int value);
7777
7787 Raw GetOriginalID() const;
7788
7800 void SetOriginalID(const Raw& value);
7801
7810 ostring GetCorrelation() const;
7811
7822 void SetCorrelation(const ostring& value);
7823
7837 ostring GetExceptionQueue() const;
7838
7865 void SetExceptionQueue(const ostring& value);
7866
7875 Agent GetSender() const;
7876
7884 void SetSender(const Agent& agent);
7885
7897 void SetConsumers(std::vector<Agent>& agents);
7898
7899 private:
7900
7901 Message(OCI_Msg* pMessage, core::Handle* parent);
7902 };
7903
7911 class Enqueue : public core::HandleHolder<OCI_Enqueue*>
7912 {
7913 public:
7914
7921 {
7923 Before = OCI_ASD_BEFORE,
7925 OnTop = OCI_ASD_TOP
7927
7936
7943 {
7945 Immediate = OCI_AMV_IMMEDIATE,
7947 OnCommit = OCI_AMV_ON_COMMIT
7949
7958
7980 Enqueue(const TypeInfo& typeInfo, const ostring& queueName);
7981
7989 void Put(const Message& message);
7990
7999 EnqueueVisibility GetVisibility() const;
8000
8011 void SetVisibility(EnqueueVisibility value);
8012
8021 EnqueueMode GetMode() const;
8022
8041 void SetMode(EnqueueMode value);
8042
8053 Raw GetRelativeMsgID() const;
8054
8068 void SetRelativeMsgID(const Raw& value);
8069 };
8070
8078 class Dequeue : public core::HandleHolder<OCI_Dequeue*>
8079 {
8080 friend class Environment;
8081
8082 public:
8083
8091 typedef void (*NotifyAQHandlerProc) (Dequeue& dequeue);
8092
8099 {
8101 Browse = OCI_ADM_BROWSE,
8103 Locked = OCI_ADM_LOCKED,
8105 Remove = OCI_ADM_REMOVE,
8107 Confirm = OCI_ADM_REMOVE_NODATA
8109
8118
8125 {
8127 Immediate = OCI_AMV_IMMEDIATE,
8129 OnCommit = OCI_AMV_ON_COMMIT
8131
8140
8147 {
8149 FirstMessage = OCI_ADN_FIRST_MSG,
8151 NextMessage = OCI_ADN_NEXT_MSG,
8154 NextTransaction = OCI_ADN_NEXT_TRANSACTION
8156
8165
8174 Dequeue(const TypeInfo& typeInfo, const ostring& queueName);
8175
8189 Message Get();
8190
8206 Agent Listen(int timeout);
8207
8216 ostring GetConsumer() const;
8217
8229 void SetConsumer(const ostring& value);
8230
8239 ostring GetCorrelation() const;
8240
8252 void SetCorrelation(const ostring& value);
8253
8262 Raw GetRelativeMsgID() const;
8263
8271 void SetRelativeMsgID(const Raw& value);
8272
8281 DequeueVisibility GetVisibility() const;
8282
8297 void SetVisibility(DequeueVisibility value);
8298
8307 DequeueMode GetMode() const;
8308
8319 void SetMode(DequeueMode value);
8320
8329 NavigationMode GetNavigation() const;
8330
8350 void SetNavigation(NavigationMode value);
8351
8360 int GetWaitTime() const;
8361
8379 void SetWaitTime(int value);
8380
8388 void SetAgents(std::vector<Agent>& agents);
8389
8406 void Subscribe(unsigned int port, unsigned int timeout, NotifyAQHandlerProc handler);
8407
8416 void Unsubscribe();
8417
8418 private:
8419
8420 Dequeue(OCI_Dequeue* pDequeue, core::Handle* parent);
8421 };
8422
8428 class Queue
8429 {
8430 public:
8431
8438 {
8440 NormalQueue = OCI_AQT_NORMAL,
8442 ExceptionQueue = OCI_AQT_EXCEPTION,
8444 NonPersistentQueue = OCI_AQT_NON_PERSISTENT
8446
8455
8480 static void Create(const Connection& connection, const ostring& queue, const ostring& table, QueueType type = NormalQueue,
8481 unsigned int maxRetries = 0, unsigned int retryDelay = 0, unsigned int retentionTime = 0,
8482 bool dependencyTracking = false, const ostring& comment = OTEXT(""));
8483
8504 static void Alter(const Connection& connection, const ostring& queue,
8505 unsigned int maxRetries = 0, unsigned int retryDelay = 0,
8506 unsigned int retentionTime = 0, const ostring& comment = OTEXT(""));
8507
8523 static void Drop(const Connection& connection, const ostring& queue);
8524
8542 static void Start(const Connection& connection, const ostring& queue, bool enableEnqueue = true, bool enableDequeue = true);
8543
8562 static void Stop(const Connection& connection, const ostring& queue, bool stopEnqueue = true, bool stopDequeue = true, bool wait = true);
8563 };
8564
8571 {
8572 public:
8573
8581 {
8583 None = OCI_AGM_NONE,
8586 Transactionnal = OCI_AGM_TRANSACTIONNAL
8588
8597
8605 {
8607 Buffered = OCI_APM_BUFFERED,
8609 Persistent = OCI_APM_PERSISTENT,
8611 All = OCI_APM_ALL
8613
8622
8657 static void Create(const Connection& connection, const ostring& table, const ostring& payloadType, bool multipleConsumers,
8658 const ostring& storageClause = OTEXT(""), const ostring& sortList = OTEXT(""),
8659 GroupingMode groupingMode = None, const ostring& comment = OTEXT(""),
8660 unsigned int primaryInstance = 0, unsigned int secondaryInstance = 0,
8661 const ostring& compatible = OTEXT(""));
8662
8681 static void Alter(const Connection& connection, const ostring& table, const ostring& comment, unsigned int primaryInstance = 0, unsigned int secondaryInstance = 0);
8682
8703 static void Drop(const Connection& connection, const ostring& table, bool force = true);
8704
8728 static void Purge(const Connection& connection, const ostring& table, PurgeMode mode, const ostring& condition = OTEXT(""), bool block = true);
8729
8747 static void Migrate(const Connection& connection, const ostring& table, const ostring& compatible = OTEXT(""));
8748 };
8749
8757 class DirectPath : public core::HandleHolder<OCI_DirPath*>
8758 {
8759 public:
8760
8767 {
8769 Default = OCI_DCM_DEFAULT,
8771 Force = OCI_DCM_FORCE
8773
8782
8789 {
8791 ResultComplete = OCI_DPR_COMPLETE,
8793 ResultError = OCI_DPR_ERROR,
8795 ResultFull = OCI_DPR_FULL,
8797 ResultPartial = OCI_DPR_PARTIAL,
8799 ResultEmpty = OCI_DPR_EMPTY
8801
8810
8832 DirectPath(const TypeInfo& typeInfo, unsigned int nbCols, unsigned int nbRows, const ostring& partition = OTEXT(""));
8833
8850 void SetColumn(unsigned int colIndex, const ostring& name, unsigned int maxSize, const ostring& format = OTEXT(""));
8851
8882 template<class T>
8883 void SetEntry(unsigned int rowIndex, unsigned int colIndex, const T& value, bool complete = true);
8884
8895 void Reset();
8896
8902 void Prepare();
8903
8922 DirectPath::Result Convert();
8923
8935 DirectPath::Result Load();
8936
8945 void Finish();
8946
8959 void Abort();
8960
8969 void Save();
8970
8976 void FlushRow();
8977
8989 void SetCurrentRows(unsigned int value);
8990
8999 unsigned int GetCurrentRows() const;
9000
9009 unsigned int GetMaxRows() const;
9010
9019 unsigned int GetRowCount() const;
9020
9033 unsigned int GetAffectedRows() const;
9034
9048 void SetDateFormat(const ostring& format);
9049
9076 void SetParallel(bool value);
9077
9092 void SetNoLog(bool value);
9093
9107 void SetCacheSize(unsigned int value);
9108
9119 void SetBufferSize(unsigned int value);
9120
9134 void SetConversionMode(ConversionMode value);
9135
9164 unsigned int GetErrorColumn();
9165
9199 unsigned int GetErrorRow();
9200 };
9201
9202
9203#define OCILIB_DEFINE_FLAG_OPERATORS(T) \
9204 inline core::Flags<T> operator | (T a, T b) { return core::Flags<T>(a) | core::Flags<T>(b); } \
9205
9206 OCILIB_DEFINE_FLAG_OPERATORS(Environment::EnvironmentFlagsValues)
9207 OCILIB_DEFINE_FLAG_OPERATORS(Environment::SessionFlagsValues)
9208 OCILIB_DEFINE_FLAG_OPERATORS(Environment::StartFlagsValues)
9209 OCILIB_DEFINE_FLAG_OPERATORS(Environment::StartModeValues)
9210 OCILIB_DEFINE_FLAG_OPERATORS(Environment::ShutdownModeValues)
9211 OCILIB_DEFINE_FLAG_OPERATORS(Environment::ShutdownFlagsValues)
9212 OCILIB_DEFINE_FLAG_OPERATORS(Environment::AllocatedBytesValues)
9213 OCILIB_DEFINE_FLAG_OPERATORS(Transaction::TransactionFlagsValues)
9214 OCILIB_DEFINE_FLAG_OPERATORS(Column::PropertyFlagsValues)
9215 OCILIB_DEFINE_FLAG_OPERATORS(Subscription::ChangeTypesValues)
9216}
AQ identified agent for messages delivery.
Definition: types.hpp:7473
Provides SQL bind information.
Definition: types.hpp:5523
VectorTypeValues
Vector type values.
Definition: types.hpp:5558
BindDirectionValues
Bind direction enumerated values.
Definition: types.hpp:5534
core::Enum< VectorTypeValues > VectorType
Vector type.
Definition: types.hpp:5572
core::Enum< BindDirectionValues > BindDirection
Bind direction.
Definition: types.hpp:5550
Class used for handling transient collection value. it is used internally by the Collection<T> class:
Definition: types.hpp:5078
Object identifying the SQL data types VARRAY and NESTED TABLE.
Definition: types.hpp:5170
CollectionIterator< const CollectionElement< T > > const_iterator
Common const iterator declaration.
Definition: types.hpp:5377
core::Enum< CollectionTypeValues > CollectionType
Collection type.
Definition: types.hpp:5204
CollectionTypeValues
Collection type enumerated values.
Definition: types.hpp:5188
CollectionIterator< CollectionElement< T > > iterator
Common iterator declaration.
Definition: types.hpp:5370
STL compliant Collection Random iterator class.
Definition: types.hpp:5110
Encapsulate a Resultset column or object member properties.
Definition: types.hpp:7008
PropertyFlagsValues
Column properties flags values.
Definition: types.hpp:7020
core::Flags< PropertyFlagsValues > PropertyFlags
Column properties flags.
Definition: types.hpp:7046
A connection or session with a specific database.
Definition: types.hpp:1587
FailoverEventValues
Failover events enumerated values.
Definition: types.hpp:1673
core::Enum< SessionTraceValues > SessionTrace
Session traces.
Definition: types.hpp:1741
core::Enum< FailoverResultValues > FailoverResult
Failover callback results.
Definition: types.hpp:1715
core::Enum< TimeoutTypeValues > TimeoutType
Timeout Types.
Definition: types.hpp:1643
FailoverRequestValues
Failover request enumerated values.
Definition: types.hpp:1651
core::Enum< FailoverRequestValues > FailoverRequest
Failover requests.
Definition: types.hpp:1665
SessionTraceValues
Session trace enumerated values.
Definition: types.hpp:1723
core::Enum< FailoverEventValues > FailoverEvent
Failover events.
Definition: types.hpp:1693
FailoverResultValues
Failover callback results enumerated values.
Definition: types.hpp:1701
TimeoutTypeValues
Timeout enumerated values.
Definition: types.hpp:1618
Object identifying the SQL data type DATE.
Definition: types.hpp:2716
Dequeue object for dequeuing messages into an Oracle Queue.
Definition: types.hpp:8079
DequeueVisibilityValues
Message visibility enumerated values.
Definition: types.hpp:8125
core::Enum< DequeueVisibilityValues > DequeueVisibility
Message visibility after begin dequeued.
Definition: types.hpp:8139
NavigationModeValues
Navigation Mode enumerated values.
Definition: types.hpp:8147
DequeueModeValues
Dequeue mode enumerated values.
Definition: types.hpp:8099
core::Enum< DequeueModeValues > DequeueMode
Dequeue mode.
Definition: types.hpp:8117
core::Enum< NavigationModeValues > NavigationMode
Navigation Mode.
Definition: types.hpp:8164
Oracle Direct path loading encapsulation.
Definition: types.hpp:8758
ResultValues
Direct Operation Result enumerated values.
Definition: types.hpp:8789
core::Enum< ConversionModeValues > ConversionMode
Conversion Mode.
Definition: types.hpp:8781
core::Enum< ResultValues > Result
Direct Operation Result.
Definition: types.hpp:8809
ConversionModeValues
Conversion mode enumerated values.
Definition: types.hpp:8767
Enqueue object for queuing messages into an Oracle Queue.
Definition: types.hpp:7912
EnqueueModeValues
Message enqueuing mode enumerated values.
Definition: types.hpp:7921
core::Enum< EnqueueModeValues > EnqueueMode
Message enqueuing mode.
Definition: types.hpp:7935
EnqueueVisibilityValues
Message visibility enumerated values.
Definition: types.hpp:7943
core::Enum< EnqueueVisibilityValues > EnqueueVisibility
Message visibility after begin queued.
Definition: types.hpp:7957
Static class in charge of library initialization / cleanup.
Definition: types.hpp:492
core::Flags< ShutdownModeValues > ShutdownMode
Oracle instance shutdown modes.
Definition: types.hpp:755
CharsetModeValues
Charset mode enumerated values.
Definition: types.hpp:627
StartModeValues
Oracle instance start modes enumerated values.
Definition: types.hpp:687
ImportModeValues
OCI libraries import mode enumerated values.
Definition: types.hpp:605
HAEventTypeValues
HA Event types enumerated values.
Definition: types.hpp:559
StartFlagsValues
Oracle instance start flags enumerated values.
Definition: types.hpp:713
ShutdownFlagsValues
Oracle instance shutdown flags enumerated values.
Definition: types.hpp:763
core::Enum< CharsetModeValues > CharsetMode
Environment charset mode.
Definition: types.hpp:641
core::Enum< ImportModeValues > ImportMode
OCI libraries import mode.
Definition: types.hpp:619
core::Flags< ShutdownFlagsValues > ShutdownFlags
Oracle instance shutdown flags.
Definition: types.hpp:792
core::Flags< StartFlagsValues > StartFlags
Oracle instance start flags.
Definition: types.hpp:729
HAEventSourceValues
HA Event sources enumerated values.
Definition: types.hpp:527
EnvironmentFlagsValues
Environment Flags enumerated values.
Definition: types.hpp:581
core::Enum< HAEventTypeValues > HAEventType
Type of HA events.
Definition: types.hpp:573
AllocatedBytesValues
Allocated Bytes enumerated values.
Definition: types.hpp:800
core::Flags< AllocatedBytesValues > AllocatedBytesFlags
Allocated Bytes.
Definition: types.hpp:816
SessionFlagsValues
Session flags enumerated values.
Definition: types.hpp:649
core::Flags< StartModeValues > StartMode
Oracle instance start modes.
Definition: types.hpp:705
core::Enum< HAEventSourceValues > HAEventSource
Source of HA events.
Definition: types.hpp:551
core::Flags< SessionFlagsValues > SessionFlags
Sessions flags.
Definition: types.hpp:679
ShutdownModeValues
Oracle instance shutdown modes enumerated values.
Definition: types.hpp:737
core::Flags< EnvironmentFlagsValues > EnvironmentFlags
Environment Flags.
Definition: types.hpp:597
Subscription Event.
Definition: types.hpp:7346
ObjectEventValues
Object events enumerated values.
Definition: types.hpp:7388
core::Enum< ObjectEventValues > ObjectEvent
Object events.
Definition: types.hpp:7410
core::Enum< EventTypeValues > EventType
Event type.
Definition: types.hpp:7380
EventTypeValues
Event type enumerated values.
Definition: types.hpp:7358
Exception class handling all OCILIB errors.
Definition: types.hpp:360
ExceptionTypeValues
Exception type enumerated values.
Definition: types.hpp:373
core::Enum< ExceptionTypeValues > ExceptionType
Type of Exception.
Definition: types.hpp:389
ostring GetMessage() const
Retrieve the error message.
Definition: Exception.hpp:152
const char * what() const noexcept override
Override the std::exception::what() method.
Definition: Exception.hpp:147
int GetOracleErrorCode() const
Return the Oracle error code.
Definition: Exception.hpp:203
unsigned int GetRow() const
Return the row index which caused an error during statement execution.
Definition: Exception.hpp:223
ExceptionType GetType() const
Return the Exception type.
Definition: Exception.hpp:198
Connection GetConnection() const
Return the connection within the error occurred.
Definition: Exception.hpp:218
int GetInternalErrorCode() const
Return the OCILIB error code.
Definition: Exception.hpp:208
Statement GetStatement() const
Return the statement within the error occurred.
Definition: Exception.hpp:213
Object identifying the SQL data type BFILE.
Definition: types.hpp:4458
Object identifying the SQL data type INTERVAL.
Definition: types.hpp:3172
IntervalTypeValues
Interval types enumerated values.
Definition: types.hpp:3189
core::Enum< IntervalTypeValues > IntervalType
Interval types.
Definition: types.hpp:3203
Object identifying the SQL data type LOB (CLOB, NCLOB and BLOB)
Definition: types.hpp:4136
T Read(unsigned int length)
Read a portion of a lob.
Object identifying the SQL data type LONG.
Definition: types.hpp:5439
T GetContent() const
Return the string read from a fetch sequence.
AQ message.
Definition: types.hpp:7563
MessageStateValues
Message state enumerated values.
Definition: types.hpp:7574
void SetPayload(const T &value)
Set the object payload of the message.
core::Enum< MessageStateValues > MessageState
Message state.
Definition: types.hpp:7592
T GetPayload()
Get the object payload of the message.
Static class allowing managing mutexes.
Definition: types.hpp:1248
Object identifying the SQL data type NUMBER.
Definition: types.hpp:2507
Object identifying the SQL data type OBJECT.
Definition: types.hpp:4784
core::Enum< ObjectTypeValues > ObjectType
Object Type.
Definition: types.hpp:4817
void Get(const ostring &name, Collection< T > &value) const
Assign the given collection with the given object attribute value of type collection.
ObjectTypeValues
Object Type enumerated values.
Definition: types.hpp:4801
void Get(const ostring &name, T &value) const
Assign the given value with the given object attribute value.
A connection or session Pool.
Definition: types.hpp:1356
PoolTypeValues
Pool type enumerated values.
Definition: types.hpp:1365
core::Enum< PoolTypeValues > PoolType
Type of Pool.
Definition: types.hpp:1379
Class allowing the administration of Oracle Queues.
Definition: types.hpp:8429
QueueTypeValues
Queue Type enumerated values.
Definition: types.hpp:8438
core::Enum< QueueTypeValues > QueueType
Queue Type.
Definition: types.hpp:8454
Class allowing the administration of Oracle Queue tables.
Definition: types.hpp:8571
GroupingModeValues
Grouping mode enumerated values.
Definition: types.hpp:8581
PurgeModeValues
Purge mode enumerated values.
Definition: types.hpp:8605
core::Enum< GroupingModeValues > GroupingMode
Grouping Mode.
Definition: types.hpp:8596
core::Enum< PurgeModeValues > PurgeMode
Purge mode.
Definition: types.hpp:8621
Object identifying the SQL data type REF.
Definition: types.hpp:4964
Database resultset.
Definition: types.hpp:6649
unsigned int ForEach(T callback)
Fetch all rows in the resultset and call the given callback for row.
SeekModeValues
Seek Modes enumerated values.
Definition: types.hpp:6659
bool Get(T &value, U adapter) const
Return a given user type from the current fetched row. It allow translating row column values returne...
core::Enum< SeekModeValues > SeekMode
Seek Modes.
Definition: types.hpp:6673
Object used for executing SQL or PL/SQL statement and returning the produced results.
Definition: types.hpp:5700
LongModeValues
LONG data type mapping modes enumerated values.
Definition: types.hpp:5800
StatementTypeValues
Statement Type enumerated values.
Definition: types.hpp:5716
core::Enum< BindModeValues > BindMode
Bind Modes.
Definition: types.hpp:5792
void Register(const ostring &name, U extraInfo)
Register a host variable with more information as an output for a column present in a SQL RETURNING I...
void Bind(const ostring &name, T &value, BindInfo::BindDirection mode)
Bind an host variable.
void Bind(const ostring &name, std::vector< T > &values, U extraInfo, BindInfo::BindDirection mode, BindInfo::VectorType type=BindInfo::AsArray)
Bind a vector of host variables with more information.
BindModeValues
Bind Modes enumerated values.
Definition: types.hpp:5778
void Bind(const ostring &name, std::vector< T > &values, BindInfo::BindDirection mode, BindInfo::VectorType type=BindInfo::AsArray)
Bind a vector of host variables.
FetchModeValues
Fetch Modes enumerated values.
Definition: types.hpp:5756
core::Enum< FetchModeValues > FetchMode
Fetch Modes.
Definition: types.hpp:5770
void Register(const ostring &name)
Register a host variable as an output for a column present in a SQL RETURNING INTO clause.
core::Enum< LongModeValues > LongMode
LONG data type mapping modes.
Definition: types.hpp:5814
core::Enum< StatementTypeValues > StatementType
Statement Type.
Definition: types.hpp:5748
void Bind(const ostring &name, T &value, U extraInfo, BindInfo::BindDirection mode)
Bind an host variable with more information.
void Register(const ostring &name, U &extraInfo)
Register a host variable with Oracle type information as an output for a column present in a SQL RETU...
Subscription to database or objects changes.
Definition: types.hpp:7212
core::Flags< ChangeTypesValues > ChangeTypes
Subscription changes flags.
Definition: types.hpp:7250
ChangeTypesValues
Subscription changes flags values.
Definition: types.hpp:7232
static class allowing to manipulate threads
Definition: types.hpp:1175
POCI_THREAD ThreadProc
Thread callback.
Definition: types.hpp:1184
Static class allowing to set/get thread local storage (TLS) values for a given unique key.
Definition: types.hpp:1300
POCI_THREADKEYDEST ThreadKeyFreeProc
Thread Key callback for freeing resources.
Definition: types.hpp:1309
Object identifying the SQL data type TIMESTAMP.
Definition: types.hpp:3607
core::Enum< TimestampTypeValues > TimestampType
Type of timestamp.
Definition: types.hpp:3641
TimestampTypeValues
Interval types enumerated values.
Definition: types.hpp:3625
Oracle Transaction object.
Definition: types.hpp:2388
core::Flags< TransactionFlagsValues > TransactionFlags
Transaction flags.
Definition: types.hpp:2422
TransactionFlagsValues
Transaction flags enumerated values.
Definition: types.hpp:2399
Provides type information on Oracle Database objects.
Definition: types.hpp:4647
TypeInfoTypeValues
Type of object information enumerated values.
Definition: types.hpp:4661
core::Enum< TypeInfoTypeValues > TypeInfoType
Type of object information.
Definition: types.hpp:4677
Object identifying the SQL data type XMLTYPE.
Definition: types.hpp:5051
Internal usage. Map supporting concurrent access from multiple threads.
Definition: core.hpp:270
Template Enumeration template class providing some type safety to some extends for manipulating enume...
Definition: core.hpp:118
Template Flags template class providing some type safety to some extends for manipulating flags set v...
Definition: core.hpp:148
Internal usage. Smart pointer class with reference counting for managing OCILIB object handles.
Definition: core.hpp:364
Internal usage. Interface for handling ownership and relationship of a C API handle.
Definition: core.hpp:325
Internal usage. Provide a store for C Handles to C++ Handles mapping.
Definition: core.hpp:340
Abstract class allowing derived classes to be compatible with any type supporting the operator << oci...
Definition: core.hpp:449
Internal usage. SynchronizationGuard object.
Definition: core.hpp:227
Internal usage. Class implementing bind translations between C++ vectors and C API arrays.
Definition: support.hpp:80
Internal usage. Class owning bind objects allowing to set/get C data prior/after a statement executio...
Definition: support.hpp:213
struct OCI_Ref OCI_Ref
Oracle REF type representation.
Definition: types.h:356
struct OCI_Elem OCI_Elem
Oracle Collection item representation.
Definition: types.h:329
struct OCI_XmlType OCI_XmlType
Oracle XMLTYPE type representation.
Definition: types.h:366
struct OCI_Dequeue OCI_Dequeue
OCILIB encapsulation of A/Q dequeuing operations.
Definition: types.h:480
struct OCI_Connection OCI_Connection
Oracle physical connection.
Definition: types.h:124
struct OCI_Object OCI_Object
Oracle Named types representation.
Definition: types.h:309
void(* POCI_THREAD)(OCI_Thread *thread, void *arg)
Thread procedure prototype.
Definition: types.h:519
struct OCI_Statement OCI_Statement
Oracle SQL or PL/SQL statement.
Definition: types.h:136
struct OCI_Timestamp OCI_Timestamp
Oracle internal timestamp representation.
Definition: types.h:289
struct OCI_Date OCI_Date
Oracle internal date representation.
Definition: types.h:279
struct OCI_Coll OCI_Coll
Oracle Collections (VARRAYs and Nested Tables) representation.
Definition: types.h:319
struct OCI_Bind OCI_Bind
Internal bind representation.
Definition: types.h:148
struct OCI_Error OCI_Error
Encapsulates an Oracle or OCILIB exception.
Definition: types.h:400
struct OCI_Lob OCI_Lob
Oracle Internal Large objects:
Definition: types.h:198
struct OCI_Long OCI_Long
Oracle Long data type.
Definition: types.h:260
struct OCI_Column OCI_Column
Oracle SQL Column and Type member representation.
Definition: types.h:175
struct OCI_Interval OCI_Interval
Oracle internal interval representation.
Definition: types.h:299
struct OCI_Transaction OCI_Transaction
Oracle Transaction.
Definition: types.h:238
struct OCI_Msg OCI_Msg
OCILIB encapsulation of A/Q message.
Definition: types.h:460
struct OCI_Number OCI_Number
Oracle NUMBER representation.
Definition: types.h:269
struct OCI_TypeInfo OCI_TypeInfo
Type info metadata handle.
Definition: types.h:376
struct OCI_File OCI_File
Oracle External Large objects:
Definition: types.h:223
void(* POCI_THREADKEYDEST)(void *data)
Thread key destructor prototype.
Definition: types.h:535
struct OCI_Event OCI_Event
OCILIB encapsulation of Oracle DCN event.
Definition: types.h:450
struct OCI_Resultset OCI_Resultset
Collection of output columns from a select statement.
Definition: types.h:163
struct OCI_Subscription OCI_Subscription
OCILIB encapsulation of Oracle DCN notification.
Definition: types.h:440
struct OCI_Agent OCI_Agent
OCILIB encapsulation of A/Q Agent.
Definition: types.h:470
static T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so,...
Definition: Utils.hpp:53
OCILIB ++ Namespace.
OracleVersionValues
Oracle Version enumerated values.
Definition: types.hpp:50
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 )
Definition: config.hpp:120
NumericTypeValues
Numeric type enumerated values.
Definition: types.hpp:134
@ NumericDouble
Definition: types.hpp:148
@ NumericInt
Definition: types.hpp:138
@ NumericUnsignedBigInt
Definition: types.hpp:146
@ NumericUnsignedShort
Definition: types.hpp:142
@ NumericBigInt
Definition: types.hpp:140
@ NumericNumber
Definition: types.hpp:152
@ NumericFloat
Definition: types.hpp:150
@ NumericUnsignedInt
Definition: types.hpp:144
@ NumericShort
Definition: types.hpp:136
core::Enum< OpenModeValues > OpenMode
Open Modes.
Definition: types.hpp:275
Long< Raw, LongBinary > Blong
Class handling LONG RAW oracle type.
Definition: types.hpp:5513
core::Enum< NumericTypeValues > NumericType
Numeric data type.
Definition: types.hpp:162
Lob< ostring, LobNationalCharacter > NClob
Class handling NCLOB oracle type.
Definition: types.hpp:4436
LongTypeValues
Long types enumerated values.
Definition: types.hpp:307
const void * ThreadId
Thread Unique ID.
Definition: config.hpp:165
CharsetFormValues
Charset form enumerated values.
Definition: types.hpp:170
@ CharsetFormDefault
Definition: types.hpp:172
@ CharsetFormNational
Definition: types.hpp:174
OpenModeValues
Open Modes enumerated values.
Definition: types.hpp:261
@ ReadWrite
Definition: types.hpp:265
@ ReadOnly
Definition: types.hpp:263
CollationIDValues
Collation ID enumerated values.
Definition: types.hpp:192
@ CollationIDBinaryAI
Definition: types.hpp:218
@ CollationIDNlsSortAI
Definition: types.hpp:202
@ CollationIDNlsSortVar1
Definition: types.hpp:206
@ CollationIDNlsSortCI
Definition: types.hpp:200
@ CollationIDNlsSortVar1CI
Definition: types.hpp:208
@ CollationIDNlsSortVar1AI
Definition: types.hpp:210
@ CollationIDBinaryCI
Definition: types.hpp:216
@ CollationIDNone
Definition: types.hpp:194
@ CollationIDNlsSort
Definition: types.hpp:198
@ CollationIDNlsSortCS
Definition: types.hpp:204
@ CollationIDBinary
Definition: types.hpp:214
@ CollationIDNlsSortVar1CS
Definition: types.hpp:212
@ CollationIDNlsComp
Definition: types.hpp:196
SeekModeValues
Seek Modes enumerated values.
Definition: types.hpp:237
@ SeekOffset
Definition: types.hpp:243
@ SeekSet
Definition: types.hpp:239
@ SeekEnd
Definition: types.hpp:241
core::Enum< CollationIDValues > CollationID
Type of Collation ID.
Definition: types.hpp:228
Lob< ostring, LobCharacter > Clob
Class handling CLOB oracle type.
Definition: types.hpp:4425
core::Enum< LobTypeValues > LobType
Type of Lob.
Definition: types.hpp:299
core::Enum< SeekModeValues > SeekMode
Seek Modes.
Definition: types.hpp:253
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
Definition: config.hpp:138
core::Enum< LongTypeValues > LongType
Type of Long.
Definition: types.hpp:321
OCI_Mutex * MutexHandle
Alias for an OCI_Mutex pointer.
Definition: config.hpp:147
FormatTypeValues
Format type enumerated values.
Definition: types.hpp:329
@ FormatBinaryDouble
Definition: types.hpp:337
@ FormatBinaryFloat
Definition: types.hpp:339
@ FormatDate
Definition: types.hpp:331
@ FormatTimestamp
Definition: types.hpp:333
@ FormatNumeric
Definition: types.hpp:335
void * AnyPointer
Alias for the generic void pointer.
Definition: config.hpp:129
DataTypeValues
Data type enumerated values.
Definition: types.hpp:86
@ TypeCollection
Definition: types.hpp:110
@ TypeReference
Definition: types.hpp:112
@ TypeXmlType
Definition: types.hpp:116
@ TypeRaw
Definition: types.hpp:106
@ TypeInterval
Definition: types.hpp:104
@ TypeStatement
Definition: types.hpp:96
@ TypeDate
Definition: types.hpp:90
@ TypeTimestamp
Definition: types.hpp:102
@ TypeBoolean
Definition: types.hpp:114
@ TypeFile
Definition: types.hpp:100
@ TypeObject
Definition: types.hpp:108
@ TypeLong
Definition: types.hpp:94
@ TypeString
Definition: types.hpp:92
@ TypeLob
Definition: types.hpp:98
@ TypeNumeric
Definition: types.hpp:88
LobTypeValues
Lob types enumerated values.
Definition: types.hpp:283
core::Enum< FormatTypeValues > FormatType
Format type.
Definition: types.hpp:349
Long< ostring, LongCharacter > Clong
Class handling LONG oracle type.
Definition: types.hpp:5502
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.
Definition: types.hpp:4447
OCI_Thread * ThreadHandle
Alias for an OCI_Thread pointer.
Definition: config.hpp:156
core::Enum< CharsetFormValues > CharsetForm
Type of charsetForm.
Definition: types.hpp:184
core::Enum< DataTypeValues > DataType
Column data type.
Definition: types.hpp:126
core::Enum< OracleVersionValues > OracleVersion
Oracle Version.
Definition: types.hpp:78