OCILIB (C and C++ Driver for Oracle)  4.7.6
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-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 
38 namespace 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 
430  Connection GetConnection() const;
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  template<class, int>
514  friend class Lob;
515 
516  public:
517 
524  {
526  SourceInstance = OCI_HES_INSTANCE,
528  SourceDatabase = OCI_HES_DATABASE,
530  SourceNode = OCI_HES_NODE,
532  SourceService = OCI_HES_SERVICE,
534  SourceServiceMember = OCI_HES_SERVICE_MEMBER,
536  SourceASMInstance = OCI_HES_ASM_INSTANCE,
538  SourcePreConnect = OCI_HES_PRECONNECT
539  };
540 
549 
556  {
558  EventDown = OCI_HET_DOWN,
560  EventUp = OCI_HET_UP
561  };
562 
571 
578  {
580  Default = OCI_ENV_DEFAULT,
582  Threaded = OCI_ENV_THREADED,
584  Events = OCI_ENV_EVENTS
585  };
586 
595 
602  {
604  ImportLinkage = OCI_IMPORT_MODE_LINKAGE,
606  ImportRuntime = OCI_IMPORT_MODE_RUNTIME
607  };
608 
617 
624  {
626  CharsetAnsi = OCI_CHAR_ANSI,
628  CharsetWide = OCI_CHAR_WIDE
629  };
630 
639 
646  {
648  SessionDefault = OCI_SESSION_DEFAULT,
650  SessionXa = OCI_SESSION_XA,
652  SessionSysDba = OCI_SESSION_SYSDBA,
654  SessionSysOper = OCI_SESSION_SYSOPER,
656  SessionSysAsm = OCI_SESSION_SYSASM,
658  SessionSysBkp = OCI_SESSION_SYSBKP,
660  SessionSysDgD = OCI_SESSION_SYSDGD,
662  SessionSysKmt = OCI_SESSION_SYSKMT,
664  SessionSysRac = OCI_SESSION_SYSRAC,
666  SessionPreAuth = OCI_SESSION_PRELIM_AUTH
667  };
668 
677 
684  {
686  StartOnly = OCI_DB_SPM_START,
688  StartMount = OCI_DB_SPM_MOUNT,
690  StartOpen = OCI_DB_SPM_OPEN,
692  StartFull = OCI_DB_SPM_FULL
693  };
694 
703 
710  {
712  StartDefault = OCI_DB_SPF_DEFAULT,
714  StartForce = OCI_DB_SPF_FORCE,
716  StartRestrict = OCI_DB_SPF_RESTRICT
717  };
718 
727 
734  {
736  ShutdownOnly = OCI_DB_SDM_SHUTDOWN,
738  ShutdownClose = OCI_DB_SDM_CLOSE,
740  ShutdownDismount = OCI_DB_SDM_DISMOUNT,
742  ShutdownFull = OCI_DB_SDM_FULL
743  };
744 
753 
760  {
763  ShutdowntDefault = OCI_DB_SDF_DEFAULT,
766  ShutdowTrans = OCI_DB_SDF_TRANS,
770  ShutdownTransLocal = OCI_DB_SDF_TRANS_LOCAL,
773  ShutdownImmediate = OCI_DB_SDF_IMMEDIATE,
779  ShutdownAbort = OCI_DB_SDF_ABORT
780  };
781 
790 
797  {
799  OracleClientBytes = OCI_MEM_ORACLE,
801  OcilibBytes = OCI_MEM_OCILIB,
803  AllBytes = OCI_MEM_ALL
804  };
805 
814 
822  typedef void(*HAHandlerProc) (Connection& con, HAEventSource eventSource, HAEventType eventType, Timestamp& time);
823 
843  static void Initialize(EnvironmentFlags mode = Environment::Default, const ostring& libpath = OTEXT(""));
844 
859  static void Cleanup();
860 
869  static Environment::EnvironmentFlags GetMode();
870 
876  static Environment::ImportMode GetImportMode();
877 
883  static Environment::CharsetMode GetCharset();
884 
894  static unsigned int GetCharMaxSize();
895 
903  static big_uint GetAllocatedBytes(AllocatedBytesFlags type);
904 
910  static bool Initialized();
911 
922  static OracleVersion GetCompileVersion();
923 
929  static unsigned int GetCompileMajorVersion();
930 
936  static unsigned int GetCompileMinorVersion();
937 
943  static unsigned int GetCompileRevisionVersion();
944 
954  static OracleVersion GetRuntimeVersion();
955 
961  static unsigned int GetRuntimeMajorVersion();
962 
968  static unsigned int GetRuntimeMinorVersion();
969 
975  static unsigned int GetRuntimeRevisionVersion();
976 
987  static void EnableWarnings(bool value);
988 
1020  static bool SetFormat(FormatType formatType, const ostring& format);
1021 
1032  static ostring GetFormat(FormatType formatType);
1033 
1060  static void StartDatabase(const ostring& db, const ostring& user, const ostring& pwd,
1061  Environment::StartFlags startFlags,
1062  Environment::StartMode startMode,
1063  Environment::SessionFlags sessionFlags = SessionSysDba,
1064  const ostring& spfile = OTEXT(""));
1065 
1091  static void ShutdownDatabase(const ostring& db, const ostring& user, const ostring& pwd,
1092  Environment::ShutdownFlags shutdownFlags,
1093  Environment::ShutdownMode shutdownMode,
1094  Environment::SessionFlags sessionFlags = SessionSysDba);
1095 
1106  static void ChangeUserPassword(const ostring& db, const ostring& user, const ostring& pwd, const ostring& newPwd);
1107 
1124  static void SetHAHandler(HAHandlerProc handler);
1125 
1126  private:
1127 
1128  class EnvironmentHandle : core::HandleHolder<OCI_Environment*>
1129  {
1130  friend class Environment;
1131  };
1132 
1133  static void HAHandler(OCI_Connection* pConnection, unsigned int source, unsigned int event, OCI_Timestamp* pTimestamp);
1134  static unsigned int TAFHandler(OCI_Connection* pConnection, unsigned int type, unsigned int event);
1135  static void NotifyHandler(OCI_Event* pEvent);
1136  static void NotifyHandlerAQ(OCI_Dequeue* pDequeue);
1137 
1138  template<class T>
1139  static T GetUserCallback(AnyPointer ptr);
1140 
1141  template<class T>
1142  static void SetUserCallback(AnyPointer ptr, T callback);
1143 
1144  static core::Handle* GetEnvironmentHandle();
1145  static Environment& GetInstance();
1146 
1147  Environment();
1148 
1149  void SelfInitialize(EnvironmentFlags mode, const ostring& libpath);
1150  void SelfCleanup();
1151 
1154  EnvironmentHandle _handle;
1155  EnvironmentFlags _mode;
1156  unsigned int _charMaxSize;
1157  bool _initialized;
1158  };
1159 
1170  class Thread
1171  {
1172  public:
1173 
1181 
1190  static ThreadHandle Create();
1191 
1199  static void Destroy(ThreadHandle handle);
1200 
1210  static void Run(ThreadHandle handle, ThreadProc func, AnyPointer arg);
1211 
1222  static void Join(ThreadHandle handle);
1223 
1231  static ThreadId GetThreadId(ThreadHandle handle);
1232  };
1233 
1243  class Mutex
1244  {
1245  public:
1246 
1255  static MutexHandle Create();
1256 
1264  static void Destroy(MutexHandle handle);
1265 
1273  static void Acquire(MutexHandle handle);
1274 
1282  static void Release(MutexHandle handle);
1283  };
1284 
1296  {
1297  public:
1298 
1306 
1319  static void Create(const ostring& name, ThreadKeyFreeProc freeProc = nullptr);
1320 
1329  static void SetValue(const ostring& name, AnyPointer value);
1330 
1341  static AnyPointer GetValue(const ostring& name);
1342  };
1343 
1351  class Pool : public core::HandleHolder<OCI_Pool*>
1352  {
1353  public:
1354 
1361  {
1363  ConnectionPool = OCI_POOL_CONNECTION,
1365  SessionPool = OCI_POOL_SESSION
1366  };
1367 
1376 
1382  Pool();
1383 
1401  Pool(const ostring& db, const ostring& user, const ostring& pwd, Pool::PoolType poolType,
1402  unsigned int minSize, unsigned int maxSize, unsigned int increment = 1,
1404 
1423  void Open(const ostring& db, const ostring& user, const ostring& pwd, Pool::PoolType poolType,
1424  unsigned int minSize, unsigned int maxSize, unsigned int increment = 1,
1426 
1432  void Close();
1433 
1462  Connection GetConnection(const ostring& sessionTag = OTEXT(""));
1463 
1475  unsigned int GetTimeout() const;
1476 
1490  void SetTimeout(unsigned int value);
1491 
1501  bool GetNoWait() const;
1502 
1515  void SetNoWait(bool value);
1516 
1522  unsigned int GetBusyConnectionsCount() const;
1523 
1529  unsigned int GetOpenedConnectionsCount() const;
1530 
1536  unsigned int GetMinSize() const;
1537 
1543  unsigned int GetMaxSize() const;
1544 
1550  unsigned int GetIncrement() const;
1551 
1560  unsigned int GetStatementCacheSize() const;
1561 
1569  void SetStatementCacheSize(unsigned int value);
1570  };
1571 
1579  class Connection : public core::HandleHolder<OCI_Connection*>
1580  {
1581  friend class Environment;
1582  friend class Exception;
1583  friend class Statement;
1584  friend class File;
1585  friend class Timestamp;
1586  friend class Pool;
1587  friend class Object;
1588  friend class TypeInfo;
1589  friend class Reference;
1590  friend class Resultset;
1591  friend class Subscription;
1592  friend class Agent;
1593  friend class Dequeue;
1594  friend class Enqueue;
1595  friend class Column;
1596  friend class Message;
1597  friend class DirectPath;
1598 
1599  template<class, int>
1600  friend class Lob;
1601  template<class>
1602  friend class Collection;
1603  public:
1604 
1611  {
1616  TimeoutSend = OCI_NTO_SEND,
1621  TimeoutReceive = OCI_NTO_RECEIVE,
1626  TimeoutCall = OCI_NTO_CALL
1627  };
1628 
1637 
1644  {
1646  FailoverRequestSession = OCI_FOT_SESSION,
1648  FailoverRequestSelect = OCI_FOT_SELECT
1649  };
1650 
1659 
1666  {
1668  FailoverEventEnd = OCI_FOE_END,
1670  FailoverEventAbort = OCI_FOE_ABORT,
1672  FailoverEventReauthentificate = OCI_FOE_REAUTH,
1674  FailoverEventBegin = OCI_FOE_BEGIN,
1676  FailoverEventError = OCI_FOE_ERROR
1677  };
1678 
1687 
1694  {
1696  FailoverOk = OCI_FOC_OK,
1698  FailoverRetry = OCI_FOC_RETRY
1699  };
1700 
1709 
1716  {
1718  TraceIdentity = OCI_TRC_IDENTITY,
1720  TraceModule = OCI_TRC_MODULE,
1722  TraceAction = OCI_TRC_ACTION,
1724  TraceDetail = OCI_TRC_DETAIL
1725  };
1726 
1735 
1743  typedef FailoverResult(*TAFHandlerProc) (Connection& con, FailoverRequest failoverRequest, FailoverEvent failoverEvent);
1744 
1750  Connection();
1751 
1765  Connection(const ostring& db, const ostring& user, const ostring& pwd, Environment::SessionFlags sessionFlags = Environment::SessionDefault);
1766 
1809  void Open(const ostring& db, const ostring& user, const ostring& pwd, Environment::SessionFlags sessionFlags = Environment::SessionDefault);
1810 
1816  void Close();
1817 
1823  void Commit();
1824 
1830  void Rollback();
1831 
1840  void Break();
1841 
1849  void SetAutoCommit(bool enabled);
1850 
1856  bool GetAutoCommit() const;
1857 
1866  bool IsServerAlive() const;
1867 
1876  bool PingServer() const;
1877 
1886  ostring GetConnectionString() const;
1887 
1896  ostring GetUserName() const;
1897 
1906  ostring GetPassword() const;
1907 
1916  ostring GetServerVersion() const;
1917 
1926  OracleVersion GetVersion() const;
1927 
1933  unsigned int GetServerMajorVersion() const;
1934 
1940  unsigned int GetServerMinorVersion() const;
1941 
1947  unsigned int GetServerRevisionVersion() const;
1948 
1956  void ChangePassword(const ostring& newPwd);
1957 
1963  ostring GetSessionTag() const;
1964 
1979  void SetSessionTag(const ostring& tag);
1980 
1986  Transaction GetTransaction() const;
1987 
2001  void SetTransaction(const Transaction& transaction);
2002 
2034  bool SetFormat(FormatType formatType, const ostring& format);
2035 
2046  ostring GetFormat(FormatType formatType);
2047 
2067  void EnableServerOutput(unsigned int bufsize, unsigned int arrsize, unsigned int lnsize);
2068 
2077  void DisableServerOutput();
2078 
2087  bool GetServerOutput(ostring& line) const;
2088 
2094  void GetServerOutput(std::vector<ostring>& lines) const;
2095 
2124  void SetTrace(SessionTrace trace, const ostring& value);
2125 
2136  ostring GetTrace(SessionTrace trace) const;
2137 
2146  ostring GetDatabase() const;
2147 
2156  ostring GetInstance() const;
2157 
2166  ostring GetService() const;
2167 
2176  ostring GetServer() const;
2177 
2186  ostring GetDomain() const;
2187 
2196  Timestamp GetInstanceStartTime() const;
2197 
2209  unsigned int GetStatementCacheSize() const;
2210 
2221  void SetStatementCacheSize(unsigned int value);
2222 
2239  unsigned int GetDefaultLobPrefetchSize() const;
2240 
2265  void SetDefaultLobPrefetchSize(unsigned int value);
2266 
2281  unsigned int GetMaxCursors() const;
2282 
2291  bool IsTAFCapable() const;
2292 
2306  void SetTAFHandler(TAFHandlerProc handler);
2307 
2313  AnyPointer GetUserData();
2314 
2322  void SetUserData(AnyPointer value);
2323 
2337  unsigned int GetTimeout(TimeoutType timeout);
2338 
2366  void SetTimeout(TimeoutType timeout, unsigned int value);
2367 
2368  private:
2369 
2370  Connection(OCI_Connection* con, core::Handle* parent);
2371  };
2372 
2380  class Transaction : public core::HandleHolder<OCI_Transaction*>
2381  {
2382  friend class Connection;
2383 
2384  public:
2385 
2392  {
2393  Unknown = OCI_UNKNOWN,
2395  New = OCI_TRS_NEW,
2397  Tight = OCI_TRS_TIGHT,
2399  Loose = OCI_TRS_LOOSE,
2401  ReadOnly = OCI_TRS_READONLY,
2403  ReadWrite = OCI_TRS_READWRITE,
2405  Serializable = OCI_TRS_SERIALIZABLE
2406  };
2407 
2416 
2430  Transaction(const Connection& connection, unsigned int timeout, TransactionFlags flags, OCI_XID* pxid = nullptr);
2431 
2437  void Prepare();
2438 
2444  void Start();
2445 
2451  void Stop();
2452 
2458  void Resume();
2459 
2465  void Forget();
2466 
2475  TransactionFlags GetFlags() const;
2476 
2482  unsigned int GetTimeout() const;
2483 
2484  private:
2485 
2486  Transaction(OCI_Transaction* trans);
2487  };
2488 
2499  class Number : public core::HandleHolder<OCI_Number*>, public core::Streamable
2500  {
2501  friend class Statement;
2502  friend class Resultset;
2503  friend class support::BindArray;
2504  friend class Object;
2505  template<class>
2506  friend class Collection;
2507 
2508  public:
2509 
2517  Number(bool create = false);
2518 
2533  Number(const otext* str, const otext* format = OTEXT(""));
2534 
2549  Number(const ostring& str, const ostring& format = OTEXT(""));
2550 
2565  void FromString(const ostring& str, const ostring& format = OTEXT("")) const;
2566 
2577  ostring ToString(const ostring& format) const;
2578 
2587  ostring ToString() const override;
2588 
2594  Number Clone() const;
2595 
2596  Number& operator ++ ();
2597  Number& operator -- ();
2598  Number operator ++ (int);
2599  Number operator -- (int);
2600 
2601  bool operator == (const Number& other) const;
2602  bool operator != (const Number& other) const;
2603  bool operator > (const Number& other) const;
2604  bool operator < (const Number& other) const;
2605  bool operator >= (const Number& other) const;
2606  bool operator <= (const Number& other) const;
2607 
2608  template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2609  Number& operator = (const T& lhs);
2610 
2611  template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2612  operator T() const;
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  template<class T, typename core::SupportedNumeric<T>::Type::type* = nullptr>
2636  Number& operator /= (const T& value);
2637 
2638  private:
2639 
2640  template<class T>
2641  static AnyPointer GetNativeValue(const T& value);
2642 
2643  Number(OCI_Number* pNumber, core::Handle* parent = nullptr);
2644 
2645  void Allocate();
2646 
2647  int Compare(const Number& other) const;
2648 
2649  template<class T>
2650  inline T GetValue() const;
2651 
2652  template<class T>
2653  Number& SetValue(const T& value);
2654 
2655  template<class T>
2656  void Add(const T& value);
2657 
2658  template<class T>
2659  void Sub(const T& value);
2660 
2661  template<class T>
2662  void Multiply(const T& value);
2663 
2664  template<class T>
2665  void Divide(const T& value);
2666 
2667  Number& operator = (OCI_Number*& lhs);
2668  };
2669 
2677  class Date : public core::HandleHolder<OCI_Date*>, public core::Streamable
2678  {
2679  friend class Statement;
2680  friend class Resultset;
2681  friend class support::BindArray;
2682  friend class Object;
2683  template<class>
2684  friend class Collection;
2685  friend class Message;
2686 
2687  public:
2688 
2694  static Date SysDate();
2695 
2703  Date(bool create = false);
2704 
2719  Date(const otext* str, const otext* format = OTEXT(""));
2720 
2736  Date(const ostring& str, const ostring& format = OTEXT(""));
2737 
2743  bool IsValid() const;
2744 
2750  int GetYear() const;
2751 
2757  void SetYear(int value);
2758 
2764  int GetMonth() const;
2765 
2771  void SetMonth(int value);
2772 
2778  int GetDay() const;
2779 
2785  void SetDay(int value);
2786 
2792  int GetHours() const;
2793 
2799  void SetHours(int value);
2800 
2806  int GetMinutes() const;
2807 
2813  void SetMinutes(int value);
2814 
2820  int GetSeconds() const;
2821 
2827  void SetSeconds(int value);
2828 
2836  int DaysBetween(const Date& other) const;
2837 
2847  void SetDate(int year, int month, int day);
2848 
2858  void SetTime(int hour, int min, int sec);
2859 
2872  void SetDateTime(int year, int month, int day, int hour, int min, int sec);
2873 
2883  void GetDate(int& year, int& month, int& day) const;
2884 
2894  void GetTime(int& hour, int& min, int& sec) const;
2895 
2908  void GetDateTime(int& year, int& month, int& day, int& hour, int& min, int& sec) const;
2909 
2917  void AddDays(int days);
2918 
2926  void AddMonths(int months);
2927 
2935  Date NextDay(const ostring& day) const;
2936 
2942  Date LastDay() const;
2943 
2952  void ChangeTimeZone(const ostring& tzSrc, const ostring& tzDst);
2953 
2968  void FromString(const ostring& str, const ostring& format = OTEXT(""));
2969 
2980  ostring ToString(const ostring& format) const;
2981 
2990  ostring ToString() const override;
2991 
2997  Date Clone() const;
2998 
3004  Date& operator ++ ();
3005 
3011  Date operator ++ (int);
3012 
3018  Date& operator -- ();
3019 
3025  Date operator -- (int);
3026 
3032  Date operator + (int value) const;
3033 
3039  Date operator - (int value) const;
3040 
3046  Date& operator += (int value);
3047 
3053  Date& operator -= (int value);
3054 
3060  bool operator == (const Date& other) const;
3061 
3067  bool operator != (const Date& other) const;
3068 
3074  bool operator > (const Date& other) const;
3075 
3081  bool operator < (const Date& other) const;
3082 
3088  bool operator >= (const Date& other) const;
3089 
3095  bool operator <= (const Date& other) const;
3096 
3097  private:
3098 
3099  int Compare(const Date& other) const;
3100 
3101  Date(OCI_Date* pDate, core::Handle* parent = nullptr);
3102 
3103  void Allocate();
3104  };
3105 
3113  class Interval : public core::HandleHolder<OCI_Interval*>, public core::Streamable
3114  {
3115  friend class Environment;
3116  friend class Statement;
3117  friend class Resultset;
3118  friend class support::BindArray;
3119  friend class Object;
3120  template<class>
3121  friend class Collection;
3122 
3123  public:
3124 
3131  {
3133  YearMonth = OCI_INTERVAL_YM,
3135  DaySecond = OCI_INTERVAL_DS
3136  };
3137 
3146 
3152  Interval();
3153 
3161  Interval(IntervalType type);
3162 
3174  Interval(IntervalType type, const ostring& data);
3175 
3181  IntervalType GetType() const;
3182 
3188  bool IsValid() const;
3189 
3198  int GetYear() const;
3199 
3208  void SetYear(int value);
3209 
3218  int GetMonth() const;
3219 
3228  void SetMonth(int value);
3229 
3238  int GetDay() const;
3239 
3248  void SetDay(int value);
3249 
3258  int GetHours() const;
3259 
3268  void SetHours(int value);
3269 
3278  int GetMinutes() const;
3279 
3288  void SetMinutes(int value);
3289 
3298  int GetSeconds() const;
3299 
3308  void SetSeconds(int value);
3309 
3315  int GetMilliSeconds() const;
3316 
3322  void SetMilliSeconds(int value);
3323 
3338  void GetDaySecond(int& day, int& hour, int& min, int& sec, int& fsec) const;
3339 
3354  void SetDaySecond(int day, int hour, int min, int sec, int fsec);
3355 
3367  void GetYearMonth(int& year, int& month) const;
3368 
3380  void SetYearMonth(int year, int month);
3381 
3389  void UpdateTimeZone(const ostring& timeZone);
3390 
3401  void FromString(const ostring& data);
3402 
3411  ostring ToString(int leadingPrecision, int fractionPrecision) const;
3412 
3418  ostring ToString() const override;
3419 
3425  Interval Clone() const;
3426 
3432  Interval operator + (const Interval& other) const;
3433 
3439  Interval operator - (const Interval& other) const;
3440 
3446  Interval& operator += (const Interval& other);
3447 
3453  Interval& operator -= (const Interval& other);
3454 
3460  bool operator == (const Interval& other) const;
3461 
3467  bool operator != (const Interval& other) const;
3468 
3474  bool operator > (const Interval& other) const;
3475 
3481  bool operator < (const Interval& other) const;
3482 
3488  bool operator >= (const Interval& other) const;
3489 
3495  bool operator <= (const Interval& other) const;
3496 
3497  private:
3498 
3499  int Compare(const Interval& other) const;
3500 
3501  Interval(OCI_Interval* pInterval, core::Handle* parent = nullptr);
3502  };
3503 
3512  class Timestamp : public core::HandleHolder<OCI_Timestamp*>, public core::Streamable
3513  {
3514  friend class Environment;
3515  friend class Statement;
3516  friend class Resultset;
3517  friend class support::BindArray;
3518  friend class Object;
3519  friend class Connection;
3520  template<class>
3521  friend class Collection;
3522 
3523  public:
3524 
3531  {
3533  NoTimeZone = OCI_TIMESTAMP,
3535  WithTimeZone = OCI_TIMESTAMP_TZ,
3537  WithLocalTimeZone = OCI_TIMESTAMP_LTZ
3538  };
3539 
3548 
3556  static Timestamp SysTimestamp(TimestampType type = NoTimeZone);
3557 
3563  Timestamp();
3564 
3572  Timestamp(TimestampType type);
3573 
3586  Timestamp(TimestampType type, const ostring& data, const ostring& format = OTEXT(""));
3587 
3593  TimestampType GetType() const;
3594 
3602  void Convert(const Timestamp& other);
3603 
3609  bool IsValid() const;
3610 
3616  int GetYear() const;
3617 
3623  void SetYear(int value);
3624 
3630  int GetMonth() const;
3631 
3637  void SetMonth(int value);
3638 
3644  int GetDay() const;
3645 
3651  void SetDay(int value);
3652 
3658  int GetHours() const;
3659 
3665  void SetHours(int value);
3666 
3672  int GetMinutes() const;
3673 
3679  void SetMinutes(int value);
3680 
3686  int GetSeconds() const;
3687 
3693  void SetSeconds(int value);
3694 
3700  int GetMilliSeconds() const;
3701 
3707  void SetMilliSeconds(int value);
3708 
3718  void GetDate(int& year, int& month, int& day) const;
3719 
3730  void GetTime(int& hour, int& min, int& sec, int& fsec) const;
3731 
3741  void SetDate(int year, int month, int day);
3742 
3753  void SetTime(int hour, int min, int sec, int fsec);
3754 
3768  void GetDateTime(int& year, int& month, int& day, int& hour, int& min, int& sec, int& fsec) const;
3769 
3784  void SetDateTime(int year, int month, int day, int hour, int min, int sec, int fsec, const ostring& timeZone = OTEXT(""));
3785 
3794  ostring GetTimeZone() const;
3795 
3805  void SetTimeZone(const ostring& timeZone);
3806 
3815  void GetTimeZoneOffset(int& hour, int& min) const;
3816 
3829  static void Substract(const Timestamp& lsh, const Timestamp& rsh, Interval& result);
3830 
3842  void FromString(const ostring& data, const ostring& format = OCI_STRING_FORMAT_DATE);
3843 
3855  ostring ToString(const ostring& format, int precision) const;
3856 
3862  ostring ToString() const override;
3863 
3869  Timestamp Clone() const;
3870 
3876  Timestamp& operator ++ ();
3877 
3883  Timestamp operator ++ (int);
3884 
3890  Timestamp& operator -- ();
3891 
3897  Timestamp operator -- (int);
3898 
3904  Timestamp operator + (int value) const;
3905 
3911  Timestamp operator - (int value) const;
3912 
3918  Interval operator - (const Timestamp& other);
3919 
3925  Timestamp& operator += (int value);
3926 
3932  Timestamp& operator -= (int value);
3933 
3939  Timestamp operator + (const Interval& other) const;
3940 
3946  Timestamp operator - (const Interval& other) const;
3947 
3953  Timestamp& operator += (const Interval& other);
3954 
3960  Timestamp& operator -= (const Interval& other);
3961 
3967  bool operator == (const Timestamp& other) const;
3968 
3974  bool operator != (const Timestamp& other) const;
3975 
3981  bool operator > (const Timestamp& other) const;
3982 
3988  bool operator < (const Timestamp& other) const;
3989 
3995  bool operator >= (const Timestamp& other) const;
3996 
4002  bool operator <= (const Timestamp& other) const;
4003 
4004  private:
4005 
4006  int Compare(const Timestamp& other) const;
4007 
4008  Timestamp(OCI_Timestamp* pTimestamp, core::Handle* parent = nullptr);
4009  };
4010 
4018  template<class T, int U>
4019  class Lob : public core::HandleHolder<OCI_Lob*>
4020  {
4021  friend class Statement;
4022  friend class Resultset;
4023  friend class support::BindArray;
4024  friend class Object;
4025  template<class>
4026  friend class Collection;
4027 
4028  public:
4029 
4035  Lob();
4036 
4047  Lob(const Connection& connection);
4048 
4059  T Read(unsigned int length);
4060 
4071  unsigned int Write(const T& content);
4072 
4083  unsigned int Append(const T& content);
4084 
4092  void Append(const Lob& other);
4093 
4108  bool Seek(SeekMode seekMode, big_uint offset);
4109 
4115  LobType GetType() const;
4116 
4122  big_uint GetOffset() const;
4123 
4129  big_uint GetLength() const;
4130 
4136  big_uint GetMaxSize() const;
4137 
4149  big_uint GetChunkSize() const;
4150 
4156  Connection GetConnection() const;
4157 
4165  void Truncate(big_uint length);
4166 
4182  big_uint Erase(big_uint offset, big_uint length);
4183 
4197  void Copy(Lob& dest, big_uint offset, big_uint offsetDest, big_uint length) const;
4198 
4204  bool IsTemporary() const;
4205 
4211  bool IsRemote() const;
4212 
4225  void Open(OpenMode mode);
4226 
4232  void Flush();
4233 
4242  void Close();
4243 
4262  void EnableBuffering(bool value);
4263 
4269  Lob Clone() const;
4270 
4276  Lob& operator += (const Lob& other);
4277 
4283  bool operator == (const Lob& other) const;
4284 
4290  bool operator != (const Lob& other) const;
4291 
4292  private:
4293 
4294  bool Equals(const Lob& other) const;
4295 
4296  Lob(OCI_Lob* pLob, core::Handle* parent = nullptr);
4297 
4298  };
4299 
4310 
4321 
4332 
4341  class File : public core::HandleHolder<OCI_File*>
4342  {
4343  friend class Statement;
4344  friend class Resultset;
4345  friend class support::BindArray;
4346  friend class Object;
4347  template<class>
4348  friend class Collection;
4349 
4350  public:
4351 
4357  File();
4358 
4369  File(const Connection& connection);
4370 
4385  File(const Connection& connection, const ostring& directory, const ostring& name);
4386 
4397  Raw Read(unsigned int size);
4398 
4413  bool Seek(SeekMode seekMode, big_uint offset);
4414 
4423  bool Exists() const;
4424 
4430  big_uint GetOffset() const;
4431 
4437  big_uint GetLength() const;
4438 
4444  Connection GetConnection() const;
4445 
4458  void SetInfos(const ostring& directory, const ostring& name);
4459 
4465  ostring GetName() const;
4466 
4472  ostring GetDirectory() const;
4473 
4479  void Open();
4480 
4486  void Close();
4487 
4493  bool IsOpened() const;
4494 
4500  File Clone() const;
4501 
4507  bool operator == (const File& other) const;
4508 
4514  bool operator != (const File& other) const;
4515 
4516  private:
4517 
4518  bool Equals(const File& other) const;
4519 
4520  File(OCI_File* pFile, core::Handle* parent = nullptr);
4521  };
4522 
4530  class TypeInfo : public core::HandleHolder<OCI_TypeInfo*>
4531  {
4532  friend class Object;
4533  friend class Reference;
4534  template<class>
4535  friend class Collection;
4536  friend class Column;
4537  public:
4538 
4545  {
4547  Table = OCI_TIF_TABLE,
4549  View = OCI_TIF_VIEW,
4551  Type = OCI_TIF_TYPE
4552  };
4553 
4562 
4575  TypeInfo(const Connection& connection, const ostring& name, TypeInfoType type);
4576 
4582  TypeInfoType GetType() const;
4583 
4589  ostring GetName() const;
4590 
4596  Connection GetConnection() const;
4597 
4607  unsigned int GetColumnCount() const;
4608 
4623  Column GetColumn(unsigned int index) const;
4624 
4637  boolean IsFinalType() const;
4638 
4653  TypeInfo GetSuperType() const;
4654 
4655  private:
4656 
4657  TypeInfo(OCI_TypeInfo* pTypeInfo, core::Handle* parent);
4658  };
4659 
4667  class Object : public core::HandleHolder<OCI_Object*>, public core::Streamable
4668  {
4669  friend class Statement;
4670  friend class Resultset;
4671  friend class support::BindArray;
4672  friend class Reference;
4673  template<class>
4674  friend class Collection;
4675  friend class Message;
4676 
4677  public:
4678 
4685  {
4687  Persistent = OCI_OBJ_PERSISTENT,
4689  Transient = OCI_OBJ_TRANSIENT,
4691  Value = OCI_OBJ_VALUE
4692  };
4693 
4702 
4708  Object();
4709 
4717  Object(const TypeInfo& typeInfo);
4718 
4726  bool IsAttributeNull(const ostring& name) const;
4727 
4735  void SetAttributeNull(const ostring& name);
4736 
4742  TypeInfo GetTypeInfo() const;
4743 
4749  Reference GetReference() const;
4750 
4756  ObjectType GetType() const;
4757 
4770  template<class T>
4771  T Get(const ostring& name) const;
4772 
4786  template<class T>
4787  void Get(const ostring& name, T& value) const;
4788 
4802  template<class T>
4803  void Get(const ostring& name, Collection<T>& value) const;
4804 
4818  template<class T>
4819  void Set(const ostring& name, const T& value);
4820 
4826  Object Clone() const;
4827 
4833  ostring ToString() const override;
4834 
4835  private:
4836 
4837  Object(OCI_Object* pObject, core::Handle* parent = nullptr);
4838  };
4839 
4847  class Reference : public core::HandleHolder<OCI_Ref*>, public core::Streamable
4848  {
4849  friend class Statement;
4850  friend class Resultset;
4851  friend class support::BindArray;
4852  friend class Object;
4853  template<class>
4854  friend class Collection;
4855 
4856  public:
4857 
4863  Reference();
4864 
4872  Reference(const TypeInfo& typeInfo);
4873 
4879  TypeInfo GetTypeInfo() const;
4880 
4889  Object GetObject() const;
4890 
4896  bool IsReferenceNull() const;
4897 
4906  void SetReferenceNull();
4907 
4913  Reference Clone() const;
4914 
4920  ostring ToString() const override;
4921 
4922  private:
4923 
4924  Reference(OCI_Ref* pRef, core::Handle* parent = nullptr);
4925  };
4926 
4935  template<class T>
4937  {
4938  template<class>
4939  friend class CollectionIterator;
4940 
4941  public:
4942 
4943  typedef T ValueType;
4945 
4947  CollectionElement(CollectionType* coll, unsigned int pos);
4948  operator T() const;
4949  CollectionElement& operator = (const ValueType& other);
4950  CollectionElement& operator = (const CollectionElement& other);
4951  bool IsNull() const;
4952  void SetNull();
4953 
4954  private:
4955 
4956  CollectionType* _coll;
4957  unsigned int _pos;
4958  };
4959 
4967  template<class T>
4969  {
4970  public:
4971 
4972  template<class>
4973  friend class Collection;
4974 
4975  typedef typename T::ValueType value_type;
4977 
4978  typedef std::random_access_iterator_tag iterator_category;
4979  typedef ptrdiff_t difference_type;
4980  typedef ptrdiff_t distance_type;
4981  typedef value_type* pointer;
4982  typedef value_type& reference;
4983 
4985  CollectionIterator(const CollectionIterator& other);
4986 
4987  CollectionIterator& operator = (const CollectionIterator& other);
4988 
4989  CollectionIterator& operator += (difference_type value);
4990  CollectionIterator& operator -= (difference_type value);
4991 
4992  T& operator*();
4993  T* operator->();
4994 
4995  CollectionIterator& operator++();
4996  CollectionIterator& operator--();
4997 
4998  CollectionIterator operator++(int);
4999  CollectionIterator operator--(int);
5000 
5001  CollectionIterator operator + (difference_type value);
5002  CollectionIterator operator - (difference_type value);
5003 
5004  difference_type operator - (const CollectionIterator& other);
5005 
5006  bool operator == (const CollectionIterator& other);
5007  bool operator != (const CollectionIterator& other);
5008  bool operator > (const CollectionIterator& other);
5009  bool operator < (const CollectionIterator& other);
5010  bool operator >= (const CollectionIterator& other);
5011  bool operator <= (const CollectionIterator& other);
5012 
5013  protected:
5014 
5015  CollectionIterator(CollectionType* collection, unsigned int pos);
5016 
5017  T _elem;
5018  };
5019 
5027  template<class T>
5028  class Collection : public core::HandleHolder<OCI_Coll*>, public core::Streamable
5029  {
5030  friend class Statement;
5031  friend class Resultset;
5032  friend class support::BindArray;
5033  friend class Object;
5034  template<class>
5035  friend class CollectionIterator;
5036  template<class>
5037  friend class Collection;
5038 
5039  public:
5040 
5047  {
5049  Varray = OCI_COLL_VARRAY,
5051  NestedTable = OCI_COLL_NESTED_TABLE,
5053  IndexedTable = OCI_COLL_INDEXED_TABLE
5054  };
5055 
5064 
5070  Collection();
5071 
5079  Collection(const TypeInfo& typeInfo);
5080 
5086  CollectionType GetType() const;
5087 
5093  unsigned int GetMax() const;
5094 
5100  unsigned int GetSize() const;
5101 
5112  unsigned int GetCount() const;
5113 
5121  void Truncate(unsigned int size);
5122 
5129  void Clear();
5130 
5141  bool IsElementNull(unsigned int index) const;
5142 
5153  void SetElementNull(unsigned int index);
5154 
5172  bool Delete(unsigned int index) const;
5173 
5181  T Get(unsigned int index) const;
5182 
5191  void Set(unsigned int index, const T& value);
5192 
5201  void Append(const T& value);
5202 
5208  TypeInfo GetTypeInfo() const;
5209 
5215  Collection Clone() const;
5216 
5222  ostring ToString() const override;
5223 
5230 
5237 
5243  iterator begin();
5244 
5250  const_iterator begin() const;
5251 
5257  iterator end();
5258 
5264  const_iterator end() const;
5265 
5271  CollectionElement<T> operator [] (unsigned int index);
5272 
5278  CollectionElement<T> operator [](unsigned int index) const;
5279 
5280  private:
5281 
5282  static T GetElem(OCI_Elem* elem, core::Handle* parent);
5283 
5284  static void SetElem(OCI_Elem* elem, const T& value);
5285 
5286  Collection(OCI_Coll* pColl, core::Handle* parent = nullptr);
5287  };
5288 
5296  template<class T, int U>
5297  class Long : public core::HandleHolder<OCI_Long*>
5298  {
5299  friend class Statement;
5300  friend class Resultset;
5301  friend class support::BindArray;
5302 
5303  public:
5304 
5310  Long();
5311 
5319  Long(const Statement& statement);
5320 
5331  unsigned int Write(const T& content);
5332 
5338  unsigned int GetLength() const;
5339 
5345  T GetContent() const;
5346 
5347  private:
5348 
5349  Long(OCI_Long* pLong, core::Handle* parent = nullptr);
5350  };
5351 
5362 
5373 
5381  class BindInfo : public core::HandleHolder<OCI_Bind*>
5382  {
5383  friend class Statement;
5384 
5385  public:
5386 
5393  {
5395  In = OCI_BDM_IN,
5397  Out = OCI_BDM_OUT,
5399  InOut = OCI_BDM_IN_OUT
5400  };
5401 
5410 
5417  {
5419  AsArray = 1,
5421  AsPlSqlTable = 2
5422  };
5423 
5432 
5438  ostring GetName() const;
5439 
5445  DataType GetType() const;
5446 
5466  unsigned int GetSubType() const;
5467 
5477  unsigned int GetDataCount() const;
5478 
5484  Statement GetStatement() const;
5485 
5506  void SetDataNull(bool value, unsigned int index = 1);
5507 
5522  bool IsDataNull(unsigned int index = 1) const;
5523 
5537  void SetCharsetForm(CharsetForm value);
5538 
5544  BindDirection GetDirection() const;
5545 
5546  private:
5547 
5548  BindInfo(OCI_Bind* pBind, core::Handle* parent);
5549  };
5550 
5558  class Statement : public core::HandleHolder<OCI_Statement*>
5559  {
5560  friend class Exception;
5561  friend class Resultset;
5562  template<class, int>
5563  friend class Long;
5564  friend class BindInfo;
5565  friend class BindObject;
5566 
5567  public:
5568 
5575  {
5577  TypeSelect = OCI_CST_SELECT,
5579  TypeUpdate = OCI_CST_UPDATE,
5581  TypeDelete = OCI_CST_DELETE,
5583  TypeInsert = OCI_CST_INSERT,
5585  TypeCreate = OCI_CST_CREATE,
5587  TypeDrop = OCI_CST_DROP,
5589  TypeAlter = OCI_CST_ALTER,
5591  TypeBegin = OCI_CST_BEGIN,
5593  TypeDeclare = OCI_CST_DECLARE,
5595  TypeCall = OCI_CST_CALL,
5597  TypeMerge = OCI_CST_MERGE
5598  };
5599 
5608 
5615  {
5617  FetchForward = OCI_SFM_DEFAULT,
5619  FetchScrollable = OCI_SFM_SCROLLABLE
5620  };
5621 
5630 
5637  {
5639  BindByPosition = OCI_BIND_BY_POS,
5641  BindByName = OCI_BIND_BY_NAME
5642  };
5643 
5652 
5659  {
5661  LongExplicit = OCI_LONG_EXPLICIT,
5663  LongImplicit = OCI_LONG_IMPLICIT
5664  };
5665 
5674 
5680  Statement();
5681 
5692  Statement(const Connection& connection);
5693 
5699  Connection GetConnection() const;
5700 
5727  void Describe(const ostring& sql);
5728 
5752  void Parse(const ostring& sql);
5753 
5764  void Prepare(const ostring& sql);
5765 
5771  void ExecutePrepared();
5772 
5780  void Execute(const ostring& sql);
5781 
5799  template<class T>
5800  unsigned int ExecutePrepared(T callback);
5801 
5822  template<class T, class U>
5823  unsigned int ExecutePrepared(T callback, U adapter);
5824 
5843  template<class T>
5844  unsigned int Execute(const ostring& sql, T callback);
5845 
5867  template<class T, class U>
5868  unsigned int Execute(const ostring& sql, T callback, U adapter);
5869 
5884  unsigned int GetAffectedRows() const;
5885 
5891  ostring GetSql() const;
5892 
5898  ostring GetSqlIdentifier() const;
5899 
5911  Resultset GetResultset();
5912 
5934  Resultset GetNextResultset();
5935 
5960  void SetBindArraySize(unsigned int size);
5961 
5967  unsigned int GetBindArraySize() const;
5968 
5984  void AllowRebinding(bool value);
5985 
5994  bool IsRebindingAllowed() const;
5995 
6012  unsigned int GetBindIndex(const ostring& name) const;
6013 
6019  unsigned int GetBindCount() const;
6020 
6035  BindInfo GetBind(unsigned int index) const;
6036 
6047  BindInfo GetBind(const ostring& name) const;
6048 
6068  template<class T>
6069  void Bind(const ostring& name, T& value, BindInfo::BindDirection mode);
6070 
6092  template<class T, class U>
6093  void Bind(const ostring& name, T& value, U extraInfo, BindInfo::BindDirection mode);
6094 
6106  template<class T>
6107  void Bind(const ostring& name, Collection<T>& value, BindInfo::BindDirection mode);
6108 
6129  template<class T>
6130  void Bind(const ostring& name, std::vector<T>& values, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6131 
6152  template<class T>
6153  void Bind(const ostring& name, std::vector<T>& values, TypeInfo& typeInfo, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6154 
6168  template<class T>
6169  void Bind(const ostring& name, std::vector<Collection<T> >& values, TypeInfo& typeInfo, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6170 
6194  template<class T, class U>
6195  void Bind(const ostring& name, std::vector<T>& values, U extraInfo, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6196 
6217  template<class T>
6218  void Register(const ostring& name);
6219 
6237  template<class T, class U>
6238  void Register(const ostring& name, U& extraInfo);
6239 
6258  template<class T, class U>
6259  void Register(const ostring& name, U extraInfo);
6260 
6266  StatementType GetStatementType() const;
6267 
6277  unsigned int GetSqlErrorPos() const;
6278 
6289  void SetFetchMode(FetchMode value);
6290 
6299  FetchMode GetFetchMode() const;
6300 
6308  void SetBindMode(BindMode value);
6309 
6318  BindMode GetBindMode() const;
6319 
6327  void SetFetchSize(unsigned int value);
6328 
6337  unsigned int GetFetchSize() const;
6338 
6349  void SetPrefetchSize(unsigned int value);
6350 
6359  unsigned int GetPrefetchSize() const;
6360 
6379  void SetPrefetchMemory(unsigned int value);
6380 
6389  unsigned int GetPrefetchMemory() const;
6390 
6398  void SetLongMaxSize(unsigned int value);
6399 
6408  unsigned int GetLongMaxSize() const;
6409 
6420  void SetLongMode(LongMode value);
6421 
6427  LongMode GetLongMode() const;
6428 
6441  unsigned int GetSQLCommand() const;
6442 
6455  ostring GetSQLVerb() const;
6456 
6462  void GetBatchErrors(std::vector<Exception>& exceptions);
6463 
6464  private:
6465 
6466  static bool IsResultsetHandle(core::Handle* handle);
6467  static void OnFreeSmartHandle(SmartHandle* smartHandle);
6468 
6469  Statement(OCI_Statement* stmt, core::Handle* parent = nullptr);
6470 
6471  support::BindsHolder* GetBindsHolder(bool create) const;
6472 
6473  void ReleaseResultsets() const;
6474 
6475  void SetLastBindMode(BindInfo::BindDirection mode);
6476 
6477  void SetInData() const;
6478  void SetOutData() const;
6479  void ClearBinds() const;
6480 
6481  template<typename M, class T>
6482  void Bind1(M& method, const ostring& name, T& value, BindInfo::BindDirection mode);
6483 
6484  template<typename M, class T>
6485  void Bind2(M& method, const ostring& name, T& value, BindInfo::BindDirection mode);
6486 
6487  template<typename M, class T>
6488  void BindVector1(M& method, const ostring& name, std::vector<T>& values, BindInfo::BindDirection mode, BindInfo::VectorType type);
6489 
6490  template<typename M, class T, class U>
6491  void BindVector2(M& method, const ostring& name, std::vector<T>& values, BindInfo::BindDirection mode, U subType, BindInfo::VectorType type);
6492 
6493  template<typename T>
6494  unsigned int Fetch(T callback);
6495 
6496  template<typename T, typename U>
6497  unsigned int Fetch(T callback, U adapter);
6498  };
6499 
6507  class Resultset : public core::HandleHolder<OCI_Resultset*>
6508  {
6509  friend class Statement;
6510  public:
6511 
6518  {
6520  SeekAbsolute = OCI_SFD_ABSOLUTE,
6522  SeekRelative = OCI_SFD_RELATIVE
6523  };
6524 
6533 
6546  template<class T>
6547  T Get(unsigned int index) const;
6548 
6562  template<class T>
6563  void Get(unsigned int index, T& value) const;
6564 
6577  template<class T>
6578  T Get(const ostring& name) const;
6579 
6590  template<class T>
6591  void Get(const ostring& name, T& value) const;
6592 
6607  template<class T, class U>
6608  bool Get(T& value, U adapter) const;
6609 
6625  template<typename T>
6626  unsigned int ForEach(T callback);
6627 
6650  template<typename T, typename U>
6651  unsigned int ForEach(T callback, U adapter);
6652 
6666  bool Next();
6667 
6681  bool Prev();
6682 
6694  bool First();
6695 
6707  bool Last();
6708 
6729  bool Seek(SeekMode mode, int offset);
6730 
6736  unsigned int GetCount() const;
6737 
6748  unsigned int GetCurrentRow() const;
6749 
6763  unsigned int GetColumnIndex(const ostring& name) const;
6764 
6770  unsigned int GetColumnCount() const;
6771 
6782  Column GetColumn(unsigned int index) const;
6783 
6794  Column GetColumn(const ostring& name) const;
6795 
6806  bool IsColumnNull(unsigned int index) const;
6807 
6815  bool IsColumnNull(const ostring& name) const;
6816 
6822  Statement GetStatement() const;
6823 
6829  bool operator ++ (int);
6830 
6836  bool operator -- (int);
6837 
6844  bool operator += (int offset);
6845 
6852  bool operator -= (int offset);
6853 
6854  private:
6855 
6856  Resultset(OCI_Resultset* resultset, core::Handle* parent);
6857  };
6858 
6866  class Column : public core::HandleHolder<OCI_Column*>
6867  {
6868  friend class TypeInfo;
6869  friend class Resultset;
6870 
6871  public:
6872 
6879  {
6881  NoFlags = OCI_CPF_NONE,
6884  IsIdentity = OCI_CPF_IS_IDENTITY,
6888  IsGeneratedAlways = OCI_CPF_IS_GEN_ALWAYS,
6891  IsGeneratedByDefaultOnNull = OCI_CPF_IS_GEN_BY_DEFAULT_ON_NULL,
6893  IsLogicalPartitioning = OCI_CPF_IS_LPART,
6895  IsGeneratedByContainers = OCI_CPF_IS_CONID
6896  };
6897 
6906 
6912  ostring GetName() const;
6913 
6922  ostring GetSQLType() const;
6923 
6933  ostring GetFullSQLType() const;
6934 
6940  DataType GetType() const;
6941 
6959  unsigned int GetSubType() const;
6960 
6966  CharsetForm GetCharsetForm() const;
6967 
6973  CollationID GetCollationID() const;
6974 
6984  unsigned int GetSize() const;
6985 
6991  int GetScale() const;
6992 
6998  int GetPrecision() const;
6999 
7005  int GetFractionalPrecision() const;
7006 
7012  int GetLeadingPrecision() const;
7013 
7024  PropertyFlags GetPropertyFlags() const;
7025 
7031  bool IsNullable() const;
7032 
7042  bool IsCharSemanticUsed() const;
7043 
7053  TypeInfo GetTypeInfo() const;
7054 
7055  private:
7056 
7057  Column(OCI_Column* pColumn, core::Handle* parent);
7058  };
7059 
7070  class Subscription : public core::HandleHolder<OCI_Subscription*>
7071  {
7072  friend class Event;
7073 
7074  public:
7075 
7083  typedef void (*NotifyHandlerProc) (Event& evt);
7084 
7091  {
7093  ObjectChanges = OCI_CNT_OBJECTS,
7095  RowChanges = OCI_CNT_ROWS,
7097  DatabaseChanges = OCI_CNT_DATABASES,
7099  AllChanges = OCI_CNT_ALL
7100  };
7101 
7110 
7116  Subscription();
7117 
7133  void Register(const Connection& connection, const ostring& name, ChangeTypes changeTypes, NotifyHandlerProc handler, unsigned int port = 0, unsigned int timeout = 0);
7134 
7149  void Unregister();
7150 
7156  void Watch(const ostring& sql);
7157 
7163  ostring GetName() const;
7164 
7170  unsigned int GetTimeout() const;
7171 
7177  unsigned int GetPort() const;
7178 
7187  Connection GetConnection() const;
7188 
7189  private:
7190 
7191  Subscription(OCI_Subscription* pSubcription);
7192  };
7193 
7204  class Event : public core::HandleHolder<OCI_Event*>
7205  {
7206  friend class Subscription;
7207  friend class Environment;
7208 
7209  public:
7210 
7217  {
7219  DatabaseStart = OCI_ENT_STARTUP,
7221  DatabaseShutdown = OCI_ENT_SHUTDOWN,
7223  DatabaseShutdownAny = OCI_ENT_SHUTDOWN_ANY,
7225  DatabaseDrop = OCI_ENT_DROP_DATABASE,
7227  Unregister = OCI_ENT_DEREGISTER,
7229  ObjectChanged = OCI_ENT_OBJECT_CHANGED
7230  };
7231 
7240 
7247  {
7249  ObjectInserted = OCI_ONT_INSERT,
7251  ObjectUpdated = OCI_ONT_UPDATE,
7253  ObjectDeleted = OCI_ONT_DELETE,
7255  ObjectAltered = OCI_ONT_ALTER,
7257  ObjectDropped = OCI_ONT_DROP,
7259  ObjectGeneric = OCI_ONT_GENERIC
7260  };
7261 
7270 
7276  EventType GetType() const;
7277 
7286  ObjectEvent GetObjectEvent() const;
7287 
7293  ostring GetDatabaseName() const;
7294 
7303  ostring GetObjectName() const;
7304 
7310  ostring GetRowID() const;
7311 
7317  Subscription GetSubscription() const;
7318 
7319  private:
7320 
7321  Event(OCI_Event* pEvent);
7322  };
7323 
7331  class Agent : public core::HandleHolder<OCI_Agent*>
7332  {
7333  friend class Message;
7334  friend class Dequeue;
7335 
7336  public:
7337 
7360  Agent(const Connection& connection, const ostring& name = OTEXT(""), const ostring& address = OTEXT(""));
7361 
7367  ostring GetName() const;
7368 
7382  void SetName(const ostring& value);
7383 
7392  ostring GetAddress() const;
7393 
7407  void SetAddress(const ostring& value);
7408 
7409  private:
7410 
7411  Agent(OCI_Agent* pAgent, core::Handle* parent);
7412  };
7413 
7421  class Message : public core::HandleHolder<OCI_Msg*>
7422  {
7423  friend class Dequeue;
7424 
7425  public:
7426 
7433  {
7435  Ready = OCI_AMS_READY,
7437  Waiting = OCI_AMS_WAITING,
7439  Processed = OCI_AMS_PROCESSED,
7441  Expired = OCI_AMS_EXPIRED
7442  };
7443 
7452 
7482  Message(const TypeInfo& typeInfo);
7483 
7492  void Reset();
7493 
7499  template<class T>
7501 
7509  template<class T>
7510  void SetPayload(const T& value);
7511 
7520  Date GetEnqueueTime() const;
7521 
7527  int GetAttemptCount() const;
7528 
7534  MessageState GetState() const;
7535 
7546  Raw GetID() const;
7547 
7556  int GetExpiration() const;
7557 
7577  void SetExpiration(int value);
7578 
7587  int GetEnqueueDelay() const;
7588 
7611  void SetEnqueueDelay(int value);
7612 
7621  int GetPriority() const;
7622 
7635  void SetPriority(int value);
7636 
7646  Raw GetOriginalID() const;
7647 
7659  void SetOriginalID(const Raw& value);
7660 
7669  ostring GetCorrelation() const;
7670 
7681  void SetCorrelation(const ostring& value);
7682 
7696  ostring GetExceptionQueue() const;
7697 
7724  void SetExceptionQueue(const ostring& value);
7725 
7734  Agent GetSender() const;
7735 
7743  void SetSender(const Agent& agent);
7744 
7756  void SetConsumers(std::vector<Agent>& agents);
7757 
7758  private:
7759 
7760  Message(OCI_Msg* pMessage, core::Handle* parent);
7761  };
7762 
7770  class Enqueue : public core::HandleHolder<OCI_Enqueue*>
7771  {
7772  public:
7773 
7780  {
7782  Before = OCI_ASD_BEFORE,
7784  OnTop = OCI_ASD_TOP
7785  };
7786 
7795 
7802  {
7804  Immediate = OCI_AMV_IMMEDIATE,
7806  OnCommit = OCI_AMV_ON_COMMIT
7807  };
7808 
7817 
7839  Enqueue(const TypeInfo& typeInfo, const ostring& queueName);
7840 
7848  void Put(const Message& message);
7849 
7858  EnqueueVisibility GetVisibility() const;
7859 
7870  void SetVisibility(EnqueueVisibility value);
7871 
7880  EnqueueMode GetMode() const;
7881 
7900  void SetMode(EnqueueMode value);
7901 
7912  Raw GetRelativeMsgID() const;
7913 
7927  void SetRelativeMsgID(const Raw& value);
7928  };
7929 
7937  class Dequeue : public core::HandleHolder<OCI_Dequeue*>
7938  {
7939  friend class Environment;
7940 
7941  public:
7942 
7950  typedef void (*NotifyAQHandlerProc) (Dequeue& dequeue);
7951 
7958  {
7960  Browse = OCI_ADM_BROWSE,
7962  Locked = OCI_ADM_LOCKED,
7964  Remove = OCI_ADM_REMOVE,
7966  Confirm = OCI_ADM_REMOVE_NODATA
7967  };
7968 
7977 
7984  {
7986  Immediate = OCI_AMV_IMMEDIATE,
7988  OnCommit = OCI_AMV_ON_COMMIT
7989  };
7990 
7999 
8006  {
8008  FirstMessage = OCI_ADN_FIRST_MSG,
8010  NextMessage = OCI_ADN_NEXT_MSG,
8013  NextTransaction = OCI_ADN_NEXT_TRANSACTION
8014  };
8015 
8024 
8033  Dequeue(const TypeInfo& typeInfo, const ostring& queueName);
8034 
8048  Message Get();
8049 
8065  Agent Listen(int timeout);
8066 
8075  ostring GetConsumer() const;
8076 
8088  void SetConsumer(const ostring& value);
8089 
8098  ostring GetCorrelation() const;
8099 
8111  void SetCorrelation(const ostring& value);
8112 
8121  Raw GetRelativeMsgID() const;
8122 
8130  void SetRelativeMsgID(const Raw& value);
8131 
8140  DequeueVisibility GetVisibility() const;
8141 
8156  void SetVisibility(DequeueVisibility value);
8157 
8166  DequeueMode GetMode() const;
8167 
8178  void SetMode(DequeueMode value);
8179 
8188  NavigationMode GetNavigation() const;
8189 
8209  void SetNavigation(NavigationMode value);
8210 
8219  int GetWaitTime() const;
8220 
8238  void SetWaitTime(int value);
8239 
8247  void SetAgents(std::vector<Agent>& agents);
8248 
8265  void Subscribe(unsigned int port, unsigned int timeout, NotifyAQHandlerProc handler);
8266 
8275  void Unsubscribe();
8276 
8277  private:
8278 
8279  Dequeue(OCI_Dequeue* pDequeue, core::Handle* parent);
8280  };
8281 
8287  class Queue
8288  {
8289  public:
8290 
8297  {
8299  NormalQueue = OCI_AQT_NORMAL,
8301  ExceptionQueue = OCI_AQT_EXCEPTION,
8303  NonPersistentQueue = OCI_AQT_NON_PERSISTENT
8304  };
8305 
8314 
8339  static void Create(const Connection& connection, const ostring& queue, const ostring& table, QueueType type = NormalQueue,
8340  unsigned int maxRetries = 0, unsigned int retryDelay = 0, unsigned int retentionTime = 0,
8341  bool dependencyTracking = false, const ostring& comment = OTEXT(""));
8342 
8363  static void Alter(const Connection& connection, const ostring& queue,
8364  unsigned int maxRetries = 0, unsigned int retryDelay = 0,
8365  unsigned int retentionTime = 0, const ostring& comment = OTEXT(""));
8366 
8382  static void Drop(const Connection& connection, const ostring& queue);
8383 
8401  static void Start(const Connection& connection, const ostring& queue, bool enableEnqueue = true, bool enableDequeue = true);
8402 
8421  static void Stop(const Connection& connection, const ostring& queue, bool stopEnqueue = true, bool stopDequeue = true, bool wait = true);
8422  };
8423 
8430  {
8431  public:
8432 
8440  {
8442  None = OCI_AGM_NONE,
8445  Transactionnal = OCI_AGM_TRANSACTIONNAL
8446  };
8447 
8456 
8464  {
8466  Buffered = OCI_APM_BUFFERED,
8468  Persistent = OCI_APM_PERSISTENT,
8470  All = OCI_APM_ALL
8471  };
8472 
8481 
8516  static void Create(const Connection& connection, const ostring& table, const ostring& payloadType, bool multipleConsumers,
8517  const ostring& storageClause = OTEXT(""), const ostring& sortList = OTEXT(""),
8518  GroupingMode groupingMode = None, const ostring& comment = OTEXT(""),
8519  unsigned int primaryInstance = 0, unsigned int secondaryInstance = 0,
8520  const ostring& compatible = OTEXT(""));
8521 
8540  static void Alter(const Connection& connection, const ostring& table, const ostring& comment, unsigned int primaryInstance = 0, unsigned int secondaryInstance = 0);
8541 
8562  static void Drop(const Connection& connection, const ostring& table, bool force = true);
8563 
8587  static void Purge(const Connection& connection, const ostring& table, PurgeMode mode, const ostring& condition = OTEXT(""), bool block = true);
8588 
8606  static void Migrate(const Connection& connection, const ostring& table, const ostring& compatible = OTEXT(""));
8607  };
8608 
8616  class DirectPath : public core::HandleHolder<OCI_DirPath*>
8617  {
8618  public:
8619 
8626  {
8628  Default = OCI_DCM_DEFAULT,
8630  Force = OCI_DCM_FORCE
8631  };
8632 
8641 
8648  {
8650  ResultComplete = OCI_DPR_COMPLETE,
8652  ResultError = OCI_DPR_ERROR,
8654  ResultFull = OCI_DPR_FULL,
8656  ResultPartial = OCI_DPR_PARTIAL,
8658  ResultEmpty = OCI_DPR_EMPTY
8659  };
8660 
8669 
8691  DirectPath(const TypeInfo& typeInfo, unsigned int nbCols, unsigned int nbRows, const ostring& partition = OTEXT(""));
8692 
8709  void SetColumn(unsigned int colIndex, const ostring& name, unsigned int maxSize, const ostring& format = OTEXT(""));
8710 
8741  template<class T>
8742  void SetEntry(unsigned int rowIndex, unsigned int colIndex, const T& value, bool complete = true);
8743 
8754  void Reset();
8755 
8761  void Prepare();
8762 
8781  DirectPath::Result Convert();
8782 
8794  DirectPath::Result Load();
8795 
8804  void Finish();
8805 
8818  void Abort();
8819 
8828  void Save();
8829 
8835  void FlushRow();
8836 
8848  void SetCurrentRows(unsigned int value);
8849 
8858  unsigned int GetCurrentRows() const;
8859 
8868  unsigned int GetMaxRows() const;
8869 
8878  unsigned int GetRowCount() const;
8879 
8892  unsigned int GetAffectedRows() const;
8893 
8907  void SetDateFormat(const ostring& format);
8908 
8935  void SetParallel(bool value);
8936 
8951  void SetNoLog(bool value);
8952 
8966  void SetCacheSize(unsigned int value);
8967 
8978  void SetBufferSize(unsigned int value);
8979 
8993  void SetConversionMode(ConversionMode value);
8994 
9023  unsigned int GetErrorColumn();
9024 
9058  unsigned int GetErrorRow();
9059  };
9060 
9061 
9062 #define OCILIB_DEFINE_FLAG_OPERATORS(T) \
9063  inline core::Flags<T> operator | (T a, T b) { return core::Flags<T>(a) | core::Flags<T>(b); } \
9064 
9065  OCILIB_DEFINE_FLAG_OPERATORS(Environment::EnvironmentFlagsValues)
9066  OCILIB_DEFINE_FLAG_OPERATORS(Environment::SessionFlagsValues)
9067  OCILIB_DEFINE_FLAG_OPERATORS(Environment::StartFlagsValues)
9068  OCILIB_DEFINE_FLAG_OPERATORS(Environment::StartModeValues)
9069  OCILIB_DEFINE_FLAG_OPERATORS(Environment::ShutdownModeValues)
9070  OCILIB_DEFINE_FLAG_OPERATORS(Environment::ShutdownFlagsValues)
9071  OCILIB_DEFINE_FLAG_OPERATORS(Environment::AllocatedBytesValues)
9072  OCILIB_DEFINE_FLAG_OPERATORS(Transaction::TransactionFlagsValues)
9073  OCILIB_DEFINE_FLAG_OPERATORS(Column::PropertyFlagsValues)
9074  OCILIB_DEFINE_FLAG_OPERATORS(Subscription::ChangeTypesValues)
9075 }
AQ identified agent for messages delivery.
Definition: types.hpp:7332
Provides SQL bind information.
Definition: types.hpp:5382
VectorTypeValues
Vector type values.
Definition: types.hpp:5417
BindDirectionValues
Bind direction enumerated values.
Definition: types.hpp:5393
core::Enum< VectorTypeValues > VectorType
Vector type.
Definition: types.hpp:5431
core::Enum< BindDirectionValues > BindDirection
Bind direction.
Definition: types.hpp:5409
Class used for handling transient collection value. it is used internally by the Collection<T> class:
Definition: types.hpp:4937
Object identifying the SQL data types VARRAY and NESTED TABLE.
Definition: types.hpp:5029
CollectionIterator< const CollectionElement< T > > const_iterator
Common const iterator declaration.
Definition: types.hpp:5236
core::Enum< CollectionTypeValues > CollectionType
Collection type.
Definition: types.hpp:5063
CollectionTypeValues
Collection type enumerated values.
Definition: types.hpp:5047
CollectionIterator< CollectionElement< T > > iterator
Common iterator declaration.
Definition: types.hpp:5229
STL compliant Collection Random iterator class.
Definition: types.hpp:4969
Encapsulate a Resultset column or object member properties.
Definition: types.hpp:6867
PropertyFlagsValues
Column properties flags values.
Definition: types.hpp:6879
core::Flags< PropertyFlagsValues > PropertyFlags
Column properties flags.
Definition: types.hpp:6905
A connection or session with a specific database.
Definition: types.hpp:1580
FailoverEventValues
Failover events enumerated values.
Definition: types.hpp:1666
core::Enum< SessionTraceValues > SessionTrace
Session traces.
Definition: types.hpp:1734
core::Enum< FailoverResultValues > FailoverResult
Failover callback results.
Definition: types.hpp:1708
core::Enum< TimeoutTypeValues > TimeoutType
Timeout Types.
Definition: types.hpp:1636
FailoverRequestValues
Failover request enumerated values.
Definition: types.hpp:1644
core::Enum< FailoverRequestValues > FailoverRequest
Failover requests.
Definition: types.hpp:1658
SessionTraceValues
Session trace enumerated values.
Definition: types.hpp:1716
core::Enum< FailoverEventValues > FailoverEvent
Failover events.
Definition: types.hpp:1686
FailoverResultValues
Failover callback results enumerated values.
Definition: types.hpp:1694
TimeoutTypeValues
Timeout enumerated values.
Definition: types.hpp:1611
Object identifying the SQL data type DATE.
Definition: types.hpp:2678
Dequeue object for dequeuing messages into an Oracle Queue.
Definition: types.hpp:7938
DequeueVisibilityValues
Message visibility enumerated values.
Definition: types.hpp:7984
core::Enum< DequeueVisibilityValues > DequeueVisibility
Message visibility after begin dequeued.
Definition: types.hpp:7998
NavigationModeValues
Navigation Mode enumerated values.
Definition: types.hpp:8006
DequeueModeValues
Dequeue mode enumerated values.
Definition: types.hpp:7958
core::Enum< DequeueModeValues > DequeueMode
Dequeue mode.
Definition: types.hpp:7976
core::Enum< NavigationModeValues > NavigationMode
Navigation Mode.
Definition: types.hpp:8023
Oracle Direct path loading encapsulation.
Definition: types.hpp:8617
ResultValues
Direct Operation Result enumerated values.
Definition: types.hpp:8648
core::Enum< ConversionModeValues > ConversionMode
Conversion Mode.
Definition: types.hpp:8640
core::Enum< ResultValues > Result
Direct Operation Result.
Definition: types.hpp:8668
ConversionModeValues
Conversion mode enumerated values.
Definition: types.hpp:8626
Enqueue object for queuing messages into an Oracle Queue.
Definition: types.hpp:7771
EnqueueModeValues
Message enqueuing mode enumerated values.
Definition: types.hpp:7780
core::Enum< EnqueueModeValues > EnqueueMode
Message enqueuing mode.
Definition: types.hpp:7794
EnqueueVisibilityValues
Message visibility enumerated values.
Definition: types.hpp:7802
core::Enum< EnqueueVisibilityValues > EnqueueVisibility
Message visibility after begin queued.
Definition: types.hpp:7816
Static class in charge of library initialization / cleanup.
Definition: types.hpp:490
core::Flags< ShutdownModeValues > ShutdownMode
Oracle instance shutdown modes.
Definition: types.hpp:752
CharsetModeValues
Charset mode enumerated values.
Definition: types.hpp:624
StartModeValues
Oracle instance start modes enumerated values.
Definition: types.hpp:684
ImportModeValues
OCI libraries import mode enumerated values.
Definition: types.hpp:602
HAEventTypeValues
HA Event types enumerated values.
Definition: types.hpp:556
StartFlagsValues
Oracle instance start flags enumerated values.
Definition: types.hpp:710
ShutdownFlagsValues
Oracle instance shutdown flags enumerated values.
Definition: types.hpp:760
core::Enum< CharsetModeValues > CharsetMode
Environment charset mode.
Definition: types.hpp:638
core::Enum< ImportModeValues > ImportMode
OCI libraries import mode.
Definition: types.hpp:616
core::Flags< ShutdownFlagsValues > ShutdownFlags
Oracle instance shutdown flags.
Definition: types.hpp:789
core::Flags< StartFlagsValues > StartFlags
Oracle instance start flags.
Definition: types.hpp:726
HAEventSourceValues
HA Event sources enumerated values.
Definition: types.hpp:524
EnvironmentFlagsValues
Environment Flags enumerated values.
Definition: types.hpp:578
core::Enum< HAEventTypeValues > HAEventType
Type of HA events.
Definition: types.hpp:570
AllocatedBytesValues
Allocated Bytes enumerated values.
Definition: types.hpp:797
core::Flags< AllocatedBytesValues > AllocatedBytesFlags
Allocated Bytes.
Definition: types.hpp:813
SessionFlagsValues
Session flags enumerated values.
Definition: types.hpp:646
core::Flags< StartModeValues > StartMode
Oracle instance start modes.
Definition: types.hpp:702
core::Enum< HAEventSourceValues > HAEventSource
Source of HA events.
Definition: types.hpp:548
core::Flags< SessionFlagsValues > SessionFlags
Sessions flags.
Definition: types.hpp:676
ShutdownModeValues
Oracle instance shutdown modes enumerated values.
Definition: types.hpp:734
core::Flags< EnvironmentFlagsValues > EnvironmentFlags
Environment Flags.
Definition: types.hpp:594
Subscription Event.
Definition: types.hpp:7205
ObjectEventValues
Object events enumerated values.
Definition: types.hpp:7247
core::Enum< ObjectEventValues > ObjectEvent
Object events.
Definition: types.hpp:7269
core::Enum< EventTypeValues > EventType
Event type.
Definition: types.hpp:7239
EventTypeValues
Event type enumerated values.
Definition: types.hpp:7217
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:4342
Object identifying the SQL data type INTERVAL.
Definition: types.hpp:3114
IntervalTypeValues
Interval types enumerated values.
Definition: types.hpp:3131
core::Enum< IntervalTypeValues > IntervalType
Interval types.
Definition: types.hpp:3145
Object identifying the SQL data type LOB (CLOB, NCLOB and BLOB)
Definition: types.hpp:4020
T Read(unsigned int length)
Read a portion of a lob.
Object identifying the SQL data type LONG.
Definition: types.hpp:5298
T GetContent() const
Return the string read from a fetch sequence.
AQ message.
Definition: types.hpp:7422
MessageStateValues
Message state enumerated values.
Definition: types.hpp:7433
void SetPayload(const T &value)
Set the object payload of the message.
core::Enum< MessageStateValues > MessageState
Message state.
Definition: types.hpp:7451
T GetPayload()
Get the object payload of the message.
Static class allowing managing mutexes.
Definition: types.hpp:1244
Object identifying the SQL data type NUMBER.
Definition: types.hpp:2500
Object identifying the SQL data type OBJECT.
Definition: types.hpp:4668
core::Enum< ObjectTypeValues > ObjectType
Object Type.
Definition: types.hpp:4701
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:4685
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:1352
PoolTypeValues
Pool type enumerated values.
Definition: types.hpp:1361
core::Enum< PoolTypeValues > PoolType
Type of Pool.
Definition: types.hpp:1375
Class allowing the administration of Oracle Queues.
Definition: types.hpp:8288
QueueTypeValues
Queue Type enumerated values.
Definition: types.hpp:8297
core::Enum< QueueTypeValues > QueueType
Queue Type.
Definition: types.hpp:8313
Class allowing the administration of Oracle Queue tables.
Definition: types.hpp:8430
GroupingModeValues
Grouping mode enumerated values.
Definition: types.hpp:8440
PurgeModeValues
Purge mode enumerated values.
Definition: types.hpp:8464
core::Enum< GroupingModeValues > GroupingMode
Grouping Mode.
Definition: types.hpp:8455
core::Enum< PurgeModeValues > PurgeMode
Purge mode.
Definition: types.hpp:8480
Object identifying the SQL data type REF.
Definition: types.hpp:4848
Database resultset.
Definition: types.hpp:6508
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:6518
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:6532
Object used for executing SQL or PL/SQL statement and returning the produced results.
Definition: types.hpp:5559
LongModeValues
LONG data type mapping modes enumerated values.
Definition: types.hpp:5659
StatementTypeValues
Statement Type enumerated values.
Definition: types.hpp:5575
core::Enum< BindModeValues > BindMode
Bind Modes.
Definition: types.hpp:5651
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:5637
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:5615
core::Enum< FetchModeValues > FetchMode
Fetch Modes.
Definition: types.hpp:5629
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:5673
core::Enum< StatementTypeValues > StatementType
Statement Type.
Definition: types.hpp:5607
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:7071
core::Flags< ChangeTypesValues > ChangeTypes
Subscription changes flags.
Definition: types.hpp:7109
ChangeTypesValues
Subscription changes flags values.
Definition: types.hpp:7091
static class allowing to manipulate threads
Definition: types.hpp:1171
POCI_THREAD ThreadProc
Thread callback.
Definition: types.hpp:1180
Static class allowing to set/get thread local storage (TLS) values for a given unique key.
Definition: types.hpp:1296
POCI_THREADKEYDEST ThreadKeyFreeProc
Thread Key callback for freeing resources.
Definition: types.hpp:1305
Object identifying the SQL data type TIMESTAMP.
Definition: types.hpp:3513
core::Enum< TimestampTypeValues > TimestampType
Type of timestamp.
Definition: types.hpp:3547
TimestampTypeValues
Interval types enumerated values.
Definition: types.hpp:3531
Oracle Transaction object.
Definition: types.hpp:2381
core::Flags< TransactionFlagsValues > TransactionFlags
Transaction flags.
Definition: types.hpp:2415
TransactionFlagsValues
Transaction flags enumerated values.
Definition: types.hpp:2392
Provides type information on Oracle Database objects.
Definition: types.hpp:4531
TypeInfoTypeValues
Type of object information enumerated values.
Definition: types.hpp:4545
core::Enum< TypeInfoTypeValues > TypeInfoType
Type of object information.
Definition: types.hpp:4561
Template Enumeration template class providing some type safety to some extends for manipulating enume...
Definition: core.hpp:118
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_XID OCI_XID
Global transaction identifier.
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:5372
core::Enum< NumericTypeValues > NumericType
Numeric data type.
Definition: types.hpp:160
Lob< ostring, LobNationalCharacter > NClob
Class handling NCLOB oracle type.
Definition: types.hpp:4320
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:4309
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:5361
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.
Definition: types.hpp:4331
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