OCILIB (C and C++ Driver for Oracle)  4.7.5
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-2023 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
115 };
116
125
132 {
134 NumericShort = OCI_NUM_SHORT,
136 NumericInt = OCI_NUM_INT,
138 NumericBigInt = OCI_NUM_BIGINT,
140 NumericUnsignedShort = OCI_NUM_USHORT,
142 NumericUnsignedInt = OCI_NUM_UINT,
144 NumericUnsignedBigInt = OCI_NUM_BIGUINT,
146 NumericDouble = OCI_NUM_DOUBLE,
148 NumericFloat = OCI_NUM_FLOAT,
150 NumericNumber = OCI_NUM_NUMBER
151 };
152
161
168 {
170 CharsetFormDefault = OCI_CSF_DEFAULT,
172 CharsetFormNational = OCI_CSF_NATIONAL
173 };
174
183
190 {
192 CollationIDNone = OCI_CCI_NONE,
194 CollationIDNlsComp = OCI_CCI_NLS_COMP,
196 CollationIDNlsSort = OCI_CCI_NLS_SORT,
198 CollationIDNlsSortCI = OCI_CCI_NLS_SORT_CI,
200 CollationIDNlsSortAI = OCI_CCI_NLS_SORT_AI,
202 CollationIDNlsSortCS = OCI_CCI_NLS_SORT_CS,
204 CollationIDNlsSortVar1 = OCI_CCI_NLS_SORT_VAR1,
206 CollationIDNlsSortVar1CI = OCI_CCI_NLS_SORT_VAR1_CI,
208 CollationIDNlsSortVar1AI = OCI_CCI_NLS_SORT_VAR1_AI,
210 CollationIDNlsSortVar1CS = OCI_CCI_NLS_SORT_VAR1_CS,
212 CollationIDBinary = OCI_CCI_BINARY,
214 CollationIDBinaryCI = OCI_CCI_BINARY_CI,
216 CollationIDBinaryAI = OCI_CCI_BINARY_AI
217 };
218
227
228
235 {
237 SeekSet = OCI_SEEK_SET,
239 SeekEnd = OCI_SEEK_END,
241 SeekOffset = OCI_SEEK_CUR
242 };
243
252
259 {
261 ReadOnly = OCI_LOB_READONLY,
263 ReadWrite = OCI_LOB_READWRITE
264 };
265
274
281 {
283 LobBinary = OCI_BLOB,
285 LobCharacter = OCI_CLOB,
287 LobNationalCharacter = OCI_NCLOB
288 };
289
298
305 {
307 LongBinary = OCI_BLONG,
309 LongCharacter = OCI_CLONG
310 };
311
320
327 {
329 FormatDate = OCI_FMT_DATE,
331 FormatTimestamp = OCI_FMT_TIMESTAMP,
333 FormatNumeric = OCI_FMT_NUMERIC,
335 FormatBinaryDouble = OCI_FMT_BINARY_DOUBLE,
337 FormatBinaryFloat = OCI_FMT_BINARY_FLOAT
338 };
339
348
357 class Exception : public std::exception
358 {
359 template<class T>
360 friend T core::Check(T result);
361 friend class Statement;
362
363 public:
364
371 {
373 OracleError = OCI_ERR_ORACLE,
375 OcilibError = OCI_ERR_OCILIB,
377 OracleWarning = OCI_ERR_WARNING
378 };
379
388
394 ostring GetMessage() const;
395
402 ExceptionType GetType() const;
403
409 int GetOracleErrorCode() const;
410
416 int GetInternalErrorCode() const;
417
423 Statement GetStatement() const;
424
431
444 unsigned int GetRow() const;
445
454 const char* what() const noexcept override;
455
456 Exception(const Exception& other) noexcept;
457
458 Exception& operator = (const Exception& other) noexcept;
459
465 virtual ~Exception() noexcept;
466
467 private:
468
469 Exception() noexcept;
470 Exception(OCI_Error* err) noexcept;
471
472 void SetWhat(const otext* value) noexcept;
473 void CopyWhat(const char* value) noexcept;
474
475 char* _what;
476 OCI_Statement* _pStatement;
477 OCI_Connection* _pConnnection;
478 unsigned int _row;
479 ExceptionType _type;
480 int _errLib;
481 int _errOracle;
482 };
483
490 {
491 friend class Mutex;
492 friend class Connection;
493 friend class Pool;
494 friend class TypeInfo;
495 friend class Subscription;
496 friend class Dequeue;
497 friend class Date;
498 friend class Timestamp;
499 friend class Number;
500 friend class Interval;
501 friend class Agent;
502 friend class Transaction;
503 friend class Exception;
504 friend class File;
505 friend class Log;
506 friend class Statement;
507 friend class Object;
508 friend class Reference;
509 friend class Message;
510 friend class Event;
511 friend class Column;
512
513 public:
514
521 {
523 SourceInstance = OCI_HES_INSTANCE,
525 SourceDatabase = OCI_HES_DATABASE,
527 SourceNode = OCI_HES_NODE,
529 SourceService = OCI_HES_SERVICE,
531 SourceServiceMember = OCI_HES_SERVICE_MEMBER,
533 SourceASMInstance = OCI_HES_ASM_INSTANCE,
535 SourcePreConnect = OCI_HES_PRECONNECT
536 };
537
546
553 {
555 EventDown = OCI_HET_DOWN,
557 EventUp = OCI_HET_UP
558 };
559
568
575 {
577 Default = OCI_ENV_DEFAULT,
579 Threaded = OCI_ENV_THREADED,
581 Events = OCI_ENV_EVENTS
582 };
583
592
599 {
601 ImportLinkage = OCI_IMPORT_MODE_LINKAGE,
603 ImportRuntime = OCI_IMPORT_MODE_RUNTIME
604 };
605
614
621 {
623 CharsetAnsi = OCI_CHAR_ANSI,
625 CharsetWide = OCI_CHAR_WIDE
626 };
627
636
643 {
645 SessionDefault = OCI_SESSION_DEFAULT,
647 SessionXa = OCI_SESSION_XA,
649 SessionSysDba = OCI_SESSION_SYSDBA,
651 SessionSysOper = OCI_SESSION_SYSOPER,
653 SessionSysAsm = OCI_SESSION_SYSASM,
655 SessionSysBkp = OCI_SESSION_SYSBKP,
657 SessionSysDgD = OCI_SESSION_SYSDGD,
659 SessionSysKmt = OCI_SESSION_SYSKMT,
661 SessionSysRac = OCI_SESSION_SYSRAC,
663 SessionPreAuth = OCI_SESSION_PRELIM_AUTH
664 };
665
674
681 {
683 StartOnly = OCI_DB_SPM_START,
685 StartMount = OCI_DB_SPM_MOUNT,
687 StartOpen = OCI_DB_SPM_OPEN,
689 StartFull = OCI_DB_SPM_FULL
690 };
691
700
707 {
709 StartDefault = OCI_DB_SPF_DEFAULT,
711 StartForce = OCI_DB_SPF_FORCE,
713 StartRestrict = OCI_DB_SPF_RESTRICT
714 };
715
724
731 {
733 ShutdownOnly = OCI_DB_SDM_SHUTDOWN,
735 ShutdownClose = OCI_DB_SDM_CLOSE,
737 ShutdownDismount = OCI_DB_SDM_DISMOUNT,
739 ShutdownFull = OCI_DB_SDM_FULL
740 };
741
750
757 {
760 ShutdowntDefault = OCI_DB_SDF_DEFAULT,
763 ShutdowTrans = OCI_DB_SDF_TRANS,
767 ShutdownTransLocal = OCI_DB_SDF_TRANS_LOCAL,
770 ShutdownImmediate = OCI_DB_SDF_IMMEDIATE,
776 ShutdownAbort = OCI_DB_SDF_ABORT
777 };
778
787
794 {
796 OracleClientBytes = OCI_MEM_ORACLE,
798 OcilibBytes = OCI_MEM_OCILIB,
800 AllBytes = OCI_MEM_ALL
801 };
802
811
819 typedef void(*HAHandlerProc) (Connection& con, HAEventSource eventSource, HAEventType eventType, Timestamp& time);
820
840 static void Initialize(EnvironmentFlags mode = Environment::Default, const ostring& libpath = OTEXT(""));
841
856 static void Cleanup();
857
866 static Environment::EnvironmentFlags GetMode();
867
873 static Environment::ImportMode GetImportMode();
874
880 static Environment::CharsetMode GetCharset();
881
891 static unsigned int GetCharMaxSize();
892
900 static big_uint GetAllocatedBytes(AllocatedBytesFlags type);
901
907 static bool Initialized();
908
919 static OracleVersion GetCompileVersion();
920
926 static unsigned int GetCompileMajorVersion();
927
933 static unsigned int GetCompileMinorVersion();
934
940 static unsigned int GetCompileRevisionVersion();
941
951 static OracleVersion GetRuntimeVersion();
952
958 static unsigned int GetRuntimeMajorVersion();
959
965 static unsigned int GetRuntimeMinorVersion();
966
972 static unsigned int GetRuntimeRevisionVersion();
973
984 static void EnableWarnings(bool value);
985
1017 static bool SetFormat(FormatType formatType, const ostring& format);
1018
1029 static ostring GetFormat(FormatType formatType);
1030
1057 static void StartDatabase(const ostring& db, const ostring& user, const ostring& pwd,
1058 Environment::StartFlags startFlags,
1059 Environment::StartMode startMode,
1060 Environment::SessionFlags sessionFlags = SessionSysDba,
1061 const ostring& spfile = OTEXT(""));
1062
1088 static void ShutdownDatabase(const ostring& db, const ostring& user, const ostring& pwd,
1089 Environment::ShutdownFlags shutdownFlags,
1090 Environment::ShutdownMode shutdownMode,
1091 Environment::SessionFlags sessionFlags = SessionSysDba);
1092
1103 static void ChangeUserPassword(const ostring& db, const ostring& user, const ostring& pwd, const ostring& newPwd);
1104
1121 static void SetHAHandler(HAHandlerProc handler);
1122
1123 private:
1124
1125 class EnvironmentHandle : core::HandleHolder<OCI_Environment*>
1126 {
1127 friend class Environment;
1128 };
1129
1130 static void HAHandler(OCI_Connection* pConnection, unsigned int source, unsigned int event, OCI_Timestamp* pTimestamp);
1131 static unsigned int TAFHandler(OCI_Connection* pConnection, unsigned int type, unsigned int event);
1132 static void NotifyHandler(OCI_Event* pEvent);
1133 static void NotifyHandlerAQ(OCI_Dequeue* pDequeue);
1134
1135 template<class T>
1136 static T GetUserCallback(AnyPointer ptr);
1137
1138 template<class T>
1139 static void SetUserCallback(AnyPointer ptr, T callback);
1140
1141 static core::Handle* GetEnvironmentHandle();
1142 static Environment& GetInstance();
1143
1144 Environment();
1145
1146 void SelfInitialize(EnvironmentFlags mode, const ostring& libpath);
1147 void SelfCleanup();
1148
1151 EnvironmentHandle _handle;
1152 EnvironmentFlags _mode;
1153 unsigned int _charMaxSize;
1154 bool _initialized;
1155 };
1156
1168 {
1169 public:
1170
1178
1187 static ThreadHandle Create();
1188
1196 static void Destroy(ThreadHandle handle);
1197
1207 static void Run(ThreadHandle handle, ThreadProc func, AnyPointer arg);
1208
1219 static void Join(ThreadHandle handle);
1220
1228 static ThreadId GetThreadId(ThreadHandle handle);
1229 };
1230
1240 class Mutex
1241 {
1242 public:
1243
1252 static MutexHandle Create();
1253
1261 static void Destroy(MutexHandle handle);
1262
1270 static void Acquire(MutexHandle handle);
1271
1279 static void Release(MutexHandle handle);
1280 };
1281
1293 {
1294 public:
1295
1303
1316 static void Create(const ostring& name, ThreadKeyFreeProc freeProc = nullptr);
1317
1326 static void SetValue(const ostring& name, AnyPointer value);
1327
1338 static AnyPointer GetValue(const ostring& name);
1339 };
1340
1348 class Pool : public core::HandleHolder<OCI_Pool*>
1349 {
1350 public:
1351
1358 {
1360 ConnectionPool = OCI_POOL_CONNECTION,
1362 SessionPool = OCI_POOL_SESSION
1364
1373
1379 Pool();
1380
1398 Pool(const ostring& db, const ostring& user, const ostring& pwd, Pool::PoolType poolType,
1399 unsigned int minSize, unsigned int maxSize, unsigned int increment = 1,
1400 Environment::SessionFlags sessionFlags = Environment::SessionDefault);
1401
1420 void Open(const ostring& db, const ostring& user, const ostring& pwd, Pool::PoolType poolType,
1421 unsigned int minSize, unsigned int maxSize, unsigned int increment = 1,
1422 Environment::SessionFlags sessionFlags = Environment::SessionDefault);
1423
1429 void Close();
1430
1459 Connection GetConnection(const ostring& sessionTag = OTEXT(""));
1460
1472 unsigned int GetTimeout() const;
1473
1487 void SetTimeout(unsigned int value);
1488
1498 bool GetNoWait() const;
1499
1512 void SetNoWait(bool value);
1513
1519 unsigned int GetBusyConnectionsCount() const;
1520
1526 unsigned int GetOpenedConnectionsCount() const;
1527
1533 unsigned int GetMinSize() const;
1534
1540 unsigned int GetMaxSize() const;
1541
1547 unsigned int GetIncrement() const;
1548
1557 unsigned int GetStatementCacheSize() const;
1558
1566 void SetStatementCacheSize(unsigned int value);
1567 };
1568
1576 class Connection : public core::HandleHolder<OCI_Connection*>
1577 {
1578 friend class Environment;
1579 friend class Exception;
1580 friend class Statement;
1581 friend class File;
1582 friend class Timestamp;
1583 friend class Pool;
1584 friend class Object;
1585 friend class TypeInfo;
1586 friend class Reference;
1587 friend class Resultset;
1588 friend class Subscription;
1589 friend class Agent;
1590 friend class Dequeue;
1591 friend class Enqueue;
1592 friend class Column;
1593 friend class Message;
1594 friend class DirectPath;
1595
1596 template<class, int>
1597 friend class Lob;
1598 template<class>
1599 friend class Collection;
1600 public:
1601
1608 {
1613 TimeoutSend = OCI_NTO_SEND,
1618 TimeoutReceive = OCI_NTO_RECEIVE,
1623 TimeoutCall = OCI_NTO_CALL
1625
1634
1641 {
1643 FailoverRequestSession = OCI_FOT_SESSION,
1645 FailoverRequestSelect = OCI_FOT_SELECT
1647
1656
1663 {
1665 FailoverEventEnd = OCI_FOE_END,
1667 FailoverEventAbort = OCI_FOE_ABORT,
1669 FailoverEventReauthentificate = OCI_FOE_REAUTH,
1671 FailoverEventBegin = OCI_FOE_BEGIN,
1673 FailoverEventError = OCI_FOE_ERROR
1675
1684
1691 {
1693 FailoverOk = OCI_FOC_OK,
1695 FailoverRetry = OCI_FOC_RETRY
1697
1706
1713 {
1715 TraceIdentity = OCI_TRC_IDENTITY,
1717 TraceModule = OCI_TRC_MODULE,
1719 TraceAction = OCI_TRC_ACTION,
1721 TraceDetail = OCI_TRC_DETAIL
1723
1732
1740 typedef FailoverResult(*TAFHandlerProc) (Connection& con, FailoverRequest failoverRequest, FailoverEvent failoverEvent);
1741
1747 Connection();
1748
1762 Connection(const ostring& db, const ostring& user, const ostring& pwd, Environment::SessionFlags sessionFlags = Environment::SessionDefault);
1763
1806 void Open(const ostring& db, const ostring& user, const ostring& pwd, Environment::SessionFlags sessionFlags = Environment::SessionDefault);
1807
1813 void Close();
1814
1820 void Commit();
1821
1827 void Rollback();
1828
1837 void Break();
1838
1846 void SetAutoCommit(bool enabled);
1847
1853 bool GetAutoCommit() const;
1854
1863 bool IsServerAlive() const;
1864
1873 bool PingServer() const;
1874
1883 ostring GetConnectionString() const;
1884
1893 ostring GetUserName() const;
1894
1903 ostring GetPassword() const;
1904
1913 ostring GetServerVersion() const;
1914
1923 OracleVersion GetVersion() const;
1924
1930 unsigned int GetServerMajorVersion() const;
1931
1937 unsigned int GetServerMinorVersion() const;
1938
1944 unsigned int GetServerRevisionVersion() const;
1945
1953 void ChangePassword(const ostring& newPwd);
1954
1960 ostring GetSessionTag() const;
1961
1976 void SetSessionTag(const ostring& tag);
1977
1983 Transaction GetTransaction() const;
1984
1998 void SetTransaction(const Transaction& transaction);
1999
2031 bool SetFormat(FormatType formatType, const ostring& format);
2032
2043 ostring GetFormat(FormatType formatType);
2044
2064 void EnableServerOutput(unsigned int bufsize, unsigned int arrsize, unsigned int lnsize);
2065
2074 void DisableServerOutput();
2075
2084 bool GetServerOutput(ostring& line) const;
2085
2091 void GetServerOutput(std::vector<ostring>& lines) const;
2092
2121 void SetTrace(SessionTrace trace, const ostring& value);
2122
2133 ostring GetTrace(SessionTrace trace) const;
2134
2143 ostring GetDatabase() const;
2144
2153 ostring GetInstance() const;
2154
2163 ostring GetService() const;
2164
2173 ostring GetServer() const;
2174
2183 ostring GetDomain() const;
2184
2193 Timestamp GetInstanceStartTime() const;
2194
2206 unsigned int GetStatementCacheSize() const;
2207
2218 void SetStatementCacheSize(unsigned int value);
2219
2236 unsigned int GetDefaultLobPrefetchSize() const;
2237
2262 void SetDefaultLobPrefetchSize(unsigned int value);
2263
2278 unsigned int GetMaxCursors() const;
2279
2288 bool IsTAFCapable() const;
2289
2303 void SetTAFHandler(TAFHandlerProc handler);
2304
2310 AnyPointer GetUserData();
2311
2319 void SetUserData(AnyPointer value);
2320
2334 unsigned int GetTimeout(TimeoutType timeout);
2335
2363 void SetTimeout(TimeoutType timeout, unsigned int value);
2364
2365 private:
2366
2367 Connection(OCI_Connection* con, core::Handle* parent);
2368 };
2369
2377 class Transaction : public core::HandleHolder<OCI_Transaction*>
2378 {
2379 friend class Connection;
2380
2381 public:
2382
2389 {
2390 Unknown = OCI_UNKNOWN,
2392 New = OCI_TRS_NEW,
2394 Tight = OCI_TRS_TIGHT,
2396 Loose = OCI_TRS_LOOSE,
2398 ReadOnly = OCI_TRS_READONLY,
2400 ReadWrite = OCI_TRS_READWRITE,
2402 Serializable = OCI_TRS_SERIALIZABLE
2404
2413
2427 Transaction(const Connection& connection, unsigned int timeout, TransactionFlags flags, OCI_XID* pxid = nullptr);
2428
2434 void Prepare();
2435
2441 void Start();
2442
2448 void Stop();
2449
2455 void Resume();
2456
2462 void Forget();
2463
2472 TransactionFlags GetFlags() const;
2473
2479 unsigned int GetTimeout() const;
2480
2481 private:
2482
2484 };
2485
2496 class Number : public core::HandleHolder<OCI_Number*>, public core::Streamable
2497 {
2498 friend class Statement;
2499 friend class Resultset;
2500 friend class support::BindArray;
2501 friend class Object;
2502 template<class>
2503 friend class Collection;
2504
2505 public:
2506
2514 Number(bool create = false);
2515
2530 Number(const otext* str, const otext* format = OTEXT(""));
2531
2546 Number(const ostring& str, const ostring& format = OTEXT(""));
2547
2562 void FromString(const ostring& str, const ostring& format = OTEXT("")) const;
2563
2574 ostring ToString(const ostring& format) const;
2575
2584 ostring ToString() const override;
2585
2591 Number Clone() const;
2592
2593 Number& operator ++ ();
2594 Number& operator -- ();
2595 Number operator ++ (int);
2596 Number operator -- (int);
2597
2598 bool operator == (const Number& other) const;
2599 bool operator != (const Number& other) const;
2600 bool operator > (const Number& other) const;
2601 bool operator < (const Number& other) const;
2602 bool operator >= (const Number& other) const;
2603 bool operator <= (const Number& other) const;
2604
2605 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2606 Number& operator = (const T& lhs);
2607
2608 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2609 operator T() const;
2610
2611 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2612 Number operator - (const T& value);
2613
2614 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2615 Number operator + (const T& value);
2616
2617 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2618 Number operator * (const T& value);
2619
2620 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2621 Number operator / (const T& value);
2622
2623 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2624 Number& operator += (const T& value);
2625
2626 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2627 Number& operator -= (const T& value);
2628
2629 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2630 Number& operator *= (const T& value);
2631
2632 template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2633 Number& operator /= (const T& value);
2634
2635 private:
2636
2637 template<class T>
2638 static AnyPointer GetNativeValue(const T& value);
2639
2640 Number(OCI_Number* pNumber, core::Handle* parent = nullptr);
2641
2642 void Allocate();
2643
2644 int Compare(const Number& other) const;
2645
2646 template<class T>
2647 inline T GetValue() const;
2648
2649 template<class T>
2650 Number& SetValue(const T& value);
2651
2652 template<class T>
2653 void Add(const T& value);
2654
2655 template<class T>
2656 void Sub(const T& value);
2657
2658 template<class T>
2659 void Multiply(const T& value);
2660
2661 template<class T>
2662 void Divide(const T& value);
2663
2664 Number& operator = (OCI_Number*& lhs);
2665 };
2666
2674 class Date : public core::HandleHolder<OCI_Date*>, public core::Streamable
2675 {
2676 friend class Statement;
2677 friend class Resultset;
2678 friend class support::BindArray;
2679 friend class Object;
2680 template<class>
2681 friend class Collection;
2682 friend class Message;
2683
2684 public:
2685
2691 static Date SysDate();
2692
2700 Date(bool create = false);
2701
2716 Date(const otext* str, const otext* format = OTEXT(""));
2717
2733 Date(const ostring& str, const ostring& format = OTEXT(""));
2734
2740 bool IsValid() const;
2741
2747 int GetYear() const;
2748
2754 void SetYear(int value);
2755
2761 int GetMonth() const;
2762
2768 void SetMonth(int value);
2769
2775 int GetDay() const;
2776
2782 void SetDay(int value);
2783
2789 int GetHours() const;
2790
2796 void SetHours(int value);
2797
2803 int GetMinutes() const;
2804
2810 void SetMinutes(int value);
2811
2817 int GetSeconds() const;
2818
2824 void SetSeconds(int value);
2825
2833 int DaysBetween(const Date& other) const;
2834
2844 void SetDate(int year, int month, int day);
2845
2855 void SetTime(int hour, int min, int sec);
2856
2869 void SetDateTime(int year, int month, int day, int hour, int min, int sec);
2870
2880 void GetDate(int& year, int& month, int& day) const;
2881
2891 void GetTime(int& hour, int& min, int& sec) const;
2892
2905 void GetDateTime(int& year, int& month, int& day, int& hour, int& min, int& sec) const;
2906
2914 void AddDays(int days);
2915
2923 void AddMonths(int months);
2924
2932 Date NextDay(const ostring& day) const;
2933
2939 Date LastDay() const;
2940
2949 void ChangeTimeZone(const ostring& tzSrc, const ostring& tzDst);
2950
2965 void FromString(const ostring& str, const ostring& format = OTEXT(""));
2966
2977 ostring ToString(const ostring& format) const;
2978
2987 ostring ToString() const override;
2988
2994 Date Clone() const;
2995
3001 Date& operator ++ ();
3002
3008 Date operator ++ (int);
3009
3015 Date& operator -- ();
3016
3022 Date operator -- (int);
3023
3029 Date operator + (int value) const;
3030
3036 Date operator - (int value) const;
3037
3043 Date& operator += (int value);
3044
3050 Date& operator -= (int value);
3051
3057 bool operator == (const Date& other) const;
3058
3064 bool operator != (const Date& other) const;
3065
3071 bool operator > (const Date& other) const;
3072
3078 bool operator < (const Date& other) const;
3079
3085 bool operator >= (const Date& other) const;
3086
3092 bool operator <= (const Date& other) const;
3093
3094 private:
3095
3096 int Compare(const Date& other) const;
3097
3098 Date(OCI_Date* pDate, core::Handle* parent = nullptr);
3099
3100 void Allocate();
3101 };
3102
3110 class Interval : public core::HandleHolder<OCI_Interval*>, public core::Streamable
3111 {
3112 friend class Environment;
3113 friend class Statement;
3114 friend class Resultset;
3115 friend class support::BindArray;
3116 friend class Object;
3117 template<class>
3118 friend class Collection;
3119
3120 public:
3121
3128 {
3130 YearMonth = OCI_INTERVAL_YM,
3132 DaySecond = OCI_INTERVAL_DS
3134
3143
3149 Interval();
3150
3158 Interval(IntervalType type);
3159
3171 Interval(IntervalType type, const ostring& data);
3172
3178 IntervalType GetType() const;
3179
3185 bool IsValid() const;
3186
3195 int GetYear() const;
3196
3205 void SetYear(int value);
3206
3215 int GetMonth() const;
3216
3225 void SetMonth(int value);
3226
3235 int GetDay() const;
3236
3245 void SetDay(int value);
3246
3255 int GetHours() const;
3256
3265 void SetHours(int value);
3266
3275 int GetMinutes() const;
3276
3285 void SetMinutes(int value);
3286
3295 int GetSeconds() const;
3296
3305 void SetSeconds(int value);
3306
3312 int GetMilliSeconds() const;
3313
3319 void SetMilliSeconds(int value);
3320
3335 void GetDaySecond(int& day, int& hour, int& min, int& sec, int& fsec) const;
3336
3351 void SetDaySecond(int day, int hour, int min, int sec, int fsec);
3352
3364 void GetYearMonth(int& year, int& month) const;
3365
3377 void SetYearMonth(int year, int month);
3378
3386 void UpdateTimeZone(const ostring& timeZone);
3387
3398 void FromString(const ostring& data);
3399
3408 ostring ToString(int leadingPrecision, int fractionPrecision) const;
3409
3415 ostring ToString() const override;
3416
3422 Interval Clone() const;
3423
3429 Interval operator + (const Interval& other) const;
3430
3436 Interval operator - (const Interval& other) const;
3437
3443 Interval& operator += (const Interval& other);
3444
3450 Interval& operator -= (const Interval& other);
3451
3457 bool operator == (const Interval& other) const;
3458
3464 bool operator != (const Interval& other) const;
3465
3471 bool operator > (const Interval& other) const;
3472
3478 bool operator < (const Interval& other) const;
3479
3485 bool operator >= (const Interval& other) const;
3486
3492 bool operator <= (const Interval& other) const;
3493
3494 private:
3495
3496 int Compare(const Interval& other) const;
3497
3498 Interval(OCI_Interval* pInterval, core::Handle* parent = nullptr);
3499 };
3500
3509 class Timestamp : public core::HandleHolder<OCI_Timestamp*>, public core::Streamable
3510 {
3511 friend class Environment;
3512 friend class Statement;
3513 friend class Resultset;
3514 friend class support::BindArray;
3515 friend class Object;
3516 friend class Connection;
3517 template<class>
3518 friend class Collection;
3519
3520 public:
3521
3528 {
3530 NoTimeZone = OCI_TIMESTAMP,
3532 WithTimeZone = OCI_TIMESTAMP_TZ,
3534 WithLocalTimeZone = OCI_TIMESTAMP_LTZ
3536
3545
3553 static Timestamp SysTimestamp(TimestampType type = NoTimeZone);
3554
3560 Timestamp();
3561
3570
3583 Timestamp(TimestampType type, const ostring& data, const ostring& format = OTEXT(""));
3584
3590 TimestampType GetType() const;
3591
3599 void Convert(const Timestamp& other);
3600
3606 bool IsValid() const;
3607
3613 int GetYear() const;
3614
3620 void SetYear(int value);
3621
3627 int GetMonth() const;
3628
3634 void SetMonth(int value);
3635
3641 int GetDay() const;
3642
3648 void SetDay(int value);
3649
3655 int GetHours() const;
3656
3662 void SetHours(int value);
3663
3669 int GetMinutes() const;
3670
3676 void SetMinutes(int value);
3677
3683 int GetSeconds() const;
3684
3690 void SetSeconds(int value);
3691
3697 int GetMilliSeconds() const;
3698
3704 void SetMilliSeconds(int value);
3705
3715 void GetDate(int& year, int& month, int& day) const;
3716
3727 void GetTime(int& hour, int& min, int& sec, int& fsec) const;
3728
3738 void SetDate(int year, int month, int day);
3739
3750 void SetTime(int hour, int min, int sec, int fsec);
3751
3765 void GetDateTime(int& year, int& month, int& day, int& hour, int& min, int& sec, int& fsec) const;
3766
3781 void SetDateTime(int year, int month, int day, int hour, int min, int sec, int fsec, const ostring& timeZone = OTEXT(""));
3782
3791 ostring GetTimeZone() const;
3792
3802 void SetTimeZone(const ostring& timeZone);
3803
3812 void GetTimeZoneOffset(int& hour, int& min) const;
3813
3826 static void Substract(const Timestamp& lsh, const Timestamp& rsh, Interval& result);
3827
3839 void FromString(const ostring& data, const ostring& format = OCI_STRING_FORMAT_DATE);
3840
3852 ostring ToString(const ostring& format, int precision) const;
3853
3859 ostring ToString() const override;
3860
3866 Timestamp Clone() const;
3867
3873 Timestamp& operator ++ ();
3874
3880 Timestamp operator ++ (int);
3881
3887 Timestamp& operator -- ();
3888
3894 Timestamp operator -- (int);
3895
3901 Timestamp operator + (int value) const;
3902
3908 Timestamp operator - (int value) const;
3909
3915 Interval operator - (const Timestamp& other);
3916
3922 Timestamp& operator += (int value);
3923
3929 Timestamp& operator -= (int value);
3930
3936 Timestamp operator + (const Interval& other) const;
3937
3943 Timestamp operator - (const Interval& other) const;
3944
3950 Timestamp& operator += (const Interval& other);
3951
3957 Timestamp& operator -= (const Interval& other);
3958
3964 bool operator == (const Timestamp& other) const;
3965
3971 bool operator != (const Timestamp& other) const;
3972
3978 bool operator > (const Timestamp& other) const;
3979
3985 bool operator < (const Timestamp& other) const;
3986
3992 bool operator >= (const Timestamp& other) const;
3993
3999 bool operator <= (const Timestamp& other) const;
4000
4001 private:
4002
4003 int Compare(const Timestamp& other) const;
4004
4005 Timestamp(OCI_Timestamp* pTimestamp, core::Handle* parent = nullptr);
4006 };
4007
4015 template<class T, int U>
4016 class Lob : public core::HandleHolder<OCI_Lob*>
4017 {
4018 friend class Statement;
4019 friend class Resultset;
4020 friend class support::BindArray;
4021 friend class Object;
4022 template<class>
4023 friend class Collection;
4024
4025 public:
4026
4032 Lob();
4033
4044 Lob(const Connection& connection);
4045
4056 T Read(unsigned int length);
4057
4068 unsigned int Write(const T& content);
4069
4080 unsigned int Append(const T& content);
4081
4089 void Append(const Lob& other);
4090
4105 bool Seek(SeekMode seekMode, big_uint offset);
4106
4112 LobType GetType() const;
4113
4119 big_uint GetOffset() const;
4120
4126 big_uint GetLength() const;
4127
4133 big_uint GetMaxSize() const;
4134
4146 big_uint GetChunkSize() const;
4147
4153 Connection GetConnection() const;
4154
4162 void Truncate(big_uint length);
4163
4179 big_uint Erase(big_uint offset, big_uint length);
4180
4194 void Copy(Lob& dest, big_uint offset, big_uint offsetDest, big_uint length) const;
4195
4201 bool IsTemporary() const;
4202
4208 bool IsRemote() const;
4209
4222 void Open(OpenMode mode);
4223
4229 void Flush();
4230
4239 void Close();
4240
4259 void EnableBuffering(bool value);
4260
4266 Lob Clone() const;
4267
4273 Lob& operator += (const Lob& other);
4274
4280 bool operator == (const Lob& other) const;
4281
4287 bool operator != (const Lob& other) const;
4288
4289 private:
4290
4291 bool Equals(const Lob& other) const;
4292
4293 Lob(OCI_Lob* pLob, core::Handle* parent = nullptr);
4294
4295 };
4296
4307
4318
4329
4338 class File : public core::HandleHolder<OCI_File*>
4339 {
4340 friend class Statement;
4341 friend class Resultset;
4342 friend class support::BindArray;
4343 friend class Object;
4344 template<class>
4345 friend class Collection;
4346
4347 public:
4348
4354 File();
4355
4366 File(const Connection& connection);
4367
4382 File(const Connection& connection, const ostring& directory, const ostring& name);
4383
4394 Raw Read(unsigned int size);
4395
4410 bool Seek(SeekMode seekMode, big_uint offset);
4411
4420 bool Exists() const;
4421
4427 big_uint GetOffset() const;
4428
4434 big_uint GetLength() const;
4435
4441 Connection GetConnection() const;
4442
4455 void SetInfos(const ostring& directory, const ostring& name);
4456
4462 ostring GetName() const;
4463
4469 ostring GetDirectory() const;
4470
4476 void Open();
4477
4483 void Close();
4484
4490 bool IsOpened() const;
4491
4497 File Clone() const;
4498
4504 bool operator == (const File& other) const;
4505
4511 bool operator != (const File& other) const;
4512
4513 private:
4514
4515 bool Equals(const File& other) const;
4516
4517 File(OCI_File* pFile, core::Handle* parent = nullptr);
4518 };
4519
4527 class TypeInfo : public core::HandleHolder<OCI_TypeInfo*>
4528 {
4529 friend class Object;
4530 friend class Reference;
4531 template<class>
4532 friend class Collection;
4533 friend class Column;
4534 public:
4535
4542 {
4544 Table = OCI_TIF_TABLE,
4546 View = OCI_TIF_VIEW,
4548 Type = OCI_TIF_TYPE
4550
4559
4572 TypeInfo(const Connection& connection, const ostring& name, TypeInfoType type);
4573
4579 TypeInfoType GetType() const;
4580
4586 ostring GetName() const;
4587
4593 Connection GetConnection() const;
4594
4604 unsigned int GetColumnCount() const;
4605
4620 Column GetColumn(unsigned int index) const;
4621
4634 boolean IsFinalType() const;
4635
4650 TypeInfo GetSuperType() const;
4651
4652 private:
4653
4654 TypeInfo(OCI_TypeInfo* pTypeInfo, core::Handle* parent);
4655 };
4656
4664 class Object : public core::HandleHolder<OCI_Object*>, public core::Streamable
4665 {
4666 friend class Statement;
4667 friend class Resultset;
4668 friend class support::BindArray;
4669 friend class Reference;
4670 template<class>
4671 friend class Collection;
4672 friend class Message;
4673
4674 public:
4675
4682 {
4684 Persistent = OCI_OBJ_PERSISTENT,
4686 Transient = OCI_OBJ_TRANSIENT,
4688 Value = OCI_OBJ_VALUE
4690
4699
4705 Object();
4706
4714 Object(const TypeInfo& typeInfo);
4715
4723 bool IsAttributeNull(const ostring& name) const;
4724
4732 void SetAttributeNull(const ostring& name);
4733
4739 TypeInfo GetTypeInfo() const;
4740
4746 Reference GetReference() const;
4747
4753 ObjectType GetType() const;
4754
4767 template<class T>
4768 T Get(const ostring& name) const;
4769
4783 template<class T>
4784 void Get(const ostring& name, T& value) const;
4785
4799 template<class T>
4800 void Get(const ostring& name, Collection<T>& value) const;
4801
4815 template<class T>
4816 void Set(const ostring& name, const T& value);
4817
4823 Object Clone() const;
4824
4830 ostring ToString() const override;
4831
4832 private:
4833
4834 Object(OCI_Object* pObject, core::Handle* parent = nullptr);
4835 };
4836
4844 class Reference : public core::HandleHolder<OCI_Ref*>, public core::Streamable
4845 {
4846 friend class Statement;
4847 friend class Resultset;
4848 friend class support::BindArray;
4849 friend class Object;
4850 template<class>
4851 friend class Collection;
4852
4853 public:
4854
4860 Reference();
4861
4869 Reference(const TypeInfo& typeInfo);
4870
4876 TypeInfo GetTypeInfo() const;
4877
4886 Object GetObject() const;
4887
4893 bool IsReferenceNull() const;
4894
4903 void SetReferenceNull();
4904
4910 Reference Clone() const;
4911
4917 ostring ToString() const override;
4918
4919 private:
4920
4921 Reference(OCI_Ref* pRef, core::Handle* parent = nullptr);
4922 };
4923
4932 template<class T>
4934 {
4935 template<class>
4936 friend class CollectionIterator;
4937
4938 public:
4939
4940 typedef T ValueType;
4942
4944 CollectionElement(CollectionType* coll, unsigned int pos);
4945 operator T() const;
4946 CollectionElement& operator = (const ValueType& other);
4947 CollectionElement& operator = (const CollectionElement& other);
4948 bool IsNull() const;
4949 void SetNull();
4950
4951 private:
4952
4953 CollectionType* _coll;
4954 unsigned int _pos;
4955 };
4956
4964 template<class T>
4966 {
4967 public:
4968
4969 template<class>
4970 friend class Collection;
4971
4972 typedef typename T::ValueType value_type;
4974
4975 typedef std::random_access_iterator_tag iterator_category;
4976 typedef ptrdiff_t difference_type;
4977 typedef ptrdiff_t distance_type;
4978 typedef value_type* pointer;
4979 typedef value_type& reference;
4980
4983
4984 CollectionIterator& operator = (const CollectionIterator& other);
4985
4986 CollectionIterator& operator += (difference_type value);
4987 CollectionIterator& operator -= (difference_type value);
4988
4989 T& operator*();
4990 T* operator->();
4991
4992 CollectionIterator& operator++();
4993 CollectionIterator& operator--();
4994
4995 CollectionIterator operator++(int);
4996 CollectionIterator operator--(int);
4997
4998 CollectionIterator operator + (difference_type value);
4999 CollectionIterator operator - (difference_type value);
5000
5001 difference_type operator - (const CollectionIterator& other);
5002
5003 bool operator == (const CollectionIterator& other);
5004 bool operator != (const CollectionIterator& other);
5005 bool operator > (const CollectionIterator& other);
5006 bool operator < (const CollectionIterator& other);
5007 bool operator >= (const CollectionIterator& other);
5008 bool operator <= (const CollectionIterator& other);
5009
5010 protected:
5011
5012 CollectionIterator(CollectionType* collection, unsigned int pos);
5013
5014 T _elem;
5015 };
5016
5024 template<class T>
5025 class Collection : public core::HandleHolder<OCI_Coll*>, public core::Streamable
5026 {
5027 friend class Statement;
5028 friend class Resultset;
5029 friend class support::BindArray;
5030 friend class Object;
5031 template<class>
5032 friend class CollectionIterator;
5033 template<class>
5034 friend class Collection;
5035
5036 public:
5037
5044 {
5046 Varray = OCI_COLL_VARRAY,
5048 NestedTable = OCI_COLL_NESTED_TABLE,
5050 IndexedTable = OCI_COLL_INDEXED_TABLE
5052
5061
5067 Collection();
5068
5076 Collection(const TypeInfo& typeInfo);
5077
5083 CollectionType GetType() const;
5084
5090 unsigned int GetMax() const;
5091
5097 unsigned int GetSize() const;
5098
5109 unsigned int GetCount() const;
5110
5118 void Truncate(unsigned int size);
5119
5126 void Clear();
5127
5138 bool IsElementNull(unsigned int index) const;
5139
5150 void SetElementNull(unsigned int index);
5151
5169 bool Delete(unsigned int index) const;
5170
5178 T Get(unsigned int index) const;
5179
5188 void Set(unsigned int index, const T& value);
5189
5198 void Append(const T& value);
5199
5205 TypeInfo GetTypeInfo() const;
5206
5212 Collection Clone() const;
5213
5219 ostring ToString() const override;
5220
5227
5234
5240 iterator begin();
5241
5247 const_iterator begin() const;
5248
5254 iterator end();
5255
5261 const_iterator end() const;
5262
5268 CollectionElement<T> operator [] (unsigned int index);
5269
5275 CollectionElement<T> operator [](unsigned int index) const;
5276
5277 private:
5278
5279 static T GetElem(OCI_Elem* elem, core::Handle* parent);
5280
5281 static void SetElem(OCI_Elem* elem, const T& value);
5282
5283 Collection(OCI_Coll* pColl, core::Handle* parent = nullptr);
5284 };
5285
5293 template<class T, int U>
5294 class Long : public core::HandleHolder<OCI_Long*>
5295 {
5296 friend class Statement;
5297 friend class Resultset;
5298 friend class support::BindArray;
5299
5300 public:
5301
5307 Long();
5308
5316 Long(const Statement& statement);
5317
5328 unsigned int Write(const T& content);
5329
5335 unsigned int GetLength() const;
5336
5342 T GetContent() const;
5343
5344 private:
5345
5346 Long(OCI_Long* pLong, core::Handle* parent = nullptr);
5347 };
5348
5359
5370
5378 class BindInfo : public core::HandleHolder<OCI_Bind*>
5379 {
5380 friend class Statement;
5381
5382 public:
5383
5390 {
5392 In = OCI_BDM_IN,
5394 Out = OCI_BDM_OUT,
5396 InOut = OCI_BDM_IN_OUT
5398
5407
5414 {
5416 AsArray = 1,
5418 AsPlSqlTable = 2
5420
5429
5435 ostring GetName() const;
5436
5442 DataType GetType() const;
5443
5463 unsigned int GetSubType() const;
5464
5474 unsigned int GetDataCount() const;
5475
5481 Statement GetStatement() const;
5482
5503 void SetDataNull(bool value, unsigned int index = 1);
5504
5519 bool IsDataNull(unsigned int index = 1) const;
5520
5534 void SetCharsetForm(CharsetForm value);
5535
5541 BindDirection GetDirection() const;
5542
5543 private:
5544
5545 BindInfo(OCI_Bind* pBind, core::Handle* parent);
5546 };
5547
5555 class Statement : public core::HandleHolder<OCI_Statement*>
5556 {
5557 friend class Exception;
5558 friend class Resultset;
5559 template<class, int>
5560 friend class Long;
5561 friend class BindInfo;
5562 friend class BindObject;
5563
5564 public:
5565
5572 {
5574 TypeSelect = OCI_CST_SELECT,
5576 TypeUpdate = OCI_CST_UPDATE,
5578 TypeDelete = OCI_CST_DELETE,
5580 TypeInsert = OCI_CST_INSERT,
5582 TypeCreate = OCI_CST_CREATE,
5584 TypeDrop = OCI_CST_DROP,
5586 TypeAlter = OCI_CST_ALTER,
5588 TypeBegin = OCI_CST_BEGIN,
5590 TypeDeclare = OCI_CST_DECLARE,
5592 TypeCall = OCI_CST_CALL,
5594 TypeMerge = OCI_CST_MERGE
5596
5605
5612 {
5614 FetchForward = OCI_SFM_DEFAULT,
5616 FetchScrollable = OCI_SFM_SCROLLABLE
5618
5627
5634 {
5636 BindByPosition = OCI_BIND_BY_POS,
5638 BindByName = OCI_BIND_BY_NAME
5640
5649
5656 {
5658 LongExplicit = OCI_LONG_EXPLICIT,
5660 LongImplicit = OCI_LONG_IMPLICIT
5662
5671
5677 Statement();
5678
5689 Statement(const Connection& connection);
5690
5696 Connection GetConnection() const;
5697
5724 void Describe(const ostring& sql);
5725
5749 void Parse(const ostring& sql);
5750
5761 void Prepare(const ostring& sql);
5762
5768 void ExecutePrepared();
5769
5777 void Execute(const ostring& sql);
5778
5796 template<class T>
5797 unsigned int ExecutePrepared(T callback);
5798
5819 template<class T, class U>
5820 unsigned int ExecutePrepared(T callback, U adapter);
5821
5840 template<class T>
5841 unsigned int Execute(const ostring& sql, T callback);
5842
5864 template<class T, class U>
5865 unsigned int Execute(const ostring& sql, T callback, U adapter);
5866
5881 unsigned int GetAffectedRows() const;
5882
5888 ostring GetSql() const;
5889
5895 ostring GetSqlIdentifier() const;
5896
5908 Resultset GetResultset();
5909
5931 Resultset GetNextResultset();
5932
5957 void SetBindArraySize(unsigned int size);
5958
5964 unsigned int GetBindArraySize() const;
5965
5981 void AllowRebinding(bool value);
5982
5991 bool IsRebindingAllowed() const;
5992
6009 unsigned int GetBindIndex(const ostring& name) const;
6010
6016 unsigned int GetBindCount() const;
6017
6032 BindInfo GetBind(unsigned int index) const;
6033
6044 BindInfo GetBind(const ostring& name) const;
6045
6065 template<class T>
6066 void Bind(const ostring& name, T& value, BindInfo::BindDirection mode);
6067
6089 template<class T, class U>
6090 void Bind(const ostring& name, T& value, U extraInfo, BindInfo::BindDirection mode);
6091
6103 template<class T>
6104 void Bind(const ostring& name, Collection<T>& value, BindInfo::BindDirection mode);
6105
6126 template<class T>
6127 void Bind(const ostring& name, std::vector<T>& values, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6128
6149 template<class T>
6150 void Bind(const ostring& name, std::vector<T>& values, TypeInfo& typeInfo, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6151
6165 template<class T>
6166 void Bind(const ostring& name, std::vector<Collection<T> >& values, TypeInfo& typeInfo, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6167
6191 template<class T, class U>
6192 void Bind(const ostring& name, std::vector<T>& values, U extraInfo, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6193
6214 template<class T>
6215 void Register(const ostring& name);
6216
6234 template<class T, class U>
6235 void Register(const ostring& name, U& extraInfo);
6236
6255 template<class T, class U>
6256 void Register(const ostring& name, U extraInfo);
6257
6263 StatementType GetStatementType() const;
6264
6274 unsigned int GetSqlErrorPos() const;
6275
6286 void SetFetchMode(FetchMode value);
6287
6296 FetchMode GetFetchMode() const;
6297
6305 void SetBindMode(BindMode value);
6306
6315 BindMode GetBindMode() const;
6316
6324 void SetFetchSize(unsigned int value);
6325
6334 unsigned int GetFetchSize() const;
6335
6346 void SetPrefetchSize(unsigned int value);
6347
6356 unsigned int GetPrefetchSize() const;
6357
6376 void SetPrefetchMemory(unsigned int value);
6377
6386 unsigned int GetPrefetchMemory() const;
6387
6395 void SetLongMaxSize(unsigned int value);
6396
6405 unsigned int GetLongMaxSize() const;
6406
6417 void SetLongMode(LongMode value);
6418
6424 LongMode GetLongMode() const;
6425
6438 unsigned int GetSQLCommand() const;
6439
6452 ostring GetSQLVerb() const;
6453
6459 void GetBatchErrors(std::vector<Exception>& exceptions);
6460
6461 private:
6462
6463 static bool IsResultsetHandle(core::Handle* handle);
6464 static void OnFreeSmartHandle(SmartHandle* smartHandle);
6465
6466 Statement(OCI_Statement* stmt, core::Handle* parent = nullptr);
6467
6468 support::BindsHolder* GetBindsHolder(bool create) const;
6469
6470 void ReleaseResultsets() const;
6471
6472 void SetLastBindMode(BindInfo::BindDirection mode);
6473
6474 void SetInData() const;
6475 void SetOutData() const;
6476 void ClearBinds() const;
6477
6478 template<typename M, class T>
6479 void Bind1(M& method, const ostring& name, T& value, BindInfo::BindDirection mode);
6480
6481 template<typename M, class T>
6482 void Bind2(M& method, const ostring& name, T& value, BindInfo::BindDirection mode);
6483
6484 template<typename M, class T>
6485 void BindVector1(M& method, const ostring& name, std::vector<T>& values, BindInfo::BindDirection mode, BindInfo::VectorType type);
6486
6487 template<typename M, class T, class U>
6488 void BindVector2(M& method, const ostring& name, std::vector<T>& values, BindInfo::BindDirection mode, U subType, BindInfo::VectorType type);
6489
6490 template<typename T>
6491 unsigned int Fetch(T callback);
6492
6493 template<typename T, typename U>
6494 unsigned int Fetch(T callback, U adapter);
6495 };
6496
6504 class Resultset : public core::HandleHolder<OCI_Resultset*>
6505 {
6506 friend class Statement;
6507 public:
6508
6515 {
6517 SeekAbsolute = OCI_SFD_ABSOLUTE,
6519 SeekRelative = OCI_SFD_RELATIVE
6521
6530
6543 template<class T>
6544 T Get(unsigned int index) const;
6545
6559 template<class T>
6560 void Get(unsigned int index, T& value) const;
6561
6574 template<class T>
6575 T Get(const ostring& name) const;
6576
6587 template<class T>
6588 void Get(const ostring& name, T& value) const;
6589
6604 template<class T, class U>
6605 bool Get(T& value, U adapter) const;
6606
6622 template<typename T>
6623 unsigned int ForEach(T callback);
6624
6647 template<typename T, typename U>
6648 unsigned int ForEach(T callback, U adapter);
6649
6663 bool Next();
6664
6678 bool Prev();
6679
6691 bool First();
6692
6704 bool Last();
6705
6726 bool Seek(SeekMode mode, int offset);
6727
6733 unsigned int GetCount() const;
6734
6745 unsigned int GetCurrentRow() const;
6746
6760 unsigned int GetColumnIndex(const ostring& name) const;
6761
6767 unsigned int GetColumnCount() const;
6768
6779 Column GetColumn(unsigned int index) const;
6780
6791 Column GetColumn(const ostring& name) const;
6792
6803 bool IsColumnNull(unsigned int index) const;
6804
6812 bool IsColumnNull(const ostring& name) const;
6813
6819 Statement GetStatement() const;
6820
6826 bool operator ++ (int);
6827
6833 bool operator -- (int);
6834
6841 bool operator += (int offset);
6842
6849 bool operator -= (int offset);
6850
6851 private:
6852
6853 Resultset(OCI_Resultset* resultset, core::Handle* parent);
6854 };
6855
6863 class Column : public core::HandleHolder<OCI_Column*>
6864 {
6865 friend class TypeInfo;
6866 friend class Resultset;
6867
6868 public:
6869
6876 {
6878 NoFlags = OCI_CPF_NONE,
6881 IsIdentity = OCI_CPF_IS_IDENTITY,
6885 IsGeneratedAlways = OCI_CPF_IS_GEN_ALWAYS,
6888 IsGeneratedByDefaultOnNull = OCI_CPF_IS_GEN_BY_DEFAULT_ON_NULL,
6890 IsLogicalPartitioning = OCI_CPF_IS_LPART,
6892 IsGeneratedByContainers = OCI_CPF_IS_CONID
6894
6903
6909 ostring GetName() const;
6910
6919 ostring GetSQLType() const;
6920
6930 ostring GetFullSQLType() const;
6931
6937 DataType GetType() const;
6938
6956 unsigned int GetSubType() const;
6957
6963 CharsetForm GetCharsetForm() const;
6964
6970 CollationID GetCollationID() const;
6971
6981 unsigned int GetSize() const;
6982
6988 int GetScale() const;
6989
6995 int GetPrecision() const;
6996
7002 int GetFractionalPrecision() const;
7003
7009 int GetLeadingPrecision() const;
7010
7021 PropertyFlags GetPropertyFlags() const;
7022
7028 bool IsNullable() const;
7029
7039 bool IsCharSemanticUsed() const;
7040
7050 TypeInfo GetTypeInfo() const;
7051
7052 private:
7053
7054 Column(OCI_Column* pColumn, core::Handle* parent);
7055 };
7056
7067 class Subscription : public core::HandleHolder<OCI_Subscription*>
7068 {
7069 friend class Event;
7070
7071 public:
7072
7080 typedef void (*NotifyHandlerProc) (Event& evt);
7081
7088 {
7090 ObjectChanges = OCI_CNT_OBJECTS,
7092 RowChanges = OCI_CNT_ROWS,
7094 DatabaseChanges = OCI_CNT_DATABASES,
7096 AllChanges = OCI_CNT_ALL
7098
7107
7113 Subscription();
7114
7130 void Register(const Connection& connection, const ostring& name, ChangeTypes changeTypes, NotifyHandlerProc handler, unsigned int port = 0, unsigned int timeout = 0);
7131
7146 void Unregister();
7147
7153 void Watch(const ostring& sql);
7154
7160 ostring GetName() const;
7161
7167 unsigned int GetTimeout() const;
7168
7174 unsigned int GetPort() const;
7175
7184 Connection GetConnection() const;
7185
7186 private:
7187
7188 Subscription(OCI_Subscription* pSubcription);
7189 };
7190
7201 class Event : public core::HandleHolder<OCI_Event*>
7202 {
7203 friend class Subscription;
7204 friend class Environment;
7205
7206 public:
7207
7214 {
7216 DatabaseStart = OCI_ENT_STARTUP,
7218 DatabaseShutdown = OCI_ENT_SHUTDOWN,
7220 DatabaseShutdownAny = OCI_ENT_SHUTDOWN_ANY,
7222 DatabaseDrop = OCI_ENT_DROP_DATABASE,
7224 Unregister = OCI_ENT_DEREGISTER,
7226 ObjectChanged = OCI_ENT_OBJECT_CHANGED
7228
7237
7244 {
7246 ObjectInserted = OCI_ONT_INSERT,
7248 ObjectUpdated = OCI_ONT_UPDATE,
7250 ObjectDeleted = OCI_ONT_DELETE,
7252 ObjectAltered = OCI_ONT_ALTER,
7254 ObjectDropped = OCI_ONT_DROP,
7256 ObjectGeneric = OCI_ONT_GENERIC
7258
7267
7273 EventType GetType() const;
7274
7283 ObjectEvent GetObjectEvent() const;
7284
7290 ostring GetDatabaseName() const;
7291
7300 ostring GetObjectName() const;
7301
7307 ostring GetRowID() const;
7308
7314 Subscription GetSubscription() const;
7315
7316 private:
7317
7318 Event(OCI_Event* pEvent);
7319 };
7320
7328 class Agent : public core::HandleHolder<OCI_Agent*>
7329 {
7330 friend class Message;
7331 friend class Dequeue;
7332
7333 public:
7334
7357 Agent(const Connection& connection, const ostring& name = OTEXT(""), const ostring& address = OTEXT(""));
7358
7364 ostring GetName() const;
7365
7379 void SetName(const ostring& value);
7380
7389 ostring GetAddress() const;
7390
7404 void SetAddress(const ostring& value);
7405
7406 private:
7407
7408 Agent(OCI_Agent* pAgent, core::Handle* parent);
7409 };
7410
7418 class Message : public core::HandleHolder<OCI_Msg*>
7419 {
7420 friend class Dequeue;
7421
7422 public:
7423
7430 {
7432 Ready = OCI_AMS_READY,
7434 Waiting = OCI_AMS_WAITING,
7436 Processed = OCI_AMS_PROCESSED,
7438 Expired = OCI_AMS_EXPIRED
7440
7449
7479 Message(const TypeInfo& typeInfo);
7480
7489 void Reset();
7490
7496 template<class T>
7498
7506 template<class T>
7507 void SetPayload(const T& value);
7508
7517 Date GetEnqueueTime() const;
7518
7524 int GetAttemptCount() const;
7525
7531 MessageState GetState() const;
7532
7543 Raw GetID() const;
7544
7553 int GetExpiration() const;
7554
7574 void SetExpiration(int value);
7575
7584 int GetEnqueueDelay() const;
7585
7608 void SetEnqueueDelay(int value);
7609
7618 int GetPriority() const;
7619
7632 void SetPriority(int value);
7633
7643 Raw GetOriginalID() const;
7644
7656 void SetOriginalID(const Raw& value);
7657
7666 ostring GetCorrelation() const;
7667
7678 void SetCorrelation(const ostring& value);
7679
7693 ostring GetExceptionQueue() const;
7694
7721 void SetExceptionQueue(const ostring& value);
7722
7731 Agent GetSender() const;
7732
7740 void SetSender(const Agent& agent);
7741
7753 void SetConsumers(std::vector<Agent>& agents);
7754
7755 private:
7756
7757 Message(OCI_Msg* pMessage, core::Handle* parent);
7758 };
7759
7767 class Enqueue : public core::HandleHolder<OCI_Enqueue*>
7768 {
7769 public:
7770
7777 {
7779 Before = OCI_ASD_BEFORE,
7781 OnTop = OCI_ASD_TOP
7783
7792
7799 {
7801 Immediate = OCI_AMV_IMMEDIATE,
7803 OnCommit = OCI_AMV_ON_COMMIT
7805
7814
7836 Enqueue(const TypeInfo& typeInfo, const ostring& queueName);
7837
7845 void Put(const Message& message);
7846
7855 EnqueueVisibility GetVisibility() const;
7856
7867 void SetVisibility(EnqueueVisibility value);
7868
7877 EnqueueMode GetMode() const;
7878
7897 void SetMode(EnqueueMode value);
7898
7909 Raw GetRelativeMsgID() const;
7910
7924 void SetRelativeMsgID(const Raw& value);
7925 };
7926
7934 class Dequeue : public core::HandleHolder<OCI_Dequeue*>
7935 {
7936 friend class Environment;
7937
7938 public:
7939
7947 typedef void (*NotifyAQHandlerProc) (Dequeue& dequeue);
7948
7955 {
7957 Browse = OCI_ADM_BROWSE,
7959 Locked = OCI_ADM_LOCKED,
7961 Remove = OCI_ADM_REMOVE,
7963 Confirm = OCI_ADM_REMOVE_NODATA
7965
7974
7981 {
7983 Immediate = OCI_AMV_IMMEDIATE,
7985 OnCommit = OCI_AMV_ON_COMMIT
7987
7996
8003 {
8005 FirstMessage = OCI_ADN_FIRST_MSG,
8007 NextMessage = OCI_ADN_NEXT_MSG,
8010 NextTransaction = OCI_ADN_NEXT_TRANSACTION
8012
8021
8030 Dequeue(const TypeInfo& typeInfo, const ostring& queueName);
8031
8045 Message Get();
8046
8062 Agent Listen(int timeout);
8063
8072 ostring GetConsumer() const;
8073
8085 void SetConsumer(const ostring& value);
8086
8095 ostring GetCorrelation() const;
8096
8108 void SetCorrelation(const ostring& value);
8109
8118 Raw GetRelativeMsgID() const;
8119
8127 void SetRelativeMsgID(const Raw& value);
8128
8137 DequeueVisibility GetVisibility() const;
8138
8153 void SetVisibility(DequeueVisibility value);
8154
8163 DequeueMode GetMode() const;
8164
8175 void SetMode(DequeueMode value);
8176
8185 NavigationMode GetNavigation() const;
8186
8206 void SetNavigation(NavigationMode value);
8207
8216 int GetWaitTime() const;
8217
8235 void SetWaitTime(int value);
8236
8244 void SetAgents(std::vector<Agent>& agents);
8245
8262 void Subscribe(unsigned int port, unsigned int timeout, NotifyAQHandlerProc handler);
8263
8272 void Unsubscribe();
8273
8274 private:
8275
8276 Dequeue(OCI_Dequeue* pDequeue, core::Handle* parent);
8277 };
8278
8284 class Queue
8285 {
8286 public:
8287
8294 {
8296 NormalQueue = OCI_AQT_NORMAL,
8298 ExceptionQueue = OCI_AQT_EXCEPTION,
8300 NonPersistentQueue = OCI_AQT_NON_PERSISTENT
8302
8311
8336 static void Create(const Connection& connection, const ostring& queue, const ostring& table, QueueType type = NormalQueue,
8337 unsigned int maxRetries = 0, unsigned int retryDelay = 0, unsigned int retentionTime = 0,
8338 bool dependencyTracking = false, const ostring& comment = OTEXT(""));
8339
8360 static void Alter(const Connection& connection, const ostring& queue,
8361 unsigned int maxRetries = 0, unsigned int retryDelay = 0,
8362 unsigned int retentionTime = 0, const ostring& comment = OTEXT(""));
8363
8379 static void Drop(const Connection& connection, const ostring& queue);
8380
8398 static void Start(const Connection& connection, const ostring& queue, bool enableEnqueue = true, bool enableDequeue = true);
8399
8418 static void Stop(const Connection& connection, const ostring& queue, bool stopEnqueue = true, bool stopDequeue = true, bool wait = true);
8419 };
8420
8427 {
8428 public:
8429
8437 {
8439 None = OCI_AGM_NONE,
8442 Transactionnal = OCI_AGM_TRANSACTIONNAL
8444
8453
8461 {
8463 Buffered = OCI_APM_BUFFERED,
8465 Persistent = OCI_APM_PERSISTENT,
8467 All = OCI_APM_ALL
8469
8478
8513 static void Create(const Connection& connection, const ostring& table, const ostring& payloadType, bool multipleConsumers,
8514 const ostring& storageClause = OTEXT(""), const ostring& sortList = OTEXT(""),
8515 GroupingMode groupingMode = None, const ostring& comment = OTEXT(""),
8516 unsigned int primaryInstance = 0, unsigned int secondaryInstance = 0,
8517 const ostring& compatible = OTEXT(""));
8518
8537 static void Alter(const Connection& connection, const ostring& table, const ostring& comment, unsigned int primaryInstance = 0, unsigned int secondaryInstance = 0);
8538
8559 static void Drop(const Connection& connection, const ostring& table, bool force = true);
8560
8584 static void Purge(const Connection& connection, const ostring& table, PurgeMode mode, const ostring& condition = OTEXT(""), bool block = true);
8585
8603 static void Migrate(const Connection& connection, const ostring& table, const ostring& compatible = OTEXT(""));
8604 };
8605
8613 class DirectPath : public core::HandleHolder<OCI_DirPath*>
8614 {
8615 public:
8616
8623 {
8625 Default = OCI_DCM_DEFAULT,
8627 Force = OCI_DCM_FORCE
8629
8638
8645 {
8647 ResultComplete = OCI_DPR_COMPLETE,
8649 ResultError = OCI_DPR_ERROR,
8651 ResultFull = OCI_DPR_FULL,
8653 ResultPartial = OCI_DPR_PARTIAL,
8655 ResultEmpty = OCI_DPR_EMPTY
8657
8666
8688 DirectPath(const TypeInfo& typeInfo, unsigned int nbCols, unsigned int nbRows, const ostring& partition = OTEXT(""));
8689
8706 void SetColumn(unsigned int colIndex, const ostring& name, unsigned int maxSize, const ostring& format = OTEXT(""));
8707
8738 template<class T>
8739 void SetEntry(unsigned int rowIndex, unsigned int colIndex, const T& value, bool complete = true);
8740
8751 void Reset();
8752
8758 void Prepare();
8759
8778 DirectPath::Result Convert();
8779
8791 DirectPath::Result Load();
8792
8801 void Finish();
8802
8815 void Abort();
8816
8825 void Save();
8826
8832 void FlushRow();
8833
8845 void SetCurrentRows(unsigned int value);
8846
8855 unsigned int GetCurrentRows() const;
8856
8865 unsigned int GetMaxRows() const;
8866
8875 unsigned int GetRowCount() const;
8876
8889 unsigned int GetAffectedRows() const;
8890
8904 void SetDateFormat(const ostring& format);
8905
8932 void SetParallel(bool value);
8933
8948 void SetNoLog(bool value);
8949
8963 void SetCacheSize(unsigned int value);
8964
8975 void SetBufferSize(unsigned int value);
8976
8990 void SetConversionMode(ConversionMode value);
8991
9020 unsigned int GetErrorColumn();
9021
9055 unsigned int GetErrorRow();
9056 };
9057
9058
9059#define OCILIB_DEFINE_FLAG_OPERATORS(T) \
9060 inline core::Flags<T> operator | (T a, T b) { return core::Flags<T>(a) | core::Flags<T>(b); } \
9061
9062 OCILIB_DEFINE_FLAG_OPERATORS(Environment::EnvironmentFlagsValues)
9063 OCILIB_DEFINE_FLAG_OPERATORS(Environment::SessionFlagsValues)
9064 OCILIB_DEFINE_FLAG_OPERATORS(Environment::StartFlagsValues)
9065 OCILIB_DEFINE_FLAG_OPERATORS(Environment::StartModeValues)
9066 OCILIB_DEFINE_FLAG_OPERATORS(Environment::ShutdownModeValues)
9067 OCILIB_DEFINE_FLAG_OPERATORS(Environment::ShutdownFlagsValues)
9068 OCILIB_DEFINE_FLAG_OPERATORS(Environment::AllocatedBytesValues)
9069 OCILIB_DEFINE_FLAG_OPERATORS(Transaction::TransactionFlagsValues)
9070 OCILIB_DEFINE_FLAG_OPERATORS(Column::PropertyFlagsValues)
9071 OCILIB_DEFINE_FLAG_OPERATORS(Subscription::ChangeTypesValues)
9072}
AQ identified agent for messages delivery.
Definition: types.hpp:7329
Provides SQL bind information.
Definition: types.hpp:5379
VectorTypeValues
Vector type values.
Definition: types.hpp:5414
BindDirectionValues
Bind direction enumerated values.
Definition: types.hpp:5390
core::Enum< VectorTypeValues > VectorType
Vector type.
Definition: types.hpp:5428
core::Enum< BindDirectionValues > BindDirection
Bind direction.
Definition: types.hpp:5406
Class used for handling transient collection value. it is used internally by the Collection<T> class:
Definition: types.hpp:4934
Object identifying the SQL data types VARRAY and NESTED TABLE.
Definition: types.hpp:5026
CollectionIterator< const CollectionElement< T > > const_iterator
Common const iterator declaration.
Definition: types.hpp:5233
core::Enum< CollectionTypeValues > CollectionType
Collection type.
Definition: types.hpp:5060
CollectionTypeValues
Collection type enumerated values.
Definition: types.hpp:5044
CollectionIterator< CollectionElement< T > > iterator
Common iterator declaration.
Definition: types.hpp:5226
STL compliant Collection Random iterator class.
Definition: types.hpp:4966
Encapsulate a Resultset column or object member properties.
Definition: types.hpp:6864
PropertyFlagsValues
Column properties flags values.
Definition: types.hpp:6876
core::Flags< PropertyFlagsValues > PropertyFlags
Column properties flags.
Definition: types.hpp:6902
A connection or session with a specific database.
Definition: types.hpp:1577
FailoverEventValues
Failover events enumerated values.
Definition: types.hpp:1663
core::Enum< SessionTraceValues > SessionTrace
Session traces.
Definition: types.hpp:1731
core::Enum< FailoverResultValues > FailoverResult
Failover callback results.
Definition: types.hpp:1705
core::Enum< TimeoutTypeValues > TimeoutType
Timeout Types.
Definition: types.hpp:1633
FailoverRequestValues
Failover request enumerated values.
Definition: types.hpp:1641
core::Enum< FailoverRequestValues > FailoverRequest
Failover requests.
Definition: types.hpp:1655
SessionTraceValues
Session trace enumerated values.
Definition: types.hpp:1713
core::Enum< FailoverEventValues > FailoverEvent
Failover events.
Definition: types.hpp:1683
FailoverResultValues
Failover callback results enumerated values.
Definition: types.hpp:1691
TimeoutTypeValues
Timeout enumerated values.
Definition: types.hpp:1608
Object identifying the SQL data type DATE.
Definition: types.hpp:2675
Dequeue object for dequeuing messages into an Oracle Queue.
Definition: types.hpp:7935
DequeueVisibilityValues
Message visibility enumerated values.
Definition: types.hpp:7981
core::Enum< DequeueVisibilityValues > DequeueVisibility
Message visibility after begin dequeued.
Definition: types.hpp:7995
NavigationModeValues
Navigation Mode enumerated values.
Definition: types.hpp:8003
DequeueModeValues
Dequeue mode enumerated values.
Definition: types.hpp:7955
core::Enum< DequeueModeValues > DequeueMode
Dequeue mode.
Definition: types.hpp:7973
core::Enum< NavigationModeValues > NavigationMode
Navigation Mode.
Definition: types.hpp:8020
Oracle Direct path loading encapsulation.
Definition: types.hpp:8614
ResultValues
Direct Operation Result enumerated values.
Definition: types.hpp:8645
core::Enum< ConversionModeValues > ConversionMode
Conversion Mode.
Definition: types.hpp:8637
core::Enum< ResultValues > Result
Direct Operation Result.
Definition: types.hpp:8665
ConversionModeValues
Conversion mode enumerated values.
Definition: types.hpp:8623
Enqueue object for queuing messages into an Oracle Queue.
Definition: types.hpp:7768
EnqueueModeValues
Message enqueuing mode enumerated values.
Definition: types.hpp:7777
core::Enum< EnqueueModeValues > EnqueueMode
Message enqueuing mode.
Definition: types.hpp:7791
EnqueueVisibilityValues
Message visibility enumerated values.
Definition: types.hpp:7799
core::Enum< EnqueueVisibilityValues > EnqueueVisibility
Message visibility after begin queued.
Definition: types.hpp:7813
Static class in charge of library initialization / cleanup.
Definition: types.hpp:490
core::Flags< ShutdownModeValues > ShutdownMode
Oracle instance shutdown modes.
Definition: types.hpp:749
CharsetModeValues
Charset mode enumerated values.
Definition: types.hpp:621
StartModeValues
Oracle instance start modes enumerated values.
Definition: types.hpp:681
ImportModeValues
OCI libraries import mode enumerated values.
Definition: types.hpp:599
HAEventTypeValues
HA Event types enumerated values.
Definition: types.hpp:553
StartFlagsValues
Oracle instance start flags enumerated values.
Definition: types.hpp:707
ShutdownFlagsValues
Oracle instance shutdown flags enumerated values.
Definition: types.hpp:757
core::Enum< CharsetModeValues > CharsetMode
Environment charset mode.
Definition: types.hpp:635
core::Enum< ImportModeValues > ImportMode
OCI libraries import mode.
Definition: types.hpp:613
core::Flags< ShutdownFlagsValues > ShutdownFlags
Oracle instance shutdown flags.
Definition: types.hpp:786
core::Flags< StartFlagsValues > StartFlags
Oracle instance start flags.
Definition: types.hpp:723
HAEventSourceValues
HA Event sources enumerated values.
Definition: types.hpp:521
EnvironmentFlagsValues
Environment Flags enumerated values.
Definition: types.hpp:575
core::Enum< HAEventTypeValues > HAEventType
Type of HA events.
Definition: types.hpp:567
AllocatedBytesValues
Allocated Bytes enumerated values.
Definition: types.hpp:794
core::Flags< AllocatedBytesValues > AllocatedBytesFlags
Allocated Bytes.
Definition: types.hpp:810
SessionFlagsValues
Session flags enumerated values.
Definition: types.hpp:643
core::Flags< StartModeValues > StartMode
Oracle instance start modes.
Definition: types.hpp:699
core::Enum< HAEventSourceValues > HAEventSource
Source of HA events.
Definition: types.hpp:545
core::Flags< SessionFlagsValues > SessionFlags
Sessions flags.
Definition: types.hpp:673
ShutdownModeValues
Oracle instance shutdown modes enumerated values.
Definition: types.hpp:731
core::Flags< EnvironmentFlagsValues > EnvironmentFlags
Environment Flags.
Definition: types.hpp:591
Subscription Event.
Definition: types.hpp:7202
ObjectEventValues
Object events enumerated values.
Definition: types.hpp:7244
core::Enum< ObjectEventValues > ObjectEvent
Object events.
Definition: types.hpp:7266
core::Enum< EventTypeValues > EventType
Event type.
Definition: types.hpp:7236
EventTypeValues
Event type enumerated values.
Definition: types.hpp:7214
Exception class handling all OCILIB errors.
Definition: types.hpp:358
ExceptionTypeValues
Exception type enumerated values.
Definition: types.hpp:371
core::Enum< ExceptionTypeValues > ExceptionType
Type of Exception.
Definition: types.hpp:387
ostring GetMessage() const
Retrieve the error message.
Definition: Exception.hpp:154
const char * what() const noexcept override
Override the std::exception::what() method.
Definition: Exception.hpp:149
int GetOracleErrorCode() const
Return the Oracle error code.
Definition: Exception.hpp:205
unsigned int GetRow() const
Return the row index which caused an error during statement execution.
Definition: Exception.hpp:225
ExceptionType GetType() const
Return the Exception type.
Definition: Exception.hpp:200
Connection GetConnection() const
Return the connection within the error occurred.
Definition: Exception.hpp:220
int GetInternalErrorCode() const
Return the OCILIB error code.
Definition: Exception.hpp:210
Statement GetStatement() const
Return the statement within the error occurred.
Definition: Exception.hpp:215
Object identifying the SQL data type BFILE.
Definition: types.hpp:4339
Object identifying the SQL data type INTERVAL.
Definition: types.hpp:3111
IntervalTypeValues
Interval types enumerated values.
Definition: types.hpp:3128
core::Enum< IntervalTypeValues > IntervalType
Interval types.
Definition: types.hpp:3142
Object identifying the SQL data type LOB (CLOB, NCLOB and BLOB)
Definition: types.hpp:4017
T Read(unsigned int length)
Read a portion of a lob.
Object identifying the SQL data type LONG.
Definition: types.hpp:5295
T GetContent() const
Return the string read from a fetch sequence.
AQ message.
Definition: types.hpp:7419
MessageStateValues
Message state enumerated values.
Definition: types.hpp:7430
void SetPayload(const T &value)
Set the object payload of the message.
core::Enum< MessageStateValues > MessageState
Message state.
Definition: types.hpp:7448
T GetPayload()
Get the object payload of the message.
Static class allowing managing mutexes.
Definition: types.hpp:1241
Object identifying the SQL data type NUMBER.
Definition: types.hpp:2497
Object identifying the SQL data type OBJECT.
Definition: types.hpp:4665
core::Enum< ObjectTypeValues > ObjectType
Object Type.
Definition: types.hpp:4698
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:4682
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:1349
PoolTypeValues
Pool type enumerated values.
Definition: types.hpp:1358
core::Enum< PoolTypeValues > PoolType
Type of Pool.
Definition: types.hpp:1372
Class allowing the administration of Oracle Queues.
Definition: types.hpp:8285
QueueTypeValues
Queue Type enumerated values.
Definition: types.hpp:8294
core::Enum< QueueTypeValues > QueueType
Queue Type.
Definition: types.hpp:8310
Class allowing the administration of Oracle Queue tables.
Definition: types.hpp:8427
GroupingModeValues
Grouping mode enumerated values.
Definition: types.hpp:8437
PurgeModeValues
Purge mode enumerated values.
Definition: types.hpp:8461
core::Enum< GroupingModeValues > GroupingMode
Grouping Mode.
Definition: types.hpp:8452
core::Enum< PurgeModeValues > PurgeMode
Purge mode.
Definition: types.hpp:8477
Object identifying the SQL data type REF.
Definition: types.hpp:4845
Database resultset.
Definition: types.hpp:6505
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:6515
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:6529
Object used for executing SQL or PL/SQL statement and returning the produced results.
Definition: types.hpp:5556
LongModeValues
LONG data type mapping modes enumerated values.
Definition: types.hpp:5656
StatementTypeValues
Statement Type enumerated values.
Definition: types.hpp:5572
core::Enum< BindModeValues > BindMode
Bind Modes.
Definition: types.hpp:5648
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:5634
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:5612
core::Enum< FetchModeValues > FetchMode
Fetch Modes.
Definition: types.hpp:5626
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:5670
core::Enum< StatementTypeValues > StatementType
Statement Type.
Definition: types.hpp:5604
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:7068
core::Flags< ChangeTypesValues > ChangeTypes
Subscription changes flags.
Definition: types.hpp:7106
ChangeTypesValues
Subscription changes flags values.
Definition: types.hpp:7088
static class allowing to manipulate threads
Definition: types.hpp:1168
POCI_THREAD ThreadProc
Thread callback.
Definition: types.hpp:1177
Static class allowing to set/get thread local storage (TLS) values for a given unique key.
Definition: types.hpp:1293
POCI_THREADKEYDEST ThreadKeyFreeProc
Thread Key callback for freeing resources.
Definition: types.hpp:1302
Object identifying the SQL data type TIMESTAMP.
Definition: types.hpp:3510
core::Enum< TimestampTypeValues > TimestampType
Type of timestamp.
Definition: types.hpp:3544
TimestampTypeValues
Interval types enumerated values.
Definition: types.hpp:3528
Oracle Transaction object.
Definition: types.hpp:2378
core::Flags< TransactionFlagsValues > TransactionFlags
Transaction flags.
Definition: types.hpp:2412
TransactionFlagsValues
Transaction flags enumerated values.
Definition: types.hpp:2389
Provides type information on Oracle Database objects.
Definition: types.hpp:4528
TypeInfoTypeValues
Type of object information enumerated values.
Definition: types.hpp:4542
core::Enum< TypeInfoTypeValues > TypeInfoType
Type of object information.
Definition: types.hpp:4558
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:369
Internal usage. Interface for handling ownership and relationship of a C API handle.
Definition: core.hpp:325
Abstract class allowing derived classes to be compatible with any type supporting the operator << oci...
Definition: core.hpp:454
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_Dequeue OCI_Dequeue
OCILIB encapsulation of A/Q dequeuing operations.
Definition: types.h:470
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:509
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:390
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:450
struct OCI_Number OCI_Number
Oracle NUMBER representation.
Definition: types.h:269
struct OCI_TypeInfo OCI_TypeInfo
Type info metadata handle.
Definition: types.h:366
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:525
struct OCI_Event OCI_Event
OCILIB encapsulation of Oracle DCN event.
Definition: types.h:440
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:430
struct OCI_Agent OCI_Agent
OCILIB encapsulation of A/Q Agent.
Definition: types.h:460
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:132
@ NumericDouble
Definition: types.hpp:146
@ NumericInt
Definition: types.hpp:136
@ NumericUnsignedBigInt
Definition: types.hpp:144
@ NumericUnsignedShort
Definition: types.hpp:140
@ NumericBigInt
Definition: types.hpp:138
@ NumericNumber
Definition: types.hpp:150
@ NumericFloat
Definition: types.hpp:148
@ NumericUnsignedInt
Definition: types.hpp:142
@ NumericShort
Definition: types.hpp:134
core::Enum< OpenModeValues > OpenMode
Open Modes.
Definition: types.hpp:273
Long< Raw, LongBinary > Blong
Class handling LONG RAW oracle type.
Definition: types.hpp:5369
core::Enum< NumericTypeValues > NumericType
Numeric data type.
Definition: types.hpp:160
Lob< ostring, LobNationalCharacter > NClob
Class handling NCLOB oracle type.
Definition: types.hpp:4317
LongTypeValues
Long types enumerated values.
Definition: types.hpp:305
const void * ThreadId
Thread Unique ID.
Definition: config.hpp:165
CharsetFormValues
Charset form enumerated values.
Definition: types.hpp:168
@ CharsetFormDefault
Definition: types.hpp:170
@ CharsetFormNational
Definition: types.hpp:172
OpenModeValues
Open Modes enumerated values.
Definition: types.hpp:259
@ ReadWrite
Definition: types.hpp:263
@ ReadOnly
Definition: types.hpp:261
CollationIDValues
Collation ID enumerated values.
Definition: types.hpp:190
@ CollationIDBinaryAI
Definition: types.hpp:216
@ CollationIDNlsSortAI
Definition: types.hpp:200
@ CollationIDNlsSortVar1
Definition: types.hpp:204
@ CollationIDNlsSortCI
Definition: types.hpp:198
@ CollationIDNlsSortVar1CI
Definition: types.hpp:206
@ CollationIDNlsSortVar1AI
Definition: types.hpp:208
@ CollationIDBinaryCI
Definition: types.hpp:214
@ CollationIDNone
Definition: types.hpp:192
@ CollationIDNlsSort
Definition: types.hpp:196
@ CollationIDNlsSortCS
Definition: types.hpp:202
@ CollationIDBinary
Definition: types.hpp:212
@ CollationIDNlsSortVar1CS
Definition: types.hpp:210
@ CollationIDNlsComp
Definition: types.hpp:194
SeekModeValues
Seek Modes enumerated values.
Definition: types.hpp:235
@ SeekOffset
Definition: types.hpp:241
@ SeekSet
Definition: types.hpp:237
@ SeekEnd
Definition: types.hpp:239
core::Enum< CollationIDValues > CollationID
Type of Collation ID.
Definition: types.hpp:226
Lob< ostring, LobCharacter > Clob
Class handling CLOB oracle type.
Definition: types.hpp:4306
core::Enum< LobTypeValues > LobType
Type of Lob.
Definition: types.hpp:297
core::Enum< SeekModeValues > SeekMode
Seek Modes.
Definition: types.hpp:251
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:319
OCI_Mutex * MutexHandle
Alias for an OCI_Mutex pointer.
Definition: config.hpp:147
FormatTypeValues
Format type enumerated values.
Definition: types.hpp:327
@ FormatBinaryDouble
Definition: types.hpp:335
@ FormatBinaryFloat
Definition: types.hpp:337
@ FormatDate
Definition: types.hpp:329
@ FormatTimestamp
Definition: types.hpp:331
@ FormatNumeric
Definition: types.hpp:333
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
@ 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:281
core::Enum< FormatTypeValues > FormatType
Format type.
Definition: types.hpp:347
Long< ostring, LongCharacter > Clong
Class handling LONG oracle type.
Definition: types.hpp:5358
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.
Definition: types.hpp:4328
OCI_Thread * ThreadHandle
Alias for an OCI_Thread pointer.
Definition: config.hpp:156
core::Enum< CharsetFormValues > CharsetForm
Type of charsetForm.
Definition: types.hpp:182
core::Enum< DataTypeValues > DataType
Column data type.
Definition: types.hpp:124
core::Enum< OracleVersionValues > OracleVersion
Oracle Version.
Definition: types.hpp:78