OCILIB (C and C++ Driver for Oracle)  4.7.3
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
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-2021 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 
38 namespace ocilib
39 {
40 
47  {
48  Oracle80 = OCI_8_0,
49  Oracle8i = OCI_8_1,
50  Oracle9iR1 = OCI_9_0,
51  Oracle9iR2 = OCI_9_2,
52  Oracle10gR1 = OCI_10_1,
53  Oracle10gR2 = OCI_10_2,
54  Oracle11gR1 = OCI_11_1,
55  Oracle11gR2 = OCI_11_2,
56  Oracle12cR1 = OCI_12_1,
57  Oracle12cR2 = OCI_12_2,
58  Oracle18cR1 = OCI_18_1,
59  Oracle18cR2 = OCI_18_2,
60  Oracle18cR3 = OCI_18_3,
61  Oracle18cR4 = OCI_18_4
62  };
63 
72 
79  {
81  TypeNumeric = OCI_CDT_NUMERIC,
83  TypeDate = OCI_CDT_DATETIME,
85  TypeString = OCI_CDT_TEXT,
87  TypeLong = OCI_CDT_LONG,
89  TypeStatement = OCI_CDT_CURSOR,
91  TypeLob = OCI_CDT_LOB,
93  TypeFile = OCI_CDT_FILE,
95  TypeTimestamp = OCI_CDT_TIMESTAMP,
97  TypeInterval = OCI_CDT_INTERVAL,
99  TypeRaw = OCI_CDT_RAW,
101  TypeObject = OCI_CDT_OBJECT,
103  TypeCollection = OCI_CDT_COLLECTION,
105  TypeReference = OCI_CDT_REF,
107  TypeBoolean = OCI_CDT_BOOLEAN
108  };
109 
118 
125  {
127  NumericShort = OCI_NUM_SHORT,
129  NumericInt = OCI_NUM_INT,
131  NumericBigInt = OCI_NUM_BIGINT,
133  NumericUnsignedShort = OCI_NUM_USHORT,
135  NumericUnsignedInt = OCI_NUM_UINT,
137  NumericUnsignedBigInt = OCI_NUM_BIGUINT,
139  NumericDouble = OCI_NUM_DOUBLE,
141  NumericFloat = OCI_NUM_FLOAT,
143  NumericNumber = OCI_NUM_NUMBER
144  };
145 
154 
161  {
163  CharsetFormDefault = OCI_CSF_DEFAULT,
165  CharsetFormNational = OCI_CSF_NATIONAL
166  };
167 
176 
183  {
185  CollationIDNone = OCI_CCI_NONE,
187  CollationIDNlsComp = OCI_CCI_NLS_COMP,
189  CollationIDNlsSort = OCI_CCI_NLS_SORT,
191  CollationIDNlsSortCI = OCI_CCI_NLS_SORT_CI,
193  CollationIDNlsSortAI = OCI_CCI_NLS_SORT_AI,
195  CollationIDNlsSortCS = OCI_CCI_NLS_SORT_CS,
197  CollationIDNlsSortVar1 = OCI_CCI_NLS_SORT_VAR1,
199  CollationIDNlsSortVar1CI = OCI_CCI_NLS_SORT_VAR1_CI,
201  CollationIDNlsSortVar1AI = OCI_CCI_NLS_SORT_VAR1_AI,
203  CollationIDNlsSortVar1CS = OCI_CCI_NLS_SORT_VAR1_CS,
205  CollationIDBinary = OCI_CCI_BINARY,
207  CollationIDBinaryCI = OCI_CCI_BINARY_CI,
209  CollationIDBinaryAI = OCI_CCI_BINARY_AI
210  };
211 
220 
221 
228  {
230  SeekSet = OCI_SEEK_SET,
232  SeekEnd = OCI_SEEK_END,
234  SeekOffset = OCI_SEEK_CUR
235  };
236 
245 
252  {
254  ReadOnly = OCI_LOB_READONLY,
256  ReadWrite = OCI_LOB_READWRITE
257  };
258 
267 
274  {
276  LobBinary = OCI_BLOB,
278  LobCharacter = OCI_CLOB,
280  LobNationalCharacter = OCI_NCLOB
281  };
282 
291 
298  {
300  LongBinary = OCI_BLONG,
302  LongCharacter = OCI_CLONG
303  };
304 
313 
320  {
322  FormatDate = OCI_FMT_DATE,
324  FormatTimestamp = OCI_FMT_TIMESTAMP,
326  FormatNumeric = OCI_FMT_NUMERIC,
328  FormatBinaryDouble = OCI_FMT_BINARY_DOUBLE,
330  FormatBinaryFloat = OCI_FMT_BINARY_FLOAT
331  };
332 
341 
350  class Exception : public std::exception
351  {
352  template<class T>
353  friend T core::Check(T result);
354  friend class Statement;
355 
356  public:
357 
364  {
366  OracleError = OCI_ERR_ORACLE,
368  OcilibError = OCI_ERR_OCILIB,
370  OracleWarning = OCI_ERR_WARNING
371  };
372 
381 
387  ostring GetMessage() const;
388 
395  ExceptionType GetType() const;
396 
402  int GetOracleErrorCode() const;
403 
409  int GetInternalErrorCode() const;
410 
416  Statement GetStatement() const;
417 
423  Connection GetConnection() const;
424 
437  unsigned int GetRow() const;
438 
447  const char* what() const noexcept override;
448 
449  Exception(const Exception& other) noexcept;
450 
451  Exception& operator = (const Exception& other) noexcept;
452 
458  virtual ~Exception() noexcept;
459 
460  private:
461 
462  Exception() noexcept;
463  Exception(OCI_Error* err) noexcept;
464 
465  void SetWhat(const otext* value) noexcept;
466  void CopyWhat(const char* value) noexcept;
467 
468  char* _what;
469  OCI_Statement* _pStatement;
470  OCI_Connection* _pConnnection;
471  unsigned int _row;
472  ExceptionType _type;
473  int _errLib;
474  int _errOracle;
475  };
476 
483  {
484  friend class Mutex;
485  friend class Connection;
486  friend class Pool;
487  friend class Subscription;
488  friend class Dequeue;
489  template<class>
490  friend class core::HandleHolder;
491 
492  public:
493 
500  {
502  SourceInstance = OCI_HES_INSTANCE,
504  SourceDatabase = OCI_HES_DATABASE,
506  SourceNode = OCI_HES_NODE,
508  SourceService = OCI_HES_SERVICE,
510  SourceServiceMember = OCI_HES_SERVICE_MEMBER,
512  SourceASMInstance = OCI_HES_ASM_INSTANCE,
514  SourcePreConnect = OCI_HES_PRECONNECT
515  };
516 
525 
532  {
534  EventDown = OCI_HET_DOWN,
536  EventUp = OCI_HET_UP
537  };
538 
547 
554  {
556  Default = OCI_ENV_DEFAULT,
558  Threaded = OCI_ENV_THREADED,
560  Events = OCI_ENV_EVENTS
561  };
562 
571 
578  {
580  ImportLinkage = OCI_IMPORT_MODE_LINKAGE,
582  ImportRuntime = OCI_IMPORT_MODE_RUNTIME
583  };
584 
593 
600  {
602  CharsetAnsi = OCI_CHAR_ANSI,
604  CharsetWide = OCI_CHAR_WIDE
605  };
606 
615 
622  {
624  SessionDefault = OCI_SESSION_DEFAULT,
626  SessionXa = OCI_SESSION_XA,
628  SessionSysDba = OCI_SESSION_SYSDBA,
630  SessionSysOper = OCI_SESSION_SYSOPER,
632  SessionSysAsm = OCI_SESSION_SYSASM,
634  SessionSysBkp = OCI_SESSION_SYSBKP,
636  SessionSysDgD = OCI_SESSION_SYSDGD,
638  SessionSysKmt = OCI_SESSION_SYSKMT,
640  SessionSysRac = OCI_SESSION_SYSRAC,
642  SessionPreAuth = OCI_SESSION_PRELIM_AUTH
643  };
644 
653 
660  {
662  StartOnly = OCI_DB_SPM_START,
664  StartMount = OCI_DB_SPM_MOUNT,
666  StartOpen = OCI_DB_SPM_OPEN,
668  StartFull = OCI_DB_SPM_FULL
669  };
670 
679 
686  {
688  StartDefault = OCI_DB_SPF_DEFAULT,
690  StartForce = OCI_DB_SPF_FORCE,
692  StartRestrict = OCI_DB_SPF_RESTRICT
693  };
694 
703 
710  {
712  ShutdownOnly = OCI_DB_SDM_SHUTDOWN,
714  ShutdownClose = OCI_DB_SDM_CLOSE,
716  ShutdownDismount = OCI_DB_SDM_DISMOUNT,
718  ShutdownFull = OCI_DB_SDM_FULL
719  };
720 
729 
736  {
739  ShutdowntDefault = OCI_DB_SDF_DEFAULT,
742  ShutdowTrans = OCI_DB_SDF_TRANS,
746  ShutdownTransLocal = OCI_DB_SDF_TRANS_LOCAL,
749  ShutdownImmediate = OCI_DB_SDF_IMMEDIATE,
755  ShutdownAbort = OCI_DB_SDF_ABORT
756  };
757 
766 
773  {
775  OracleClientBytes = OCI_MEM_ORACLE,
777  OcilibBytes = OCI_MEM_OCILIB,
779  AllBytes = OCI_MEM_ALL
780  };
781 
790 
798  typedef void(*HAHandlerProc) (Connection& con, HAEventSource eventSource, HAEventType eventType, Timestamp& time);
799 
819  static void Initialize(EnvironmentFlags mode = Environment::Default, const ostring& libpath = OTEXT(""));
820 
835  static void Cleanup();
836 
845  static Environment::EnvironmentFlags GetMode();
846 
852  static Environment::ImportMode GetImportMode();
853 
859  static Environment::CharsetMode GetCharset();
860 
870  static unsigned int GetCharMaxSize();
871 
879  static big_uint GetAllocatedBytes(AllocatedBytesFlags type);
880 
886  static bool Initialized();
887 
898  static OracleVersion GetCompileVersion();
899 
905  static unsigned int GetCompileMajorVersion();
906 
912  static unsigned int GetCompileMinorVersion();
913 
919  static unsigned int GetCompileRevisionVersion();
920 
930  static OracleVersion GetRuntimeVersion();
931 
937  static unsigned int GetRuntimeMajorVersion();
938 
944  static unsigned int GetRuntimeMinorVersion();
945 
951  static unsigned int GetRuntimeRevisionVersion();
952 
963  static void EnableWarnings(bool value);
964 
996  static bool SetFormat(FormatType formatType, const ostring& format);
997 
1008  static ostring GetFormat(FormatType formatType);
1009 
1036  static void StartDatabase(const ostring& db, const ostring& user, const ostring& pwd,
1037  Environment::StartFlags startFlags,
1038  Environment::StartMode startMode,
1039  Environment::SessionFlags sessionFlags = SessionSysDba,
1040  const ostring& spfile = OTEXT(""));
1041 
1067  static void ShutdownDatabase(const ostring& db, const ostring& user, const ostring& pwd,
1068  Environment::ShutdownFlags shutdownFlags,
1069  Environment::ShutdownMode shutdownMode,
1070  Environment::SessionFlags sessionFlags = SessionSysDba);
1071 
1082  static void ChangeUserPassword(const ostring& db, const ostring& user, const ostring& pwd, const ostring& newPwd);
1083 
1100  static void SetHAHandler(HAHandlerProc handler);
1101 
1102  private:
1103 
1104  class EnvironmentHandle : core::HandleHolder<AnyPointer>
1105  {
1106  friend class Environment;
1107  };
1108 
1109  static void HAHandler(OCI_Connection* pConnection, unsigned int source, unsigned int event, OCI_Timestamp* pTimestamp);
1110  static unsigned int TAFHandler(OCI_Connection* pConnection, unsigned int type, unsigned int event);
1111  static void NotifyHandler(OCI_Event* pEvent);
1112  static void NotifyHandlerAQ(OCI_Dequeue* pDequeue);
1113 
1114  template<class T>
1115  static T GetUserCallback(AnyPointer ptr);
1116 
1117  template<class T>
1118  static void SetUserCallback(AnyPointer ptr, T callback);
1119 
1120  template<class T>
1121  static void SetSmartHandle(AnyPointer ptr, T handle);
1122 
1123  template<class T>
1124  static T GetSmartHandle(AnyPointer ptr);
1125 
1126  static core::Handle* GetEnvironmentHandle();
1127 
1128  static Environment& GetInstance();
1129 
1130  Environment();
1131 
1132  void SelfInitialize(EnvironmentFlags mode, const ostring& libpath);
1133  void SelfCleanup();
1134 
1135  core::Locker _locker;
1138  EnvironmentHandle _handle;
1139  EnvironmentFlags _mode;
1140  unsigned int _charMaxSize;
1141  bool _initialized;
1142  };
1143 
1154  class Thread
1155  {
1156  public:
1157 
1165 
1174  static ThreadHandle Create();
1175 
1183  static void Destroy(ThreadHandle handle);
1184 
1194  static void Run(ThreadHandle handle, ThreadProc func, AnyPointer arg);
1195 
1206  static void Join(ThreadHandle handle);
1207 
1215  static ThreadId GetThreadId(ThreadHandle handle);
1216  };
1217 
1227  class Mutex
1228  {
1229  public:
1230 
1239  static MutexHandle Create();
1240 
1248  static void Destroy(MutexHandle handle);
1249 
1257  static void Acquire(MutexHandle handle);
1258 
1266  static void Release(MutexHandle handle);
1267  };
1268 
1280  {
1281  public:
1282 
1290 
1303  static void Create(const ostring& name, ThreadKeyFreeProc freeProc = nullptr);
1304 
1313  static void SetValue(const ostring& name, AnyPointer value);
1314 
1325  static AnyPointer GetValue(const ostring& name);
1326  };
1327 
1335  class Pool : public core::HandleHolder<OCI_Pool*>
1336  {
1337  public:
1338 
1345  {
1347  ConnectionPool = OCI_POOL_CONNECTION,
1349  SessionPool = OCI_POOL_SESSION
1350  };
1351 
1360 
1366  Pool();
1367 
1385  Pool(const ostring& db, const ostring& user, const ostring& pwd, Pool::PoolType poolType,
1386  unsigned int minSize, unsigned int maxSize, unsigned int increment = 1,
1388 
1407  void Open(const ostring& db, const ostring& user, const ostring& pwd, Pool::PoolType poolType,
1408  unsigned int minSize, unsigned int maxSize, unsigned int increment = 1,
1410 
1416  void Close();
1417 
1446  Connection GetConnection(const ostring& sessionTag = OTEXT(""));
1447 
1459  unsigned int GetTimeout() const;
1460 
1474  void SetTimeout(unsigned int value);
1475 
1485  bool GetNoWait() const;
1486 
1499  void SetNoWait(bool value);
1500 
1506  unsigned int GetBusyConnectionsCount() const;
1507 
1513  unsigned int GetOpenedConnectionsCount() const;
1514 
1520  unsigned int GetMinSize() const;
1521 
1527  unsigned int GetMaxSize() const;
1528 
1534  unsigned int GetIncrement() const;
1535 
1544  unsigned int GetStatementCacheSize() const;
1545 
1553  void SetStatementCacheSize(unsigned int value);
1554  };
1555 
1563  class Connection : public core::HandleHolder<OCI_Connection*>
1564  {
1565  friend class Environment;
1566  friend class Exception;
1567  friend class Statement;
1568  friend class File;
1569  friend class Timestamp;
1570  friend class Pool;
1571  friend class Object;
1572  friend class TypeInfo;
1573  friend class Reference;
1574  friend class Resultset;
1575  friend class Subscription;
1576 
1577  template<class, int>
1578  friend class Lob;
1579  template<class>
1580  friend class Collection;
1581  public:
1582 
1589  {
1594  TimeoutSend = OCI_NTO_SEND,
1599  TimeoutReceive = OCI_NTO_RECEIVE,
1604  TimeoutCall = OCI_NTO_CALL
1605  };
1606 
1615 
1622  {
1624  FailoverRequestSession = OCI_FOT_SESSION,
1626  FailoverRequestSelect = OCI_FOT_SELECT
1627  };
1628 
1637 
1644  {
1646  FailoverEventEnd = OCI_FOE_END,
1648  FailoverEventAbort = OCI_FOE_ABORT,
1650  FailoverEventReauthentificate = OCI_FOE_REAUTH,
1652  FailoverEventBegin = OCI_FOE_BEGIN,
1654  FailoverEventError = OCI_FOE_ERROR
1655  };
1656 
1665 
1672  {
1674  FailoverOk = OCI_FOC_OK,
1676  FailoverRetry = OCI_FOC_RETRY
1677  };
1678 
1687 
1694  {
1696  TraceIdentity = OCI_TRC_IDENTITY,
1698  TraceModule = OCI_TRC_MODULE,
1700  TraceAction = OCI_TRC_ACTION,
1702  TraceDetail = OCI_TRC_DETAIL
1703  };
1704 
1713 
1721  typedef FailoverResult(*TAFHandlerProc) (Connection& con, FailoverRequest failoverRequest, FailoverEvent failoverEvent);
1722 
1728  Connection();
1729 
1743  Connection(const ostring& db, const ostring& user, const ostring& pwd, Environment::SessionFlags sessionFlags = Environment::SessionDefault);
1744 
1787  void Open(const ostring& db, const ostring& user, const ostring& pwd, Environment::SessionFlags sessionFlags = Environment::SessionDefault);
1788 
1794  void Close();
1795 
1801  void Commit();
1802 
1808  void Rollback();
1809 
1818  void Break();
1819 
1827  void SetAutoCommit(bool enabled);
1828 
1834  bool GetAutoCommit() const;
1835 
1844  bool IsServerAlive() const;
1845 
1854  bool PingServer() const;
1855 
1864  ostring GetConnectionString() const;
1865 
1874  ostring GetUserName() const;
1875 
1884  ostring GetPassword() const;
1885 
1894  ostring GetServerVersion() const;
1895 
1904  OracleVersion GetVersion() const;
1905 
1911  unsigned int GetServerMajorVersion() const;
1912 
1918  unsigned int GetServerMinorVersion() const;
1919 
1925  unsigned int GetServerRevisionVersion() const;
1926 
1934  void ChangePassword(const ostring& newPwd);
1935 
1941  ostring GetSessionTag() const;
1942 
1957  void SetSessionTag(const ostring& tag);
1958 
1964  Transaction GetTransaction() const;
1965 
1979  void SetTransaction(const Transaction& transaction);
1980 
2012  bool SetFormat(FormatType formatType, const ostring& format);
2013 
2024  ostring GetFormat(FormatType formatType);
2025 
2045  void EnableServerOutput(unsigned int bufsize, unsigned int arrsize, unsigned int lnsize);
2046 
2055  void DisableServerOutput();
2056 
2065  bool GetServerOutput(ostring& line) const;
2066 
2072  void GetServerOutput(std::vector<ostring>& lines) const;
2073 
2102  void SetTrace(SessionTrace trace, const ostring& value);
2103 
2114  ostring GetTrace(SessionTrace trace) const;
2115 
2124  ostring GetDatabase() const;
2125 
2134  ostring GetInstance() const;
2135 
2144  ostring GetService() const;
2145 
2154  ostring GetServer() const;
2155 
2164  ostring GetDomain() const;
2165 
2174  Timestamp GetInstanceStartTime() const;
2175 
2187  unsigned int GetStatementCacheSize() const;
2188 
2199  void SetStatementCacheSize(unsigned int value);
2200 
2217  unsigned int GetDefaultLobPrefetchSize() const;
2218 
2243  void SetDefaultLobPrefetchSize(unsigned int value);
2244 
2259  unsigned int GetMaxCursors() const;
2260 
2269  bool IsTAFCapable() const;
2270 
2284  void SetTAFHandler(TAFHandlerProc handler);
2285 
2291  AnyPointer GetUserData();
2292 
2300  void SetUserData(AnyPointer value);
2301 
2315  unsigned int GetTimeout(TimeoutType timeout);
2316 
2344  void SetTimeout(TimeoutType timeout, unsigned int value);
2345 
2346  private:
2347 
2348  Connection(OCI_Connection* con, core::Handle* parent);
2349  };
2350 
2358  class Transaction : public core::HandleHolder<OCI_Transaction*>
2359  {
2360  friend class Connection;
2361 
2362  public:
2363 
2370  {
2371  Unknown = OCI_UNKNOWN,
2373  New = OCI_TRS_NEW,
2375  Tight = OCI_TRS_TIGHT,
2377  Loose = OCI_TRS_LOOSE,
2379  ReadOnly = OCI_TRS_READONLY,
2381  ReadWrite = OCI_TRS_READWRITE,
2383  Serializable = OCI_TRS_SERIALIZABLE
2384  };
2385 
2394 
2408  Transaction(const Connection& connection, unsigned int timeout, TransactionFlags flags, OCI_XID* pxid = nullptr);
2409 
2415  void Prepare();
2416 
2422  void Start();
2423 
2429  void Stop();
2430 
2436  void Resume();
2437 
2443  void Forget();
2444 
2453  TransactionFlags GetFlags() const;
2454 
2460  unsigned int GetTimeout() const;
2461 
2462  private:
2463 
2464  Transaction(OCI_Transaction* trans);
2465  };
2466 
2477  class Number : public core::HandleHolder<OCI_Number*>, public core::Streamable
2478  {
2479  friend class Statement;
2480  friend class Resultset;
2481  friend class support::BindArray;
2482  friend class Object;
2483  template<class>
2484  friend class Collection;
2485 
2486  public:
2487 
2495  Number(bool create = false);
2496 
2511  Number(const otext* str, const otext* format = OTEXT(""));
2512 
2527  Number(const ostring& str, const ostring& format = OTEXT(""));
2528 
2543  void FromString(const ostring& str, const ostring& format = OTEXT("")) const;
2544 
2555  ostring ToString(const ostring& format) const;
2556 
2565  ostring ToString() const override;
2566 
2572  Number Clone() const;
2573 
2574  Number& operator ++ ();
2575  Number& operator -- ();
2576  Number operator ++ (int);
2577  Number operator -- (int);
2578 
2579  bool operator == (const Number& other) const;
2580  bool operator != (const Number& other) const;
2581  bool operator > (const Number& other) const;
2582  bool operator < (const Number& other) const;
2583  bool operator >= (const Number& other) const;
2584  bool operator <= (const Number& other) const;
2585 
2586  template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2587  Number& operator = (const T& lhs);
2588 
2589  template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2590  operator T() const;
2591 
2592  template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2593  Number operator - (const T& value);
2594 
2595  template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2596  Number operator + (const T& value);
2597 
2598  template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2599  Number operator * (const T& value);
2600 
2601  template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2602  Number operator / (const T& value);
2603 
2604  template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2605  Number& operator += (const T& value);
2606 
2607  template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2608  Number& operator -= (const T& value);
2609 
2610  template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2611  Number& operator *= (const T& value);
2612 
2613  template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2614  Number& operator /= (const T& value);
2615 
2616  private:
2617 
2618  template<class T>
2619  static AnyPointer GetNativeValue(const T& value);
2620 
2621  Number(OCI_Number* pNumber, core::Handle* parent = nullptr);
2622 
2623  void Allocate();
2624 
2625  int Compare(const Number& other) const;
2626 
2627  template<class T>
2628  inline T GetValue() const;
2629 
2630  template<class T>
2631  Number& SetValue(const T& value);
2632 
2633  template<class T>
2634  void Add(const T& value);
2635 
2636  template<class T>
2637  void Sub(const T& value);
2638 
2639  template<class T>
2640  void Multiply(const T& value);
2641 
2642  template<class T>
2643  void Divide(const T& value);
2644 
2645  Number& operator = (OCI_Number*& lhs);
2646  };
2647 
2655  class Date : public core::HandleHolder<OCI_Date*>, public core::Streamable
2656  {
2657  friend class Statement;
2658  friend class Resultset;
2659  friend class support::BindArray;
2660  friend class Object;
2661  template<class>
2662  friend class Collection;
2663  friend class Message;
2664 
2665  public:
2666 
2672  static Date SysDate();
2673 
2681  Date(bool create = false);
2682 
2697  Date(const otext* str, const otext* format = OTEXT(""));
2698 
2714  Date(const ostring& str, const ostring& format = OTEXT(""));
2715 
2721  bool IsValid() const;
2722 
2728  int GetYear() const;
2729 
2735  void SetYear(int value);
2736 
2742  int GetMonth() const;
2743 
2749  void SetMonth(int value);
2750 
2756  int GetDay() const;
2757 
2763  void SetDay(int value);
2764 
2770  int GetHours() const;
2771 
2777  void SetHours(int value);
2778 
2784  int GetMinutes() const;
2785 
2791  void SetMinutes(int value);
2792 
2798  int GetSeconds() const;
2799 
2805  void SetSeconds(int value);
2806 
2814  int DaysBetween(const Date& other) const;
2815 
2825  void SetDate(int year, int month, int day);
2826 
2836  void SetTime(int hour, int min, int sec);
2837 
2850  void SetDateTime(int year, int month, int day, int hour, int min, int sec);
2851 
2861  void GetDate(int& year, int& month, int& day) const;
2862 
2872  void GetTime(int& hour, int& min, int& sec) const;
2873 
2886  void GetDateTime(int& year, int& month, int& day, int& hour, int& min, int& sec) const;
2887 
2895  void AddDays(int days);
2896 
2904  void AddMonths(int months);
2905 
2913  Date NextDay(const ostring& day) const;
2914 
2920  Date LastDay() const;
2921 
2930  void ChangeTimeZone(const ostring& tzSrc, const ostring& tzDst);
2931 
2946  void FromString(const ostring& str, const ostring& format = OTEXT(""));
2947 
2958  ostring ToString(const ostring& format) const;
2959 
2968  ostring ToString() const override;
2969 
2975  Date Clone() const;
2976 
2982  Date& operator ++ ();
2983 
2989  Date operator ++ (int);
2990 
2996  Date& operator -- ();
2997 
3003  Date operator -- (int);
3004 
3010  Date operator + (int value) const;
3011 
3017  Date operator - (int value) const;
3018 
3024  Date& operator += (int value);
3025 
3031  Date& operator -= (int value);
3032 
3038  bool operator == (const Date& other) const;
3039 
3045  bool operator != (const Date& other) const;
3046 
3052  bool operator > (const Date& other) const;
3053 
3059  bool operator < (const Date& other) const;
3060 
3066  bool operator >= (const Date& other) const;
3067 
3073  bool operator <= (const Date& other) const;
3074 
3075  private:
3076 
3077  int Compare(const Date& other) const;
3078 
3079  Date(OCI_Date* pDate, core::Handle* parent = nullptr);
3080 
3081  void Allocate();
3082  };
3083 
3091  class Interval : public core::HandleHolder<OCI_Interval*>, public core::Streamable
3092  {
3093  friend class Environment;
3094  friend class Statement;
3095  friend class Resultset;
3096  friend class support::BindArray;
3097  friend class Object;
3098  template<class>
3099  friend class Collection;
3100 
3101  public:
3102 
3109  {
3111  YearMonth = OCI_INTERVAL_YM,
3113  DaySecond = OCI_INTERVAL_DS
3114  };
3115 
3124 
3130  Interval();
3131 
3139  Interval(IntervalType type);
3140 
3152  Interval(IntervalType type, const ostring& data);
3153 
3159  IntervalType GetType() const;
3160 
3166  bool IsValid() const;
3167 
3176  int GetYear() const;
3177 
3186  void SetYear(int value);
3187 
3196  int GetMonth() const;
3197 
3206  void SetMonth(int value);
3207 
3216  int GetDay() const;
3217 
3226  void SetDay(int value);
3227 
3236  int GetHours() const;
3237 
3246  void SetHours(int value);
3247 
3256  int GetMinutes() const;
3257 
3266  void SetMinutes(int value);
3267 
3276  int GetSeconds() const;
3277 
3286  void SetSeconds(int value);
3287 
3293  int GetMilliSeconds() const;
3294 
3300  void SetMilliSeconds(int value);
3301 
3316  void GetDaySecond(int& day, int& hour, int& min, int& sec, int& fsec) const;
3317 
3332  void SetDaySecond(int day, int hour, int min, int sec, int fsec);
3333 
3345  void GetYearMonth(int& year, int& month) const;
3346 
3358  void SetYearMonth(int year, int month);
3359 
3367  void UpdateTimeZone(const ostring& timeZone);
3368 
3379  void FromString(const ostring& data);
3380 
3389  ostring ToString(int leadingPrecision, int fractionPrecision) const;
3390 
3396  ostring ToString() const override;
3397 
3403  Interval Clone() const;
3404 
3410  Interval operator + (const Interval& other) const;
3411 
3417  Interval operator - (const Interval& other) const;
3418 
3424  Interval& operator += (const Interval& other);
3425 
3431  Interval& operator -= (const Interval& other);
3432 
3438  bool operator == (const Interval& other) const;
3439 
3445  bool operator != (const Interval& other) const;
3446 
3452  bool operator > (const Interval& other) const;
3453 
3459  bool operator < (const Interval& other) const;
3460 
3466  bool operator >= (const Interval& other) const;
3467 
3473  bool operator <= (const Interval& other) const;
3474 
3475  private:
3476 
3477  int Compare(const Interval& other) const;
3478 
3479  Interval(OCI_Interval* pInterval, core::Handle* parent = nullptr);
3480  };
3481 
3490  class Timestamp : public core::HandleHolder<OCI_Timestamp*>, public core::Streamable
3491  {
3492  friend class Environment;
3493  friend class Statement;
3494  friend class Resultset;
3495  friend class support::BindArray;
3496  friend class Object;
3497  friend class Connection;
3498  template<class>
3499  friend class Collection;
3500 
3501  public:
3502 
3509  {
3511  NoTimeZone = OCI_TIMESTAMP,
3513  WithTimeZone = OCI_TIMESTAMP_TZ,
3515  WithLocalTimeZone = OCI_TIMESTAMP_LTZ
3516  };
3517 
3526 
3534  static Timestamp SysTimestamp(TimestampType type = NoTimeZone);
3535 
3541  Timestamp();
3542 
3550  Timestamp(TimestampType type);
3551 
3564  Timestamp(TimestampType type, const ostring& data, const ostring& format = OTEXT(""));
3565 
3571  TimestampType GetType() const;
3572 
3580  void Convert(const Timestamp& other);
3581 
3587  bool IsValid() const;
3588 
3594  int GetYear() const;
3595 
3601  void SetYear(int value);
3602 
3608  int GetMonth() const;
3609 
3615  void SetMonth(int value);
3616 
3622  int GetDay() const;
3623 
3629  void SetDay(int value);
3630 
3636  int GetHours() const;
3637 
3643  void SetHours(int value);
3644 
3650  int GetMinutes() const;
3651 
3657  void SetMinutes(int value);
3658 
3664  int GetSeconds() const;
3665 
3671  void SetSeconds(int value);
3672 
3678  int GetMilliSeconds() const;
3679 
3685  void SetMilliSeconds(int value);
3686 
3696  void GetDate(int& year, int& month, int& day) const;
3697 
3708  void GetTime(int& hour, int& min, int& sec, int& fsec) const;
3709 
3719  void SetDate(int year, int month, int day);
3720 
3731  void SetTime(int hour, int min, int sec, int fsec);
3732 
3746  void GetDateTime(int& year, int& month, int& day, int& hour, int& min, int& sec, int& fsec) const;
3747 
3762  void SetDateTime(int year, int month, int day, int hour, int min, int sec, int fsec, const ostring& timeZone = OTEXT(""));
3763 
3772  ostring GetTimeZone() const;
3773 
3783  void SetTimeZone(const ostring& timeZone);
3784 
3793  void GetTimeZoneOffset(int& hour, int& min) const;
3794 
3807  static void Substract(const Timestamp& lsh, const Timestamp& rsh, Interval& result);
3808 
3820  void FromString(const ostring& data, const ostring& format = OCI_STRING_FORMAT_DATE);
3821 
3833  ostring ToString(const ostring& format, int precision) const;
3834 
3840  ostring ToString() const override;
3841 
3847  Timestamp Clone() const;
3848 
3854  Timestamp& operator ++ ();
3855 
3861  Timestamp operator ++ (int);
3862 
3868  Timestamp& operator -- ();
3869 
3875  Timestamp operator -- (int);
3876 
3882  Timestamp operator + (int value) const;
3883 
3889  Timestamp operator - (int value) const;
3890 
3896  Interval operator - (const Timestamp& other);
3897 
3903  Timestamp& operator += (int value);
3904 
3910  Timestamp& operator -= (int value);
3911 
3917  Timestamp operator + (const Interval& other) const;
3918 
3924  Timestamp operator - (const Interval& other) const;
3925 
3931  Timestamp& operator += (const Interval& other);
3932 
3938  Timestamp& operator -= (const Interval& other);
3939 
3945  bool operator == (const Timestamp& other) const;
3946 
3952  bool operator != (const Timestamp& other) const;
3953 
3959  bool operator > (const Timestamp& other) const;
3960 
3966  bool operator < (const Timestamp& other) const;
3967 
3973  bool operator >= (const Timestamp& other) const;
3974 
3980  bool operator <= (const Timestamp& other) const;
3981 
3982  private:
3983 
3984  int Compare(const Timestamp& other) const;
3985 
3986  Timestamp(OCI_Timestamp* pTimestamp, core::Handle* parent = nullptr);
3987  };
3988 
3996  template<class T, int U>
3997  class Lob : public core::HandleHolder<OCI_Lob*>
3998  {
3999  friend class Statement;
4000  friend class Resultset;
4001  friend class support::BindArray;
4002  friend class Object;
4003  template<class>
4004  friend class Collection;
4005 
4006  public:
4007 
4013  Lob();
4014 
4025  Lob(const Connection& connection);
4026 
4037  T Read(unsigned int length);
4038 
4049  unsigned int Write(const T& content);
4050 
4061  unsigned int Append(const T& content);
4062 
4070  void Append(const Lob& other);
4071 
4086  bool Seek(SeekMode seekMode, big_uint offset);
4087 
4093  LobType GetType() const;
4094 
4100  big_uint GetOffset() const;
4101 
4107  big_uint GetLength() const;
4108 
4114  big_uint GetMaxSize() const;
4115 
4127  big_uint GetChunkSize() const;
4128 
4134  Connection GetConnection() const;
4135 
4143  void Truncate(big_uint length);
4144 
4160  big_uint Erase(big_uint offset, big_uint length);
4161 
4175  void Copy(Lob& dest, big_uint offset, big_uint offsetDest, big_uint length) const;
4176 
4182  bool IsTemporary() const;
4183 
4189  bool IsRemote() const;
4190 
4203  void Open(OpenMode mode);
4204 
4210  void Flush();
4211 
4220  void Close();
4221 
4240  void EnableBuffering(bool value);
4241 
4247  Lob Clone() const;
4248 
4254  Lob& operator += (const Lob& other);
4255 
4261  bool operator == (const Lob& other) const;
4262 
4268  bool operator != (const Lob& other) const;
4269 
4270  private:
4271 
4272  bool Equals(const Lob& other) const;
4273 
4274  Lob(OCI_Lob* pLob, core::Handle* parent = nullptr);
4275 
4276  };
4277 
4288 
4299 
4310 
4319  class File : public core::HandleHolder<OCI_File*>
4320  {
4321  friend class Statement;
4322  friend class Resultset;
4323  friend class support::BindArray;
4324  friend class Object;
4325  template<class>
4326  friend class Collection;
4327 
4328  public:
4329 
4335  File();
4336 
4347  File(const Connection& connection);
4348 
4363  File(const Connection& connection, const ostring& directory, const ostring& name);
4364 
4375  Raw Read(unsigned int size);
4376 
4391  bool Seek(SeekMode seekMode, big_uint offset);
4392 
4401  bool Exists() const;
4402 
4408  big_uint GetOffset() const;
4409 
4415  big_uint GetLength() const;
4416 
4422  Connection GetConnection() const;
4423 
4436  void SetInfos(const ostring& directory, const ostring& name);
4437 
4443  ostring GetName() const;
4444 
4450  ostring GetDirectory() const;
4451 
4457  void Open();
4458 
4464  void Close();
4465 
4471  bool IsOpened() const;
4472 
4478  File Clone() const;
4479 
4485  bool operator == (const File& other) const;
4486 
4492  bool operator != (const File& other) const;
4493 
4494  private:
4495 
4496  bool Equals(const File& other) const;
4497 
4498  File(OCI_File* pFile, core::Handle* parent = nullptr);
4499  };
4500 
4508  class TypeInfo : public core::HandleHolder<OCI_TypeInfo*>
4509  {
4510  friend class Object;
4511  friend class Reference;
4512  template<class>
4513  friend class Collection;
4514  friend class Column;
4515  public:
4516 
4523  {
4525  Table = OCI_TIF_TABLE,
4527  View = OCI_TIF_VIEW,
4529  Type = OCI_TIF_TYPE
4530  };
4531 
4540 
4553  TypeInfo(const Connection& connection, const ostring& name, TypeInfoType type);
4554 
4560  TypeInfoType GetType() const;
4561 
4567  ostring GetName() const;
4568 
4574  Connection GetConnection() const;
4575 
4585  unsigned int GetColumnCount() const;
4586 
4601  Column GetColumn(unsigned int index) const;
4602 
4615  boolean IsFinalType() const;
4616 
4631  TypeInfo GetSuperType() const;
4632 
4633  private:
4634 
4635  TypeInfo(OCI_TypeInfo* pTypeInfo);
4636  };
4637 
4645  class Object : public core::HandleHolder<OCI_Object*>, public core::Streamable
4646  {
4647  friend class Statement;
4648  friend class Resultset;
4649  friend class support::BindArray;
4650  friend class Reference;
4651  template<class>
4652  friend class Collection;
4653  friend class Message;
4654 
4655  public:
4656 
4663  {
4665  Persistent = OCI_OBJ_PERSISTENT,
4667  Transient = OCI_OBJ_TRANSIENT,
4669  Value = OCI_OBJ_VALUE
4670  };
4671 
4680 
4686  Object();
4687 
4695  Object(const TypeInfo& typeInfo);
4696 
4704  bool IsAttributeNull(const ostring& name) const;
4705 
4713  void SetAttributeNull(const ostring& name);
4714 
4720  TypeInfo GetTypeInfo() const;
4721 
4727  Reference GetReference() const;
4728 
4734  ObjectType GetType() const;
4735 
4748  template<class T>
4749  T Get(const ostring& name) const;
4750 
4764  template<class T>
4765  void Get(const ostring& name, T& value) const;
4766 
4780  template<class T>
4781  void Get(const ostring& name, Collection<T>& value) const;
4782 
4796  template<class T>
4797  void Set(const ostring& name, const T& value);
4798 
4804  Object Clone() const;
4805 
4811  ostring ToString() const override;
4812 
4813  private:
4814 
4815  Object(OCI_Object* pObject, core::Handle* parent = nullptr);
4816  };
4817 
4825  class Reference : public core::HandleHolder<OCI_Ref*>, public core::Streamable
4826  {
4827  friend class Statement;
4828  friend class Resultset;
4829  friend class support::BindArray;
4830  friend class Object;
4831  template<class>
4832  friend class Collection;
4833 
4834  public:
4835 
4841  Reference();
4842 
4850  Reference(const TypeInfo& typeInfo);
4851 
4857  TypeInfo GetTypeInfo() const;
4858 
4867  Object GetObject() const;
4868 
4874  bool IsReferenceNull() const;
4875 
4884  void SetReferenceNull();
4885 
4891  Reference Clone() const;
4892 
4898  ostring ToString() const override;
4899 
4900  private:
4901 
4902  Reference(OCI_Ref* pRef, core::Handle* parent = nullptr);
4903  };
4904 
4913  template<class T>
4915  {
4916  template<class>
4917  friend class CollectionIterator;
4918 
4919  public:
4920 
4921  typedef T ValueType;
4923 
4925  CollectionElement(CollectionType* coll, unsigned int pos);
4926  operator T() const;
4927  CollectionElement& operator = (const ValueType& other);
4928  CollectionElement& operator = (const CollectionElement& other);
4929  bool IsNull() const;
4930  void SetNull();
4931 
4932  private:
4933 
4934  CollectionType* _coll;
4935  unsigned int _pos;
4936  };
4937 
4945  template<class T>
4947  {
4948  public:
4949 
4950  template<class>
4951  friend class Collection;
4952 
4953  typedef typename T::ValueType value_type;
4955 
4956  typedef std::random_access_iterator_tag iterator_category;
4957  typedef ptrdiff_t difference_type;
4958  typedef ptrdiff_t distance_type;
4959  typedef value_type* pointer;
4960  typedef value_type& reference;
4961 
4963  CollectionIterator(const CollectionIterator& other);
4964 
4965  CollectionIterator& operator = (const CollectionIterator& other);
4966 
4967  CollectionIterator& operator += (difference_type value);
4968  CollectionIterator& operator -= (difference_type value);
4969 
4970  T& operator*();
4971  T* operator->();
4972 
4973  CollectionIterator& operator++();
4974  CollectionIterator& operator--();
4975 
4976  CollectionIterator operator++(int);
4977  CollectionIterator operator--(int);
4978 
4979  CollectionIterator operator + (difference_type value);
4980  CollectionIterator operator - (difference_type value);
4981 
4982  difference_type operator - (const CollectionIterator& other);
4983 
4984  bool operator == (const CollectionIterator& other);
4985  bool operator != (const CollectionIterator& other);
4986  bool operator > (const CollectionIterator& other);
4987  bool operator < (const CollectionIterator& other);
4988  bool operator >= (const CollectionIterator& other);
4989  bool operator <= (const CollectionIterator& other);
4990 
4991  protected:
4992 
4993  CollectionIterator(CollectionType* collection, unsigned int pos);
4994 
4995  T _elem;
4996  };
4997 
5005  template<class T>
5006  class Collection : public core::HandleHolder<OCI_Coll*>, public core::Streamable
5007  {
5008  friend class Statement;
5009  friend class Resultset;
5010  friend class support::BindArray;
5011  friend class Object;
5012  template<class>
5013  friend class CollectionIterator;
5014  template<class>
5015  friend class Collection;
5016 
5017  public:
5018 
5025  {
5027  Varray = OCI_COLL_VARRAY,
5029  NestedTable = OCI_COLL_NESTED_TABLE,
5031  IndexedTable = OCI_COLL_INDEXED_TABLE
5032  };
5033 
5042 
5048  Collection();
5049 
5057  Collection(const TypeInfo& typeInfo);
5058 
5064  CollectionType GetType() const;
5065 
5071  unsigned int GetMax() const;
5072 
5078  unsigned int GetSize() const;
5079 
5090  unsigned int GetCount() const;
5091 
5099  void Truncate(unsigned int size);
5100 
5107  void Clear();
5108 
5119  bool IsElementNull(unsigned int index) const;
5120 
5131  void SetElementNull(unsigned int index);
5132 
5150  bool Delete(unsigned int index) const;
5151 
5159  T Get(unsigned int index) const;
5160 
5169  void Set(unsigned int index, const T& value);
5170 
5179  void Append(const T& value);
5180 
5186  TypeInfo GetTypeInfo() const;
5187 
5193  Collection Clone() const;
5194 
5200  ostring ToString() const override;
5201 
5208 
5215 
5221  iterator begin();
5222 
5228  const_iterator begin() const;
5229 
5235  iterator end();
5236 
5242  const_iterator end() const;
5243 
5249  CollectionElement<T> operator [] (unsigned int index);
5250 
5256  CollectionElement<T> operator [](unsigned int index) const;
5257 
5258  private:
5259 
5260  static T GetElem(OCI_Elem* elem, core::Handle* parent);
5261 
5262  static void SetElem(OCI_Elem* elem, const T& value);
5263 
5264  Collection(OCI_Coll* pColl, core::Handle* parent = nullptr);
5265  };
5266 
5274  template<class T, int U>
5275  class Long : public core::HandleHolder<OCI_Long*>
5276  {
5277  friend class Statement;
5278  friend class Resultset;
5279  friend class support::BindArray;
5280 
5281  public:
5282 
5288  Long();
5289 
5297  Long(const Statement& statement);
5298 
5309  unsigned int Write(const T& content);
5310 
5316  unsigned int GetLength() const;
5317 
5323  T GetContent() const;
5324 
5325  private:
5326 
5327  Long(OCI_Long* pLong, core::Handle* parent = nullptr);
5328  };
5329 
5340 
5351 
5359  class BindInfo : public core::HandleHolder<OCI_Bind*>
5360  {
5361  friend class Statement;
5362 
5363  public:
5364 
5371  {
5373  In = OCI_BDM_IN,
5375  Out = OCI_BDM_OUT,
5377  InOut = OCI_BDM_IN_OUT
5378  };
5379 
5388 
5395  {
5397  AsArray = 1,
5399  AsPlSqlTable = 2
5400  };
5401 
5410 
5416  ostring GetName() const;
5417 
5423  DataType GetType() const;
5424 
5444  unsigned int GetSubType() const;
5445 
5455  unsigned int GetDataCount() const;
5456 
5462  Statement GetStatement() const;
5463 
5484  void SetDataNull(bool value, unsigned int index = 1);
5485 
5500  bool IsDataNull(unsigned int index = 1) const;
5501 
5515  void SetCharsetForm(CharsetForm value);
5516 
5522  BindDirection GetDirection() const;
5523 
5524  private:
5525 
5526  BindInfo(OCI_Bind* pBind, core::Handle* parent);
5527  };
5528 
5536  class Statement : public core::HandleHolder<OCI_Statement*>
5537  {
5538  friend class Exception;
5539  friend class Resultset;
5540  template<class, int>
5541  friend class Long;
5542  friend class BindInfo;
5543  friend class BindObject;
5544 
5545  public:
5546 
5553  {
5555  TypeSelect = OCI_CST_SELECT,
5557  TypeUpdate = OCI_CST_UPDATE,
5559  TypeDelete = OCI_CST_DELETE,
5561  TypeInsert = OCI_CST_INSERT,
5563  TypeCreate = OCI_CST_CREATE,
5565  TypeDrop = OCI_CST_DROP,
5567  TypeAlter = OCI_CST_ALTER,
5569  TypeBegin = OCI_CST_BEGIN,
5571  TypeDeclare = OCI_CST_DECLARE,
5573  TypeCall = OCI_CST_CALL,
5575  TypeMerge = OCI_CST_MERGE
5576  };
5577 
5586 
5593  {
5595  FetchForward = OCI_SFM_DEFAULT,
5597  FetchScrollable = OCI_SFM_SCROLLABLE
5598  };
5599 
5608 
5615  {
5617  BindByPosition = OCI_BIND_BY_POS,
5619  BindByName = OCI_BIND_BY_NAME
5620  };
5621 
5630 
5637  {
5639  LongExplicit = OCI_LONG_EXPLICIT,
5641  LongImplicit = OCI_LONG_IMPLICIT
5642  };
5643 
5652 
5658  Statement();
5659 
5670  Statement(const Connection& connection);
5671 
5677  Connection GetConnection() const;
5678 
5705  void Describe(const ostring& sql);
5706 
5730  void Parse(const ostring& sql);
5731 
5742  void Prepare(const ostring& sql);
5743 
5749  void ExecutePrepared();
5750 
5758  void Execute(const ostring& sql);
5759 
5777  template<class T>
5778  unsigned int ExecutePrepared(T callback);
5779 
5800  template<class T, class U>
5801  unsigned int ExecutePrepared(T callback, U adapter);
5802 
5821  template<class T>
5822  unsigned int Execute(const ostring& sql, T callback);
5823 
5845  template<class T, class U>
5846  unsigned int Execute(const ostring& sql, T callback, U adapter);
5847 
5862  unsigned int GetAffectedRows() const;
5863 
5869  ostring GetSql() const;
5870 
5876  ostring GetSqlIdentifier() const;
5877 
5889  Resultset GetResultset();
5890 
5912  Resultset GetNextResultset();
5913 
5938  void SetBindArraySize(unsigned int size);
5939 
5945  unsigned int GetBindArraySize() const;
5946 
5962  void AllowRebinding(bool value);
5963 
5972  bool IsRebindingAllowed() const;
5973 
5990  unsigned int GetBindIndex(const ostring& name) const;
5991 
5997  unsigned int GetBindCount() const;
5998 
6013  BindInfo GetBind(unsigned int index) const;
6014 
6025  BindInfo GetBind(const ostring& name) const;
6026 
6046  template<class T>
6047  void Bind(const ostring& name, T& value, BindInfo::BindDirection mode);
6048 
6070  template<class T, class U>
6071  void Bind(const ostring& name, T& value, U extraInfo, BindInfo::BindDirection mode);
6072 
6084  template<class T>
6085  void Bind(const ostring& name, Collection<T>& value, BindInfo::BindDirection mode);
6086 
6107  template<class T>
6108  void Bind(const ostring& name, std::vector<T>& values, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6109 
6130  template<class T>
6131  void Bind(const ostring& name, std::vector<T>& values, TypeInfo& typeInfo, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6132 
6146  template<class T>
6147  void Bind(const ostring& name, std::vector<Collection<T> >& values, TypeInfo& typeInfo, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6148 
6172  template<class T, class U>
6173  void Bind(const ostring& name, std::vector<T>& values, U extraInfo, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6174 
6195  template<class T>
6196  void Register(const ostring& name);
6197 
6215  template<class T, class U>
6216  void Register(const ostring& name, U& extraInfo);
6217 
6236  template<class T, class U>
6237  void Register(const ostring& name, U extraInfo);
6238 
6244  StatementType GetStatementType() const;
6245 
6255  unsigned int GetSqlErrorPos() const;
6256 
6267  void SetFetchMode(FetchMode value);
6268 
6277  FetchMode GetFetchMode() const;
6278 
6286  void SetBindMode(BindMode value);
6287 
6296  BindMode GetBindMode() const;
6297 
6305  void SetFetchSize(unsigned int value);
6306 
6315  unsigned int GetFetchSize() const;
6316 
6327  void SetPrefetchSize(unsigned int value);
6328 
6337  unsigned int GetPrefetchSize() const;
6338 
6357  void SetPrefetchMemory(unsigned int value);
6358 
6367  unsigned int GetPrefetchMemory() const;
6368 
6376  void SetLongMaxSize(unsigned int value);
6377 
6386  unsigned int GetLongMaxSize() const;
6387 
6398  void SetLongMode(LongMode value);
6399 
6405  LongMode GetLongMode() const;
6406 
6419  unsigned int GetSQLCommand() const;
6420 
6433  ostring GetSQLVerb() const;
6434 
6440  void GetBatchErrors(std::vector<Exception>& exceptions);
6441 
6442  private:
6443 
6444  static bool IsResultsetHandle(core::Handle* handle);
6445  static void OnFreeSmartHandle(SmartHandle* smartHandle);
6446 
6447  Statement(OCI_Statement* stmt, core::Handle* parent = nullptr);
6448 
6449  support::BindsHolder* GetBindsHolder(bool create) const;
6450 
6451  void ReleaseResultsets() const;
6452 
6453  void SetLastBindMode(BindInfo::BindDirection mode);
6454 
6455  void SetInData() const;
6456  void SetOutData() const;
6457  void ClearBinds() const;
6458 
6459  template<typename M, class T>
6460  void Bind1(M& method, const ostring& name, T& value, BindInfo::BindDirection mode);
6461 
6462  template<typename M, class T>
6463  void Bind2(M& method, const ostring& name, T& value, BindInfo::BindDirection mode);
6464 
6465  template<typename M, class T>
6466  void BindVector1(M& method, const ostring& name, std::vector<T>& values, BindInfo::BindDirection mode, BindInfo::VectorType type);
6467 
6468  template<typename M, class T, class U>
6469  void BindVector2(M& method, const ostring& name, std::vector<T>& values, BindInfo::BindDirection mode, U subType, BindInfo::VectorType type);
6470 
6471  template<typename T>
6472  unsigned int Fetch(T callback);
6473 
6474  template<typename T, typename U>
6475  unsigned int Fetch(T callback, U adapter);
6476  };
6477 
6485  class Resultset : public core::HandleHolder<OCI_Resultset*>
6486  {
6487  friend class Statement;
6488  public:
6489 
6496  {
6498  SeekAbsolute = OCI_SFD_ABSOLUTE,
6500  SeekRelative = OCI_SFD_RELATIVE
6501  };
6502 
6511 
6524  template<class T>
6525  T Get(unsigned int index) const;
6526 
6540  template<class T>
6541  void Get(unsigned int index, T& value) const;
6542 
6555  template<class T>
6556  T Get(const ostring& name) const;
6557 
6568  template<class T>
6569  void Get(const ostring& name, T& value) const;
6570 
6585  template<class T, class U>
6586  bool Get(T& value, U adapter) const;
6587 
6603  template<typename T>
6604  unsigned int ForEach(T callback);
6605 
6628  template<typename T, typename U>
6629  unsigned int ForEach(T callback, U adapter);
6630 
6644  bool Next();
6645 
6659  bool Prev();
6660 
6672  bool First();
6673 
6685  bool Last();
6686 
6707  bool Seek(SeekMode mode, int offset);
6708 
6714  unsigned int GetCount() const;
6715 
6726  unsigned int GetCurrentRow() const;
6727 
6741  unsigned int GetColumnIndex(const ostring& name) const;
6742 
6748  unsigned int GetColumnCount() const;
6749 
6760  Column GetColumn(unsigned int index) const;
6761 
6772  Column GetColumn(const ostring& name) const;
6773 
6784  bool IsColumnNull(unsigned int index) const;
6785 
6793  bool IsColumnNull(const ostring& name) const;
6794 
6800  Statement GetStatement() const;
6801 
6807  bool operator ++ (int);
6808 
6814  bool operator -- (int);
6815 
6822  bool operator += (int offset);
6823 
6830  bool operator -= (int offset);
6831 
6832  private:
6833 
6834  Resultset(OCI_Resultset* resultset, core::Handle* parent);
6835  };
6836 
6844  class Column : public core::HandleHolder<OCI_Column*>
6845  {
6846  friend class TypeInfo;
6847  friend class Resultset;
6848 
6849  public:
6850 
6857  {
6859  NoFlags = OCI_CPF_NONE,
6862  IsIdentity = OCI_CPF_IS_IDENTITY,
6866  IsGeneratedAlways = OCI_CPF_IS_GEN_ALWAYS,
6869  IsGeneratedByDefaultOnNull = OCI_CPF_IS_GEN_BY_DEFAULT_ON_NULL,
6871  IsLogicalPartitioning = OCI_CPF_IS_LPART,
6873  IsGeneratedByContainers = OCI_CPF_IS_CONID
6874  };
6875 
6884 
6890  ostring GetName() const;
6891 
6900  ostring GetSQLType() const;
6901 
6911  ostring GetFullSQLType() const;
6912 
6918  DataType GetType() const;
6919 
6937  unsigned int GetSubType() const;
6938 
6944  CharsetForm GetCharsetForm() const;
6945 
6951  CollationID GetCollationID() const;
6952 
6962  unsigned int GetSize() const;
6963 
6969  int GetScale() const;
6970 
6976  int GetPrecision() const;
6977 
6983  int GetFractionalPrecision() const;
6984 
6990  int GetLeadingPrecision() const;
6991 
7002  PropertyFlags GetPropertyFlags() const;
7003 
7009  bool IsNullable() const;
7010 
7020  bool IsCharSemanticUsed() const;
7021 
7031  TypeInfo GetTypeInfo() const;
7032 
7033  private:
7034 
7035  Column(OCI_Column* pColumn, core::Handle* parent);
7036  };
7037 
7048  class Subscription : public core::HandleHolder<OCI_Subscription*>
7049  {
7050  friend class Event;
7051 
7052  public:
7053 
7061  typedef void (*NotifyHandlerProc) (Event& evt);
7062 
7069  {
7071  ObjectChanges = OCI_CNT_OBJECTS,
7073  RowChanges = OCI_CNT_ROWS,
7075  DatabaseChanges = OCI_CNT_DATABASES,
7077  AllChanges = OCI_CNT_ALL
7078  };
7079 
7088 
7094  Subscription();
7095 
7111  void Register(const Connection& connection, const ostring& name, ChangeTypes changeTypes, NotifyHandlerProc handler, unsigned int port = 0, unsigned int timeout = 0);
7112 
7127  void Unregister();
7128 
7134  void Watch(const ostring& sql);
7135 
7141  ostring GetName() const;
7142 
7148  unsigned int GetTimeout() const;
7149 
7155  unsigned int GetPort() const;
7156 
7165  Connection GetConnection() const;
7166 
7167  private:
7168 
7169  Subscription(OCI_Subscription* pSubcription);
7170  };
7171 
7182  class Event : public core::HandleHolder<OCI_Event*>
7183  {
7184  friend class Subscription;
7185  friend class Environment;
7186 
7187  public:
7188 
7195  {
7197  DatabaseStart = OCI_ENT_STARTUP,
7199  DatabaseShutdown = OCI_ENT_SHUTDOWN,
7201  DatabaseShutdownAny = OCI_ENT_SHUTDOWN_ANY,
7203  DatabaseDrop = OCI_ENT_DROP_DATABASE,
7205  Unregister = OCI_ENT_DEREGISTER,
7207  ObjectChanged = OCI_ENT_OBJECT_CHANGED
7208  };
7209 
7218 
7225  {
7227  ObjectInserted = OCI_ONT_INSERT,
7229  ObjectUpdated = OCI_ONT_UPDATE,
7231  ObjectDeleted = OCI_ONT_DELETE,
7233  ObjectAltered = OCI_ONT_ALTER,
7235  ObjectDropped = OCI_ONT_DROP,
7237  ObjectGeneric = OCI_ONT_GENERIC
7238  };
7239 
7248 
7254  EventType GetType() const;
7255 
7264  ObjectEvent GetObjectEvent() const;
7265 
7271  ostring GetDatabaseName() const;
7272 
7281  ostring GetObjectName() const;
7282 
7288  ostring GetRowID() const;
7289 
7295  Subscription GetSubscription() const;
7296 
7297  private:
7298 
7299  Event(OCI_Event* pEvent);
7300  };
7301 
7309  class Agent : public core::HandleHolder<OCI_Agent*>
7310  {
7311  friend class Message;
7312  friend class Dequeue;
7313 
7314  public:
7315 
7338  Agent(const Connection& connection, const ostring& name = OTEXT(""), const ostring& address = OTEXT(""));
7339 
7345  ostring GetName() const;
7346 
7360  void SetName(const ostring& value);
7361 
7370  ostring GetAddress() const;
7371 
7385  void SetAddress(const ostring& value);
7386 
7387  private:
7388 
7389  Agent(OCI_Agent* pAgent, core::Handle* parent);
7390  };
7391 
7399  class Message : public core::HandleHolder<OCI_Msg*>
7400  {
7401  friend class Dequeue;
7402 
7403  public:
7404 
7411  {
7413  Ready = OCI_AMS_READY,
7415  Waiting = OCI_AMS_WAITING,
7417  Processed = OCI_AMS_PROCESSED,
7419  Expired = OCI_AMS_EXPIRED
7420  };
7421 
7430 
7460  Message(const TypeInfo& typeInfo);
7461 
7470  void Reset();
7471 
7477  template<class T>
7478  T GetPayload();
7479 
7487  template<class T>
7488  void SetPayload(const T& value);
7489 
7498  Date GetEnqueueTime() const;
7499 
7505  int GetAttemptCount() const;
7506 
7512  MessageState GetState() const;
7513 
7524  Raw GetID() const;
7525 
7534  int GetExpiration() const;
7535 
7555  void SetExpiration(int value);
7556 
7565  int GetEnqueueDelay() const;
7566 
7589  void SetEnqueueDelay(int value);
7590 
7599  int GetPriority() const;
7600 
7613  void SetPriority(int value);
7614 
7624  Raw GetOriginalID() const;
7625 
7637  void SetOriginalID(const Raw& value);
7638 
7647  ostring GetCorrelation() const;
7648 
7659  void SetCorrelation(const ostring& value);
7660 
7674  ostring GetExceptionQueue() const;
7675 
7702  void SetExceptionQueue(const ostring& value);
7703 
7712  Agent GetSender() const;
7713 
7721  void SetSender(const Agent& agent);
7722 
7734  void SetConsumers(std::vector<Agent>& agents);
7735 
7736  private:
7737 
7738  Message(OCI_Msg* pMessage, core::Handle* parent);
7739  };
7740 
7748  class Enqueue : public core::HandleHolder<OCI_Enqueue*>
7749  {
7750  public:
7751 
7758  {
7760  Before = OCI_ASD_BEFORE,
7762  OnTop = OCI_ASD_TOP
7763  };
7764 
7773 
7780  {
7782  Immediate = OCI_AMV_IMMEDIATE,
7784  OnCommit = OCI_AMV_ON_COMMIT
7785  };
7786 
7795 
7817  Enqueue(const TypeInfo& typeInfo, const ostring& queueName);
7818 
7826  void Put(const Message& message);
7827 
7836  EnqueueVisibility GetVisibility() const;
7837 
7848  void SetVisibility(EnqueueVisibility value);
7849 
7858  EnqueueMode GetMode() const;
7859 
7878  void SetMode(EnqueueMode value);
7879 
7890  Raw GetRelativeMsgID() const;
7891 
7905  void SetRelativeMsgID(const Raw& value);
7906  };
7907 
7915  class Dequeue : public core::HandleHolder<OCI_Dequeue*>
7916  {
7917  friend class Environment;
7918 
7919  public:
7920 
7928  typedef void (*NotifyAQHandlerProc) (Dequeue& dequeue);
7929 
7936  {
7938  Browse = OCI_ADM_BROWSE,
7940  Locked = OCI_ADM_LOCKED,
7942  Remove = OCI_ADM_REMOVE,
7944  Confirm = OCI_ADM_REMOVE_NODATA
7945  };
7946 
7955 
7962  {
7964  Immediate = OCI_AMV_IMMEDIATE,
7966  OnCommit = OCI_AMV_ON_COMMIT
7967  };
7968 
7977 
7984  {
7986  FirstMessage = OCI_ADN_FIRST_MSG,
7988  NextMessage = OCI_ADN_NEXT_MSG,
7991  NextTransaction = OCI_ADN_NEXT_TRANSACTION
7992  };
7993 
8002 
8011  Dequeue(const TypeInfo& typeInfo, const ostring& queueName);
8012 
8026  Message Get();
8027 
8043  Agent Listen(int timeout);
8044 
8053  ostring GetConsumer() const;
8054 
8066  void SetConsumer(const ostring& value);
8067 
8076  ostring GetCorrelation() const;
8077 
8089  void SetCorrelation(const ostring& value);
8090 
8099  Raw GetRelativeMsgID() const;
8100 
8108  void SetRelativeMsgID(const Raw& value);
8109 
8118  DequeueVisibility GetVisibility() const;
8119 
8134  void SetVisibility(DequeueVisibility value);
8135 
8144  DequeueMode GetMode() const;
8145 
8156  void SetMode(DequeueMode value);
8157 
8166  NavigationMode GetNavigation() const;
8167 
8187  void SetNavigation(NavigationMode value);
8188 
8197  int GetWaitTime() const;
8198 
8216  void SetWaitTime(int value);
8217 
8225  void SetAgents(std::vector<Agent>& agents);
8226 
8243  void Subscribe(unsigned int port, unsigned int timeout, NotifyAQHandlerProc handler);
8244 
8253  void Unsubscribe();
8254 
8255  private:
8256 
8257  Dequeue(OCI_Dequeue* pDequeue);
8258  };
8259 
8265  class Queue
8266  {
8267  public:
8268 
8275  {
8277  NormalQueue = OCI_AQT_NORMAL,
8279  ExceptionQueue = OCI_AQT_EXCEPTION,
8281  NonPersistentQueue = OCI_AQT_NON_PERSISTENT
8282  };
8283 
8292 
8317  static void Create(const Connection& connection, const ostring& queue, const ostring& table, QueueType type = NormalQueue,
8318  unsigned int maxRetries = 0, unsigned int retryDelay = 0, unsigned int retentionTime = 0,
8319  bool dependencyTracking = false, const ostring& comment = OTEXT(""));
8320 
8341  static void Alter(const Connection& connection, const ostring& queue,
8342  unsigned int maxRetries = 0, unsigned int retryDelay = 0,
8343  unsigned int retentionTime = 0, const ostring& comment = OTEXT(""));
8344 
8360  static void Drop(const Connection& connection, const ostring& queue);
8361 
8379  static void Start(const Connection& connection, const ostring& queue, bool enableEnqueue = true, bool enableDequeue = true);
8380 
8399  static void Stop(const Connection& connection, const ostring& queue, bool stopEnqueue = true, bool stopDequeue = true, bool wait = true);
8400  };
8401 
8408  {
8409  public:
8410 
8418  {
8420  None = OCI_AGM_NONE,
8423  Transactionnal = OCI_AGM_TRANSACTIONNAL
8424  };
8425 
8434 
8442  {
8444  Buffered = OCI_APM_BUFFERED,
8446  Persistent = OCI_APM_PERSISTENT,
8448  All = OCI_APM_ALL
8449  };
8450 
8459 
8494  static void Create(const Connection& connection, const ostring& table, const ostring& payloadType, bool multipleConsumers,
8495  const ostring& storageClause = OTEXT(""), const ostring& sortList = OTEXT(""),
8496  GroupingMode groupingMode = None, const ostring& comment = OTEXT(""),
8497  unsigned int primaryInstance = 0, unsigned int secondaryInstance = 0,
8498  const ostring& compatible = OTEXT(""));
8499 
8518  static void Alter(const Connection& connection, const ostring& table, const ostring& comment, unsigned int primaryInstance = 0, unsigned int secondaryInstance = 0);
8519 
8540  static void Drop(const Connection& connection, const ostring& table, bool force = true);
8541 
8565  static void Purge(const Connection& connection, const ostring& table, PurgeMode mode, const ostring& condition = OTEXT(""), bool block = true);
8566 
8584  static void Migrate(const Connection& connection, const ostring& table, const ostring& compatible = OTEXT(""));
8585  };
8586 
8594  class DirectPath : public core::HandleHolder<OCI_DirPath*>
8595  {
8596  public:
8597 
8604  {
8606  Default = OCI_DCM_DEFAULT,
8608  Force = OCI_DCM_FORCE
8609  };
8610 
8619 
8626  {
8628  ResultComplete = OCI_DPR_COMPLETE,
8630  ResultError = OCI_DPR_ERROR,
8632  ResultFull = OCI_DPR_FULL,
8634  ResultPartial = OCI_DPR_PARTIAL,
8636  ResultEmpty = OCI_DPR_EMPTY
8637  };
8638 
8647 
8669  DirectPath(const TypeInfo& typeInfo, unsigned int nbCols, unsigned int nbRows, const ostring& partition = OTEXT(""));
8670 
8687  void SetColumn(unsigned int colIndex, const ostring& name, unsigned int maxSize, const ostring& format = OTEXT(""));
8688 
8719  template<class T>
8720  void SetEntry(unsigned int rowIndex, unsigned int colIndex, const T& value, bool complete = true);
8721 
8732  void Reset();
8733 
8739  void Prepare();
8740 
8759  DirectPath::Result Convert();
8760 
8772  DirectPath::Result Load();
8773 
8782  void Finish();
8783 
8796  void Abort();
8797 
8806  void Save();
8807 
8813  void FlushRow();
8814 
8826  void SetCurrentRows(unsigned int value);
8827 
8836  unsigned int GetCurrentRows() const;
8837 
8846  unsigned int GetMaxRows() const;
8847 
8856  unsigned int GetRowCount() const;
8857 
8870  unsigned int GetAffectedRows() const;
8871 
8885  void SetDateFormat(const ostring& format);
8886 
8913  void SetParallel(bool value);
8914 
8929  void SetNoLog(bool value);
8930 
8944  void SetCacheSize(unsigned int value);
8945 
8956  void SetBufferSize(unsigned int value);
8957 
8971  void SetConversionMode(ConversionMode value);
8972 
9001  unsigned int GetErrorColumn();
9002 
9036  unsigned int GetErrorRow();
9037  };
9038 
9039 
9040 #define OCILIB_DEFINE_FLAG_OPERATORS(T) \
9041  inline core::Flags<T> operator | (T a, T b) { return core::Flags<T>(a) | core::Flags<T>(b); } \
9042 
9043  OCILIB_DEFINE_FLAG_OPERATORS(Environment::EnvironmentFlagsValues)
9044  OCILIB_DEFINE_FLAG_OPERATORS(Environment::SessionFlagsValues)
9045  OCILIB_DEFINE_FLAG_OPERATORS(Environment::StartFlagsValues)
9046  OCILIB_DEFINE_FLAG_OPERATORS(Environment::StartModeValues)
9047  OCILIB_DEFINE_FLAG_OPERATORS(Environment::ShutdownModeValues)
9048  OCILIB_DEFINE_FLAG_OPERATORS(Environment::ShutdownFlagsValues)
9049  OCILIB_DEFINE_FLAG_OPERATORS(Environment::AllocatedBytesValues)
9050  OCILIB_DEFINE_FLAG_OPERATORS(Transaction::TransactionFlagsValues)
9051  OCILIB_DEFINE_FLAG_OPERATORS(Column::PropertyFlagsValues)
9052  OCILIB_DEFINE_FLAG_OPERATORS(Subscription::ChangeTypesValues)
9053 }
core::Enum< CharsetFormValues > CharsetForm
Type of charsetForm.
Definition: types.hpp:175
struct OCI_Agent OCI_Agent
OCILIB encapsulation of A/Q Agent.
Definition: types.h:448
CharsetModeValues
Charset mode enumerated values.
Definition: types.hpp:599
Encapsulate a Resultset column or object member properties.
Definition: types.hpp:6844
core::Enum< ExceptionTypeValues > ExceptionType
Type of Exception.
Definition: types.hpp:380
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.
Definition: types.hpp:4309
DequeueVisibilityValues
Message visibility enumerated values.
Definition: types.hpp:7961
STL compliant Collection Random iterator class.
Definition: types.hpp:4946
core::Flags< PropertyFlagsValues > PropertyFlags
Column properties flags.
Definition: types.hpp:6883
Internal usage. Interface for handling ownership and relationship of a C API handle.
Definition: core.hpp:312
struct OCI_Connection OCI_Connection
Oracle physical connection.
Definition: types.h:112
Static class allowing to set/get thread local storage (TLS) values for a given unique key...
Definition: types.hpp:1279
Exception class handling all OCILIB errors.
Definition: types.hpp:350
core::Enum< CollationIDValues > CollationID
Type of Collation ID.
Definition: types.hpp:219
Provides SQL bind information.
Definition: types.hpp:5359
TypeInfoTypeValues
Type of object information enumerated values.
Definition: types.hpp:4522
const char * what() const noexcept override
Override the std::exception::what() method.
Definition: Exception.hpp:149
EventTypeValues
Event type enumerated values.
Definition: types.hpp:7194
core::Enum< OpenModeValues > OpenMode
Open Modes.
Definition: types.hpp:266
LobTypeValues
Lob types enumerated values.
Definition: types.hpp:273
CollectionIterator< const CollectionElement< T > > const_iterator
Common const iterator declaration.
Definition: types.hpp:5214
OCILIB ++ Namespace.
HAEventSourceValues
HA Event sources enumerated values.
Definition: types.hpp:499
FetchModeValues
Fetch Modes enumerated values.
Definition: types.hpp:5592
TimeoutTypeValues
Timeout enumerated values.
Definition: types.hpp:1588
HAEventTypeValues
HA Event types enumerated values.
Definition: types.hpp:531
core::Enum< FailoverRequestValues > FailoverRequest
Failover requests.
Definition: types.hpp:1636
core::Enum< DataTypeValues > DataType
Column data type.
Definition: types.hpp:117
core::Flags< EnvironmentFlagsValues > EnvironmentFlags
Environment Flags.
Definition: types.hpp:570
Long< Raw, LongBinary > Blong
Class handling LONG RAW oracle type.
Definition: types.hpp:5350
core::Enum< SessionTraceValues > SessionTrace
Session traces.
Definition: types.hpp:1712
unsigned int GetRow() const
Return the row index which caused an error during statement execution.
Definition: Exception.hpp:225
Class allowing the administration of Oracle Queues.
Definition: types.hpp:8265
SessionTraceValues
Session trace enumerated values.
Definition: types.hpp:1693
core::Enum< EventTypeValues > EventType
Event type.
Definition: types.hpp:7217
Subscription Event.
Definition: types.hpp:7182
core::Enum< SeekModeValues > SeekMode
Seek Modes.
Definition: types.hpp:244
StatementTypeValues
Statement Type enumerated values.
Definition: types.hpp:5552
core::Enum< DequeueModeValues > DequeueMode
Dequeue mode.
Definition: types.hpp:7954
OCI_Mutex * MutexHandle
Alias for an OCI_Mutex pointer.
Definition: config.hpp:147
struct OCI_XID OCI_XID
Global transaction identifier.
core::Enum< FormatTypeValues > FormatType
Format type.
Definition: types.hpp:340
ostring GetMessage() const
Retrieve the error message.
Definition: Exception.hpp:154
Abstract class allowing derived classes to be compatible with any type supporting the operator << oci...
Definition: core.hpp:407
core::Enum< ResultValues > Result
Direct Operation Result.
Definition: types.hpp:8646
Object used for executing SQL or PL/SQL statement and returning the produced results.
Definition: types.hpp:5536
A connection or session with a specific database.
Definition: types.hpp:1563
core::Enum< LobTypeValues > LobType
Type of Lob.
Definition: types.hpp:290
core::Enum< TimestampTypeValues > TimestampType
Type of timestamp.
Definition: types.hpp:3525
static class allowing to manipulate threads
Definition: types.hpp:1154
core::Enum< IntervalTypeValues > IntervalType
Interval types.
Definition: types.hpp:3123
PoolTypeValues
Pool type enumerated values.
Definition: types.hpp:1344
core::Enum< BindModeValues > BindMode
Bind Modes.
Definition: types.hpp:5629
struct OCI_Interval OCI_Interval
Oracle internal interval representation.
Definition: types.h:287
Object identifying the SQL data type LONG.
Definition: config.hpp:202
core::Enum< CollectionTypeValues > CollectionType
Collection type.
Definition: types.hpp:5041
Internal usage. Locker object.
Definition: core.hpp:217
struct OCI_Dequeue OCI_Dequeue
OCILIB encapsulation of A/Q dequeuing operations.
Definition: types.h:458
int GetOracleErrorCode() const
Return the Oracle error code.
Definition: Exception.hpp:205
static T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so, it raises a C++ exception using the retrieved error handle.
Definition: Utils.hpp:53
Oracle Transaction object.
Definition: types.hpp:2358
FailoverResultValues
Failover callback results enumerated values.
Definition: types.hpp:1671
struct OCI_Statement OCI_Statement
Oracle SQL or PL/SQL statement.
Definition: types.h:124
struct OCI_Bind OCI_Bind
Internal bind representation.
Definition: types.h:136
LongTypeValues
Long types enumerated values.
Definition: types.hpp:297
struct OCI_Subscription OCI_Subscription
OCILIB encapsulation of Oracle DCN notification.
Definition: types.h:418
TimestampTypeValues
Interval types enumerated values.
Definition: types.hpp:3508
StartFlagsValues
Oracle instance start flags enumerated values.
Definition: types.hpp:685
AQ identified agent for messages delivery.
Definition: types.hpp:7309
Static class allowing managing mutexes.
Definition: types.hpp:1227
Oracle Direct path loading encapsulation.
Definition: types.hpp:8594
core::Enum< BindDirectionValues > BindDirection
Bind direction.
Definition: types.hpp:5387
core::Enum< ObjectTypeValues > ObjectType
Object Type.
Definition: types.hpp:4679
core::Enum< TimeoutTypeValues > TimeoutType
Timeout Types.
Definition: types.hpp:1614
Internal usage. Map supporting concurrent access from multiple threads.
Definition: core.hpp:260
struct OCI_Timestamp OCI_Timestamp
Oracle internal timestamp representation.
Definition: types.h:277
EnqueueModeValues
Message enqueuing mode enumerated values.
Definition: types.hpp:7757
void(* POCI_THREAD)(OCI_Thread *thread, void *arg)
Thread procedure prototype.
Definition: types.h:497
ConversionModeValues
Conversion mode enumerated values.
Definition: types.hpp:8603
VectorTypeValues
Vector type values.
Definition: types.hpp:5394
ShutdownModeValues
Oracle instance shutdown modes enumerated values.
Definition: types.hpp:709
struct OCI_Msg OCI_Msg
OCILIB encapsulation of A/Q message.
Definition: types.h:438
Internal usage. Class implementing bind translations between C++ vectors and C API arrays...
Definition: support.hpp:79
core::Flags< SessionFlagsValues > SessionFlags
Sessions flags.
Definition: types.hpp:652
core::Enum< ConversionModeValues > ConversionMode
Conversion Mode.
Definition: types.hpp:8618
const void * ThreadId
Thread Unique ID.
Definition: config.hpp:165
Object identifying the SQL data type REF.
Definition: types.hpp:4825
SeekModeValues
Seek Modes enumerated values.
Definition: types.hpp:227
PurgeModeValues
Purge mode enumerated values.
Definition: types.hpp:8441
core::Enum< VectorTypeValues > VectorType
Vector type.
Definition: types.hpp:5409
Internal usage. Smart pointer class with reference counting for managing OCILIB object handles...
Definition: core.hpp:327
Static class in charge of library initialization / cleanup.
Definition: types.hpp:482
core::Enum< DequeueVisibilityValues > DequeueVisibility
Message visibility after begin dequeued.
Definition: types.hpp:7976
FailoverRequestValues
Failover request enumerated values.
Definition: types.hpp:1621
Class used for handling transient collection value. it is used internally by the Collection<T> class:...
Definition: types.hpp:4914
AllocatedBytesValues
Allocated Bytes enumerated values.
Definition: types.hpp:772
FailoverEventValues
Failover events enumerated values.
Definition: types.hpp:1643
struct OCI_Ref OCI_Ref
Oracle REF type representation.
Definition: types.h:344
ChangeTypesValues
Subscription changes flags values.
Definition: types.hpp:7068
void * AnyPointer
Alias for the generic void pointer.
Definition: config.hpp:129
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
core::Enum< FailoverResultValues > FailoverResult
Failover callback results.
Definition: types.hpp:1686
Template Enumeration template class providing some type safety to some extends for manipulating enume...
Definition: core.hpp:117
core::Enum< LongModeValues > LongMode
LONG data type mapping modes.
Definition: types.hpp:5651
core::Flags< ShutdownFlagsValues > ShutdownFlags
Oracle instance shutdown flags.
Definition: types.hpp:765
Object identifying the SQL data type BFILE.
Definition: types.hpp:4319
Object identifying the SQL data types VARRAY and NESTED TABLE.
Definition: config.hpp:196
core::Enum< EnqueueVisibilityValues > EnqueueVisibility
Message visibility after begin queued.
Definition: types.hpp:7794
struct OCI_Date OCI_Date
Oracle internal date representation.
Definition: types.h:267
core::Flags< ShutdownModeValues > ShutdownMode
Oracle instance shutdown modes.
Definition: types.hpp:728
ResultValues
Direct Operation Result enumerated values.
Definition: types.hpp:8625
core::Enum< OracleVersionValues > OracleVersion
Oracle Version.
Definition: types.hpp:71
Object identifying the SQL data type INTERVAL.
Definition: types.hpp:3091
int GetInternalErrorCode() const
Return the OCILIB error code.
Definition: Exception.hpp:210
CollectionTypeValues
Collection type enumerated values.
Definition: types.hpp:5024
core::Enum< TypeInfoTypeValues > TypeInfoType
Type of object information.
Definition: types.hpp:4539
struct OCI_Transaction OCI_Transaction
Oracle Transaction.
Definition: types.h:226
POCI_THREADKEYDEST ThreadKeyFreeProc
Thread Key callback for freeing resources.
Definition: types.hpp:1289
GroupingModeValues
Grouping mode enumerated values.
Definition: types.hpp:8417
Class allowing the administration of Oracle Queue tables.
Definition: types.hpp:8407
Enqueue object for queuing messages into an Oracle Queue.
Definition: types.hpp:7748
struct OCI_Resultset OCI_Resultset
Collection of output columns from a select statement.
Definition: types.h:151
core::Enum< LongTypeValues > LongType
Type of Long.
Definition: types.hpp:312
SessionFlagsValues
Session flags enumerated values.
Definition: types.hpp:621
TransactionFlagsValues
Transaction flags enumerated values.
Definition: types.hpp:2369
core::Enum< GroupingModeValues > GroupingMode
Grouping Mode.
Definition: types.hpp:8433
core::Enum< StatementTypeValues > StatementType
Statement Type.
Definition: types.hpp:5585
OpenModeValues
Open Modes enumerated values.
Definition: types.hpp:251
Long< ostring, LongCharacter > Clong
Class handling LONG oracle type.
Definition: types.hpp:5339
A connection or session Pool.
Definition: types.hpp:1335
core::Flags< AllocatedBytesValues > AllocatedBytesFlags
Allocated Bytes.
Definition: types.hpp:789
BindModeValues
Bind Modes enumerated values.
Definition: types.hpp:5614
BindDirectionValues
Bind direction enumerated values.
Definition: types.hpp:5370
struct OCI_File OCI_File
Oracle External Large objects:
Definition: types.h:211
ObjectEventValues
Object events enumerated values.
Definition: types.hpp:7224
LongModeValues
LONG data type mapping modes enumerated values.
Definition: types.hpp:5636
ObjectTypeValues
Object Type enumerated values.
Definition: types.hpp:4662
struct OCI_Number OCI_Number
Oracle NUMBER representation.
Definition: types.h:257
core::Enum< NavigationModeValues > NavigationMode
Navigation Mode.
Definition: types.hpp:8001
core::Enum< ObjectEventValues > ObjectEvent
Object events.
Definition: types.hpp:7247
core::Enum< FetchModeValues > FetchMode
Fetch Modes.
Definition: types.hpp:5607
CollectionIterator< CollectionElement< T > > iterator
Common iterator declaration.
Definition: types.hpp:5207
NumericTypeValues
Numeric type enumerated values.
Definition: types.hpp:124
OCI_Thread * ThreadHandle
Alias for an OCI_Thread pointer.
Definition: config.hpp:156
core::Enum< SeekModeValues > SeekMode
Seek Modes.
Definition: types.hpp:6510
CharsetFormValues
Charset form enumerated values.
Definition: types.hpp:160
core::Enum< PoolTypeValues > PoolType
Type of Pool.
Definition: types.hpp:1359
void(* POCI_THREADKEYDEST)(void *data)
Thread key destructor prototype.
Definition: types.h:513
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
Definition: config.hpp:138
CollationIDValues
Collation ID enumerated values.
Definition: types.hpp:182
struct OCI_Long OCI_Long
Oracle Long data type.
Definition: types.h:248
core::Enum< ImportModeValues > ImportMode
OCI libraries import mode.
Definition: types.hpp:592
Provides type information on Oracle Database objects.
Definition: types.hpp:4508
EnqueueVisibilityValues
Message visibility enumerated values.
Definition: types.hpp:7779
struct OCI_TypeInfo OCI_TypeInfo
Type info metadata handle.
Definition: types.h:354
NavigationModeValues
Navigation Mode enumerated values.
Definition: types.hpp:7983
Object identifying the SQL data type NUMBER.
Definition: types.hpp:2477
IntervalTypeValues
Interval types enumerated values.
Definition: types.hpp:3108
core::Flags< StartFlagsValues > StartFlags
Oracle instance start flags.
Definition: types.hpp:702
POCI_THREAD ThreadProc
Thread callback.
Definition: types.hpp:1164
ShutdownFlagsValues
Oracle instance shutdown flags enumerated values.
Definition: types.hpp:735
DequeueModeValues
Dequeue mode enumerated values.
Definition: types.hpp:7935
Statement GetStatement() const
Return the statement within the error occurred.
Definition: Exception.hpp:215
DataTypeValues
Data type enumerated values.
Definition: types.hpp:78
core::Flags< TransactionFlagsValues > TransactionFlags
Transaction flags.
Definition: types.hpp:2393
ImportModeValues
OCI libraries import mode enumerated values.
Definition: types.hpp:577
Lob< ostring, LobNationalCharacter > NClob
Class handling NCLOB oracle type.
Definition: types.hpp:4298
MessageStateValues
Message state enumerated values.
Definition: types.hpp:7410
OracleVersionValues
Oracle Version enumerated values.
Definition: types.hpp:46
core::Enum< HAEventSourceValues > HAEventSource
Source of HA events.
Definition: types.hpp:524
Object identifying the SQL data type LOB (CLOB, NCLOB and BLOB)
Definition: config.hpp:198
core::Enum< FailoverEventValues > FailoverEvent
Failover events.
Definition: types.hpp:1664
SeekModeValues
Seek Modes enumerated values.
Definition: types.hpp:6495
QueueTypeValues
Queue Type enumerated values.
Definition: types.hpp:8274
ExceptionTypeValues
Exception type enumerated values.
Definition: types.hpp:363
Lob< ostring, LobCharacter > Clob
Class handling CLOB oracle type.
Definition: types.hpp:4287
core::Enum< CharsetModeValues > CharsetMode
Environment charset mode.
Definition: types.hpp:614
struct OCI_Coll OCI_Coll
Oracle Collections (VARRAYs and Nested Tables) representation.
Definition: types.h:307
PropertyFlagsValues
Column properties flags values.
Definition: types.hpp:6856
struct OCI_Elem OCI_Elem
Oracle Collection item representation.
Definition: types.h:317
FormatTypeValues
Format type enumerated values.
Definition: types.hpp:319
AQ message.
Definition: types.hpp:7399
Database resultset.
Definition: types.hpp:6485
core::Enum< QueueTypeValues > QueueType
Queue Type.
Definition: types.hpp:8291
core::Enum< EnqueueModeValues > EnqueueMode
Message enqueuing mode.
Definition: types.hpp:7772
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
struct OCI_Object OCI_Object
Oracle Named types representation.
Definition: types.h:297
core::Flags< StartModeValues > StartMode
Oracle instance start modes.
Definition: types.hpp:678
StartModeValues
Oracle instance start modes enumerated values.
Definition: types.hpp:659
struct OCI_Column OCI_Column
Oracle SQL Column and Type member representation.
Definition: types.h:163
struct OCI_Error OCI_Error
Encapsulates an Oracle or OCILIB exception.
Definition: types.h:378
Object identifying the SQL data type TIMESTAMP.
Definition: types.hpp:3490
core::Enum< MessageStateValues > MessageState
Message state.
Definition: types.hpp:7429
Dequeue object for dequeuing messages into an Oracle Queue.
Definition: types.hpp:7915
core::Enum< HAEventTypeValues > HAEventType
Type of HA events.
Definition: types.hpp:546
core::Flags< ChangeTypesValues > ChangeTypes
Subscription changes flags.
Definition: types.hpp:7087
Object identifying the SQL data type OBJECT.
Definition: types.hpp:4645
EnvironmentFlagsValues
Environment Flags enumerated values.
Definition: types.hpp:553
struct OCI_Event OCI_Event
OCILIB encapsulation of Oracle DCN event.
Definition: types.h:428
Subscription to database or objects changes.
Definition: types.hpp:7048
core::Enum< PurgeModeValues > PurgeMode
Purge mode.
Definition: types.hpp:8458
struct OCI_Lob OCI_Lob
Oracle Internal Large objects:
Definition: types.h:186
core::Enum< NumericTypeValues > NumericType
Numeric data type.
Definition: types.hpp:153
Internal usage. Class owning bind objects allowing to set/get C data prior/after a statement executio...
Definition: support.hpp:212
Object identifying the SQL data type DATE.
Definition: types.hpp:2655