OCILIB (C and C++ Driver for Oracle)  4.6.3
ocilib.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-2019 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 /*
22  * IMPORTANT NOTICE
23  *
24  * This C++ header defines C++ wrapper classes around the OCILIB C API
25  * It requires a compatible version of OCILIB
26  *
27  */
28 
29 #ifndef OCILIBCPP_H_INCLUDED
30 #define OCILIBCPP_H_INCLUDED
31 
32 /* includes */
33 
34 #include <string>
35 #include <list>
36 #include <vector>
37 #include <iterator>
38 #include <cstddef>
39 
40 extern "C"{
41 #include "ocilib.h"
42 }
43 
49 namespace ocilib
50 {
51 
160 typedef std::basic_string<otext, std::char_traits<otext>, std::allocator<otext> > ostring;
161 
169 typedef void * AnyPointer;
170 
178 typedef std::vector<unsigned char> Raw;
179 
188 
197 
205 typedef const void * ThreadId;
206 
214 typedef void * CallbackPointer;
215 
216 }
217 
218 /* Including core classes */
219 
220 #include "ocilib_core.hpp"
221 
222 /* Defining public classes */
223 
224 namespace ocilib
225 {
226 
233 {
234  Oracle80 = OCI_8_0,
235  Oracle8i = OCI_8_1,
236  Oracle9iR1 = OCI_9_0,
237  Oracle9iR2 = OCI_9_2,
238  Oracle10gR1 = OCI_10_1,
239  Oracle10gR2 = OCI_10_2,
240  Oracle11gR1 = OCI_11_1,
241  Oracle11gR2 = OCI_11_2,
242  Oracle12cR1 = OCI_12_1,
243  Oracle12cR2 = OCI_12_2,
244  Oracle18cR1 = OCI_18_1,
245  Oracle18cR2 = OCI_18_2,
246  Oracle18cR3 = OCI_18_3,
247  Oracle18cR4 = OCI_18_4
248 };
249 
258 
265 {
267  TypeNumeric = OCI_CDT_NUMERIC,
269  TypeDate = OCI_CDT_DATETIME,
271  TypeString = OCI_CDT_TEXT,
273  TypeLong = OCI_CDT_LONG,
275  TypeStatement = OCI_CDT_CURSOR,
277  TypeLob = OCI_CDT_LOB,
279  TypeFile = OCI_CDT_FILE,
281  TypeTimestamp = OCI_CDT_TIMESTAMP,
283  TypeInterval = OCI_CDT_INTERVAL,
285  TypeRaw = OCI_CDT_RAW,
287  TypeObject = OCI_CDT_OBJECT,
289  TypeCollection = OCI_CDT_COLLECTION,
291  TypeReference = OCI_CDT_REF,
293  TypeBoolean = OCI_CDT_BOOLEAN
294 };
295 
304 
311 {
313  NumericShort = OCI_NUM_SHORT,
315  NumericInt = OCI_NUM_INT,
317  NumericBigInt = OCI_NUM_BIGINT,
319  NumericUnsignedShort = OCI_NUM_USHORT,
321  NumericUnsignedInt = OCI_NUM_UINT,
323  NumericUnsignedBigInt = OCI_NUM_BIGUINT,
325  NumericDouble = OCI_NUM_DOUBLE,
327  NumericFloat = OCI_NUM_FLOAT,
329  NumericNumber = OCI_NUM_NUMBER
330 };
331 
340 
347 {
349  CharsetFormDefault = OCI_CSF_DEFAULT,
351  CharsetFormNational = OCI_CSF_NATIONAL
352 };
353 
362 
369 {
371  CollationIDNone = OCI_CCI_NONE,
373  CollationIDNlsComp = OCI_CCI_NLS_COMP,
375  CollationIDNlsSort = OCI_CCI_NLS_SORT,
377  CollationIDNlsSortCI = OCI_CCI_NLS_SORT_CI,
379  CollationIDNlsSortAI = OCI_CCI_NLS_SORT_AI,
381  CollationIDNlsSortCS = OCI_CCI_NLS_SORT_CS,
383  CollationIDNlsSortVar1 = OCI_CCI_NLS_SORT_VAR1,
385  CollationIDNlsSortVar1CI = OCI_CCI_NLS_SORT_VAR1_CI,
387  CollationIDNlsSortVar1AI = OCI_CCI_NLS_SORT_VAR1_AI,
389  CollationIDNlsSortVar1CS = OCI_CCI_NLS_SORT_VAR1_CS,
391  CollationIDBinary = OCI_CCI_BINARY,
393  CollationIDBinaryCI = OCI_CCI_BINARY_CI,
395  CollationIDBinaryAI = OCI_CCI_BINARY_AI
396 };
397 
406 
407 
414 {
416  SeekSet = OCI_SEEK_SET,
418  SeekEnd = OCI_SEEK_END,
420  SeekOffset = OCI_SEEK_CUR
421 };
422 
431 
438 {
440  ReadOnly = OCI_LOB_READONLY,
442  ReadWrite = OCI_LOB_READWRITE
443 };
444 
453 
460 {
462  LobBinary = OCI_BLOB,
464  LobCharacter = OCI_CLOB,
466  LobNationalCharacter = OCI_NCLOB
467 };
468 
477 
484 {
486  LongBinary = OCI_BLONG,
488  LongCharacter = OCI_CLONG
489 };
490 
499 
506 {
508  FormatDate = OCI_FMT_DATE,
510  FormatTimestamp = OCI_FMT_TIMESTAMP,
512  FormatNumeric = OCI_FMT_NUMERIC,
514  FormatBinaryDouble = OCI_FMT_BINARY_DOUBLE,
516  FormatBinaryFloat = OCI_FMT_BINARY_FLOAT
517 };
518 
527 
536 class Exception : public std::exception
537 {
538  template<class T>
539  friend T Check(T result);
540  friend class Statement;
541 
542 public:
543 
550  {
552  OracleError = OCI_ERR_ORACLE,
554  OcilibError = OCI_ERR_OCILIB,
556  OracleWarning = OCI_ERR_WARNING
557  };
558 
567 
573  ostring GetMessage() const;
574 
581  ExceptionType GetType() const;
582 
588  int GetOracleErrorCode() const;
589 
595  int GetInternalErrorCode() const;
596 
602  Statement GetStatement() const;
603 
609  Connection GetConnection() const;
610 
623  unsigned int GetRow() const;
624 
633  const char *what() const throw() override;
634 
640  virtual ~Exception() throw ();
641 
642 private:
643 
644  Exception();
645  Exception(OCI_Error *err);
646 
647  std::string _what;
648  OCI_Statement *_pStatement;
649  OCI_Connection *_pConnnection;
650  unsigned int _row;
651  ExceptionType _type;
652  int _errLib;
653  int _errOracle;
654 };
655 
662 {
663  friend class Mutex;
664  friend class Connection;
665  friend class Pool;
666  friend class Subscription;
667  friend class Dequeue;
668  template<class>
669  friend class HandleHolder;
670 
671 public:
672 
679  {
681  SourceInstance = OCI_HES_INSTANCE,
683  SourceDatabase = OCI_HES_DATABASE,
685  SourceNode = OCI_HES_NODE,
687  SourceService = OCI_HES_SERVICE,
689  SourceServiceMember = OCI_HES_SERVICE_MEMBER,
691  SourceASMInstance = OCI_HES_ASM_INSTANCE,
693  SourcePreConnect = OCI_HES_PRECONNECT
694  };
695 
704 
711  {
713  EventDown = OCI_HET_DOWN,
715  EventUp = OCI_HET_UP
716  };
717 
726 
733  {
735  Default = OCI_ENV_DEFAULT,
737  Threaded = OCI_ENV_THREADED,
739  Events = OCI_ENV_EVENTS
740  };
741 
750 
757  {
759  ImportLinkage = OCI_IMPORT_MODE_LINKAGE,
761  ImportRuntime = OCI_IMPORT_MODE_RUNTIME
762  };
763 
772 
779  {
781  CharsetAnsi = OCI_CHAR_ANSI,
783  CharsetWide = OCI_CHAR_WIDE
784  };
785 
794 
801  {
803  SessionDefault = OCI_SESSION_DEFAULT,
805  SessionXa = OCI_SESSION_XA,
807  SessionSysDba = OCI_SESSION_SYSDBA,
809  SessionSysOper = OCI_SESSION_SYSOPER,
811  SessionSysAsm = OCI_SESSION_SYSASM,
813  SessionSysBkp = OCI_SESSION_SYSBKP,
815  SessionSysDgD = OCI_SESSION_SYSDGD,
817  SessionSysKmt = OCI_SESSION_SYSKMT,
819  SessionSysRac = OCI_SESSION_SYSRAC,
821  SessionPreAuth = OCI_SESSION_PRELIM_AUTH
822  };
823 
832 
839  {
841  StartOnly = OCI_DB_SPM_START,
843  StartMount = OCI_DB_SPM_MOUNT,
845  StartOpen = OCI_DB_SPM_OPEN,
847  StartFull = OCI_DB_SPM_FULL
848  };
849 
858 
865  {
867  StartDefault = OCI_DB_SPF_DEFAULT,
869  StartForce = OCI_DB_SPF_FORCE,
871  StartRestrict = OCI_DB_SPF_RESTRICT
872  };
873 
882 
889  {
891  ShutdownOnly = OCI_DB_SDM_SHUTDOWN,
893  ShutdownClose = OCI_DB_SDM_CLOSE,
895  ShutdownDismount = OCI_DB_SDM_DISMOUNT,
897  ShutdownFull = OCI_DB_SDM_FULL
898  };
899 
908 
915  {
918  ShutdowntDefault = OCI_DB_SDF_DEFAULT,
921  ShutdowTrans = OCI_DB_SDF_TRANS,
925  ShutdownTransLocal = OCI_DB_SDF_TRANS_LOCAL,
928  ShutdownImmediate = OCI_DB_SDF_IMMEDIATE,
934  ShutdownAbort = OCI_DB_SDF_ABORT
935  };
936 
945 
952  {
954  OracleClientBytes = OCI_MEM_ORACLE,
956  OcilibBytes = OCI_MEM_OCILIB,
958  AllBytes = OCI_MEM_ALL
959  };
960 
969 
977  typedef void(*HAHandlerProc) (Connection &con, HAEventSource eventSource, HAEventType eventType, Timestamp &time);
978 
998  static void Initialize(EnvironmentFlags mode = Environment::Default, const ostring& libpath = OTEXT(""));
999 
1014  static void Cleanup();
1015 
1024  static Environment::EnvironmentFlags GetMode();
1025 
1031  static Environment::ImportMode GetImportMode();
1032 
1038  static Environment::CharsetMode GetCharset();
1039 
1049  static unsigned int GetCharMaxSize();
1050 
1058  static big_uint GetAllocatedBytes(AllocatedBytesFlags type);
1059 
1065  static bool Initialized();
1066 
1077  static OracleVersion GetCompileVersion();
1078 
1084  static unsigned int GetCompileMajorVersion();
1085 
1091  static unsigned int GetCompileMinorVersion();
1092 
1098  static unsigned int GetCompileRevisionVersion();
1099 
1109  static OracleVersion GetRuntimeVersion();
1110 
1116  static unsigned int GetRuntimeMajorVersion();
1117 
1123  static unsigned int GetRuntimeMinorVersion();
1124 
1130  static unsigned int GetRuntimeRevisionVersion();
1131 
1142  static void EnableWarnings(bool value);
1143 
1175  static bool SetFormat(FormatType formatType, const ostring& format);
1176 
1187  static ostring GetFormat(FormatType formatType);
1188 
1215  static void StartDatabase(const ostring &db, const ostring &user, const ostring& pwd,
1216  Environment::StartFlags startFlags,
1217  Environment::StartMode startMode,
1218  Environment::SessionFlags sessionFlags = SessionSysDba,
1219  const ostring& spfile = OTEXT(""));
1220 
1246  static void ShutdownDatabase(const ostring& db, const ostring& user, const ostring& pwd,
1247  Environment::ShutdownFlags shutdownFlags,
1248  Environment::ShutdownMode shutdownMode,
1249  Environment::SessionFlags sessionFlags = SessionSysDba);
1250 
1261  static void ChangeUserPassword(const ostring& db, const ostring& user, const ostring& pwd, const ostring& newPwd);
1262 
1279  static void SetHAHandler(HAHandlerProc handler);
1280 
1281 private:
1282 
1283  class EnvironmentHandle : HandleHolder < AnyPointer >
1284  {
1285  friend class Environment;
1286  };
1287 
1288  static void HAHandler(OCI_Connection *pConnection, unsigned int source, unsigned int event, OCI_Timestamp *pTimestamp);
1289  static unsigned int TAFHandler(OCI_Connection *pConnection, unsigned int type, unsigned int event);
1290  static void NotifyHandler(OCI_Event *pEvent);
1291  static void NotifyHandlerAQ(OCI_Dequeue *pDequeue);
1292 
1293  template<class T>
1294  static T GetUserCallback(AnyPointer ptr);
1295 
1296  template<class T>
1297  static void SetUserCallback(AnyPointer ptr, T callback);
1298 
1299  template<class T>
1300  static void SetSmartHandle(AnyPointer ptr, T handle);
1301 
1302  template<class T>
1303  static T GetSmartHandle(AnyPointer ptr);
1304 
1305  static Handle * GetEnvironmentHandle();
1306 
1307  static Environment& GetInstance();
1308 
1309  Environment();
1310 
1311  void SelfInitialize(EnvironmentFlags mode, const ostring& libpath);
1312  void SelfCleanup();
1313 
1314  Locker _locker;
1315  EnvironmentHandle _handle;
1316  ConcurrentMap<AnyPointer, Handle *> _handles;
1317  ConcurrentMap<AnyPointer, CallbackPointer> _callbacks;
1318  EnvironmentFlags _mode;
1319  unsigned int _charMaxSize;
1320  bool _initialized;
1321 };
1322 
1333 class Thread
1334 {
1335 public:
1336 
1344 
1353  static ThreadHandle Create();
1354 
1362  static void Destroy(ThreadHandle handle);
1363 
1373  static void Run(ThreadHandle handle, ThreadProc func, void *args);
1374 
1385  static void Join(ThreadHandle handle);
1386 
1394  static ThreadId GetThreadId(ThreadHandle handle);
1395 };
1396 
1406 class Mutex
1407 {
1408 public:
1409 
1418  static MutexHandle Create();
1419 
1427  static void Destroy(MutexHandle handle);
1428 
1436  static void Acquire(MutexHandle handle);
1437 
1445  static void Release(MutexHandle handle);
1446 };
1447 
1459 {
1460 public:
1461 
1469 
1482  static void Create(const ostring& name, ThreadKeyFreeProc freeProc = nullptr);
1483 
1492  static void SetValue(const ostring& name, AnyPointer value);
1493 
1504  static AnyPointer GetValue(const ostring& name);
1505 };
1506 
1514 class Pool : public HandleHolder<OCI_Pool *>
1515 {
1516 public:
1517 
1524  {
1526  ConnectionPool = OCI_POOL_CONNECTION,
1528  SessionPool = OCI_POOL_SESSION
1529  };
1530 
1539 
1545  Pool();
1546 
1564  Pool(const ostring& db, const ostring& user, const ostring& pwd, Pool::PoolType poolType,
1565  unsigned int minSize, unsigned int maxSize, unsigned int increment = 1,
1567 
1586  void Open(const ostring& db, const ostring& user, const ostring& pwd, Pool::PoolType poolType,
1587  unsigned int minSize, unsigned int maxSize, unsigned int increment = 1,
1589 
1595  void Close();
1596 
1625  Connection GetConnection(const ostring& sessionTag = OTEXT(""));
1626 
1638  unsigned int GetTimeout() const;
1639 
1653  void SetTimeout(unsigned int value);
1654 
1664  bool GetNoWait() const;
1665 
1678  void SetNoWait(bool value);
1679 
1685  unsigned int GetBusyConnectionsCount() const;
1686 
1692  unsigned int GetOpenedConnectionsCount() const;
1693 
1699  unsigned int GetMinSize() const;
1700 
1706  unsigned int GetMaxSize() const;
1707 
1713  unsigned int GetIncrement() const;
1714 
1723  unsigned int GetStatementCacheSize() const;
1724 
1732  void SetStatementCacheSize(unsigned int value);
1733 };
1734 
1742 class Connection : public HandleHolder<OCI_Connection *>
1743 {
1744  friend class Environment;
1745  friend class Exception;
1746  friend class Statement;
1747  friend class File;
1748  friend class Timestamp;
1749  friend class Pool;
1750  friend class Object;
1751  friend class TypeInfo;
1752  friend class Reference;
1753  friend class Resultset;
1754  friend class Subscription;
1755 
1756  template<class, int>
1757  friend class Lob;
1758  template<class>
1759  friend class Collection;
1760 public:
1761 
1768  {
1773  TimeoutSend = OCI_NTO_SEND,
1778  TimeoutReceive = OCI_NTO_RECEIVE,
1783  TimeoutCall = OCI_NTO_CALL
1784  };
1785 
1794 
1801  {
1803  FailoverRequestSession = OCI_FOT_SESSION,
1805  FailoverRequestSelect = OCI_FOT_SELECT
1806  };
1807 
1816 
1823  {
1825  FailoverEventEnd = OCI_FOE_END,
1827  FailoverEventAbort = OCI_FOE_ABORT,
1829  FailoverEventReauthentificate = OCI_FOE_REAUTH,
1831  FailoverEventBegin = OCI_FOE_BEGIN,
1833  FailoverEventError = OCI_FOE_ERROR
1834  };
1835 
1844 
1851  {
1853  FailoverOk = OCI_FOC_OK,
1855  FailoverRetry = OCI_FOC_RETRY
1856  };
1857 
1866 
1873  {
1875  TraceIdentity = OCI_TRC_IDENTITY,
1877  TraceModule = OCI_TRC_MODULE,
1879  TraceAction = OCI_TRC_ACTION,
1881  TraceDetail = OCI_TRC_DETAIL
1882  };
1883 
1892 
1900  typedef FailoverResult(*TAFHandlerProc) (Connection &con, FailoverRequest failoverRequest, FailoverEvent failoverEvent);
1901 
1907  Connection();
1908 
1922  Connection(const ostring& db, const ostring& user, const ostring& pwd, Environment::SessionFlags sessionFlags = Environment::SessionDefault);
1923 
1966  void Open(const ostring& db, const ostring& user, const ostring& pwd, Environment::SessionFlags sessionFlags = Environment::SessionDefault);
1967 
1973  void Close();
1974 
1980  void Commit();
1981 
1987  void Rollback();
1988 
1997  void Break();
1998 
2006  void SetAutoCommit(bool enabled);
2007 
2013  bool GetAutoCommit() const;
2014 
2023  bool IsServerAlive() const;
2024 
2033  bool PingServer() const;
2034 
2043  ostring GetConnectionString() const;
2044 
2053  ostring GetUserName() const;
2054 
2063  ostring GetPassword() const;
2064 
2073  ostring GetServerVersion() const;
2074 
2083  OracleVersion GetVersion() const;
2084 
2090  unsigned int GetServerMajorVersion() const;
2091 
2097  unsigned int GetServerMinorVersion() const;
2098 
2104  unsigned int GetServerRevisionVersion() const;
2105 
2113  void ChangePassword(const ostring& newPwd);
2114 
2120  ostring GetSessionTag() const;
2121 
2136  void SetSessionTag(const ostring& tag);
2137 
2143  Transaction GetTransaction() const;
2144 
2158  void SetTransaction(const Transaction &transaction);
2159 
2191  bool SetFormat(FormatType formatType, const ostring& format);
2192 
2203  ostring GetFormat(FormatType formatType);
2204 
2224  void EnableServerOutput(unsigned int bufsize, unsigned int arrsize, unsigned int lnsize);
2225 
2234  void DisableServerOutput();
2235 
2244  bool GetServerOutput(ostring &line) const;
2245 
2251  void GetServerOutput(std::vector<ostring> &lines) const;
2252 
2281  void SetTrace(SessionTrace trace, const ostring& value);
2282 
2293  ostring GetTrace(SessionTrace trace) const;
2294 
2303  ostring GetDatabase() const;
2304 
2313  ostring GetInstance() const;
2314 
2323  ostring GetService() const;
2324 
2333  ostring GetServer() const;
2334 
2343  ostring GetDomain() const;
2344 
2353  Timestamp GetInstanceStartTime() const;
2354 
2366  unsigned int GetStatementCacheSize() const;
2367 
2378  void SetStatementCacheSize(unsigned int value);
2379 
2396  unsigned int GetDefaultLobPrefetchSize() const;
2397 
2422  void SetDefaultLobPrefetchSize(unsigned int value);
2423 
2438  unsigned int GetMaxCursors() const;
2439 
2448  bool IsTAFCapable() const;
2449 
2463  void SetTAFHandler(TAFHandlerProc handler);
2464 
2470  AnyPointer GetUserData();
2471 
2479  void SetUserData(AnyPointer value);
2480 
2494  unsigned int GetTimeout(TimeoutType timeout);
2495 
2523  void SetTimeout(TimeoutType timeout, unsigned int value);
2524 
2525 private:
2526 
2527  Connection(OCI_Connection *con, Handle *parent);
2528 };
2529 
2537 class Transaction : public HandleHolder<OCI_Transaction *>
2538 {
2539  friend class Connection;
2540 
2541 public:
2542 
2549  {
2550  Unknown = OCI_UNKNOWN,
2552  New = OCI_TRS_NEW,
2554  Tight = OCI_TRS_TIGHT,
2556  Loose = OCI_TRS_LOOSE,
2558  ReadOnly = OCI_TRS_READONLY,
2560  ReadWrite = OCI_TRS_READWRITE,
2562  Serializable = OCI_TRS_SERIALIZABLE
2563  };
2564 
2573 
2587  Transaction(const Connection &connection, unsigned int timeout, TransactionFlags flags, OCI_XID *pxid = nullptr);
2588 
2594  void Prepare();
2595 
2601  void Start();
2602 
2608  void Stop();
2609 
2615  void Resume();
2616 
2622  void Forget();
2623 
2632  TransactionFlags GetFlags() const;
2633 
2639  unsigned int GetTimeout() const;
2640 
2641 private:
2642 
2643  Transaction(OCI_Transaction *trans);
2644 };
2645 
2656 class Number : public HandleHolder<OCI_Number *>, public Streamable
2657 {
2658  friend class Statement;
2659  friend class Resultset;
2660  friend class BindArray;
2661  friend class Object;
2662  template<class>
2663  friend class Collection;
2664 
2665 public:
2666 
2674  Number(bool create = false);
2675 
2690  Number(const otext* str, const otext* format = OTEXT(""));
2691 
2706  Number(const ostring& str, const ostring& format = OTEXT(""));
2707 
2722  void FromString(const ostring& str, const ostring& format = OTEXT("")) const;
2723 
2734  ostring ToString(const ostring& format) const;
2735 
2744  ostring ToString() const override;
2745 
2751  Number Clone() const;
2752 
2753  Number& operator ++ ();
2754  Number& operator -- ();
2755  Number operator ++ (int);
2756  Number operator -- (int);
2757 
2758  bool operator == (const Number& other) const;
2759  bool operator != (const Number& other) const;
2760  bool operator > (const Number& other) const;
2761  bool operator < (const Number& other) const;
2762  bool operator >= (const Number& other) const;
2763  bool operator <= (const Number& other) const;
2764 
2765  template<class T>
2766  Number& operator = (const T &lhs);
2767 
2768  template<class T>
2769  operator T() const;
2770 
2771  template<class T>
2772  Number operator - (const T &value);
2773 
2774  template<class T>
2775  Number operator + (const T &value);
2776 
2777  template<class T>
2778  Number operator * (const T &value);
2779 
2780  template<class T>
2781  Number operator / (const T &value);
2782 
2783  template<class T>
2784  Number& operator += (const T &value);
2785 
2786  template<class T>
2787  Number& operator -= (const T &value);
2788 
2789  template<class T>
2790  Number& operator *= (const T &value);
2791 
2792  template<class T>
2793  Number& operator /= (const T &value);
2794 
2795 private:
2796 
2797  Number(OCI_Number *pNumber, Handle *parent = nullptr);
2798 
2799  void Allocate();
2800 
2801  int Compare(const Number& other) const;
2802 
2803  template<class T>
2804  inline T GetValue() const;
2805 
2806  template<class T>
2807  Number& SetValue(const T &value);
2808 
2809  template<class T>
2810  void Add(const T &value);
2811 
2812  template<class T>
2813  void Sub(const T &value);
2814 
2815  template<class T>
2816  void Multiply(const T &value);
2817 
2818  template<class T>
2819  void Divide(const T &value);
2820 
2821  Number& operator = (OCI_Number * &lhs);
2822 };
2823 
2831 class Date : public HandleHolder<OCI_Date *>, public Streamable
2832 {
2833  friend class Statement;
2834  friend class Resultset;
2835  friend class BindArray;
2836  friend class Object;
2837  template<class>
2838  friend class Collection;
2839  friend class Message;
2840 
2841 public:
2842 
2848  static Date SysDate();
2849 
2857  Date(bool create = false);
2858 
2873  Date(const otext* str, const otext* format = OTEXT(""));
2874 
2890  Date(const ostring& str, const ostring& format = OTEXT(""));
2891 
2897  bool IsValid() const;
2898 
2904  int GetYear() const;
2905 
2911  void SetYear(int value);
2912 
2918  int GetMonth() const;
2919 
2925  void SetMonth(int value);
2926 
2932  int GetDay() const;
2933 
2939  void SetDay(int value);
2940 
2946  int GetHours() const;
2947 
2953  void SetHours(int value);
2954 
2960  int GetMinutes() const;
2961 
2967  void SetMinutes(int value);
2968 
2974  int GetSeconds() const;
2975 
2981  void SetSeconds(int value);
2982 
2990  int DaysBetween(const Date& other) const;
2991 
3001  void SetDate(int year, int month, int day);
3002 
3012  void SetTime(int hour, int min, int sec);
3013 
3026  void SetDateTime(int year, int month, int day, int hour, int min, int sec);
3027 
3037  void GetDate(int &year, int &month, int &day) const;
3038 
3048  void GetTime(int &hour, int &min, int &sec) const;
3049 
3062  void GetDateTime(int &year, int &month, int &day, int &hour, int &min, int &sec) const;
3063 
3071  void AddDays(int days);
3072 
3080  void AddMonths(int months);
3081 
3089  Date NextDay(const ostring& day) const;
3090 
3096  Date LastDay() const;
3097 
3106  void ChangeTimeZone(const ostring& tzSrc, const ostring& tzDst);
3107 
3122  void FromString(const ostring& str, const ostring& format = OTEXT(""));
3123 
3134  ostring ToString(const ostring& format) const;
3135 
3144  ostring ToString() const override;
3145 
3151  Date Clone() const;
3152 
3158  Date& operator ++ ();
3159 
3165  Date operator ++ (int);
3166 
3172  Date& operator -- ();
3173 
3179  Date operator -- (int);
3180 
3186  Date operator + (int value) const;
3187 
3193  Date operator - (int value) const;
3194 
3200  Date& operator += (int value);
3201 
3207  Date& operator -= (int value);
3208 
3214  bool operator == (const Date& other) const;
3215 
3221  bool operator != (const Date& other) const;
3222 
3228  bool operator > (const Date& other) const;
3229 
3235  bool operator < (const Date& other) const;
3236 
3242  bool operator >= (const Date& other) const;
3243 
3249  bool operator <= (const Date& other) const;
3250 
3251 private:
3252 
3253  int Compare(const Date& other) const;
3254 
3255  Date(OCI_Date *pDate, Handle *parent = nullptr);
3256 
3257  void Allocate();
3258 };
3259 
3267 class Interval : public HandleHolder<OCI_Interval *>, public Streamable
3268 {
3269  friend class Environment;
3270  friend class Statement;
3271  friend class Resultset;
3272  friend class BindArray;
3273  friend class Object;
3274  template<class>
3275  friend class Collection;
3276 
3277 public:
3278 
3285  {
3287  YearMonth = OCI_INTERVAL_YM,
3289  DaySecond = OCI_INTERVAL_DS
3290  };
3291 
3300 
3306  Interval();
3307 
3315  Interval(IntervalType type);
3316 
3328  Interval(IntervalType type, const ostring& data);
3329 
3335  IntervalType GetType() const;
3336 
3342  bool IsValid() const;
3343 
3352  int GetYear() const;
3353 
3362  void SetYear(int value);
3363 
3372  int GetMonth() const;
3373 
3382  void SetMonth(int value);
3383 
3392  int GetDay() const;
3393 
3402  void SetDay(int value);
3403 
3412  int GetHours() const;
3413 
3422  void SetHours(int value);
3423 
3432  int GetMinutes() const;
3433 
3442  void SetMinutes(int value);
3443 
3452  int GetSeconds() const;
3453 
3462  void SetSeconds(int value);
3463 
3469  int GetMilliSeconds() const;
3470 
3476  void SetMilliSeconds(int value);
3477 
3492  void GetDaySecond(int &day, int &hour, int &min, int &sec, int &fsec) const;
3493 
3508  void SetDaySecond(int day, int hour, int min, int sec, int fsec);
3509 
3521  void GetYearMonth(int &year, int &month) const;
3522 
3534  void SetYearMonth(int year, int month);
3535 
3543  void UpdateTimeZone(const ostring& timeZone);
3544 
3555  void FromString(const ostring& data);
3556 
3565  ostring ToString(int leadingPrecision, int fractionPrecision) const;
3566 
3572  ostring ToString() const override;
3573 
3579  Interval Clone() const;
3580 
3586  Interval operator + (const Interval& other) const;
3587 
3593  Interval operator - (const Interval& other) const;
3594 
3600  Interval& operator += (const Interval& other);
3601 
3607  Interval& operator -= (const Interval& other);
3608 
3614  bool operator == (const Interval& other) const;
3615 
3621  bool operator != (const Interval& other) const;
3622 
3628  bool operator > (const Interval& other) const;
3629 
3635  bool operator < (const Interval& other) const;
3636 
3642  bool operator >= (const Interval& other) const;
3643 
3649  bool operator <= (const Interval& other) const;
3650 
3651 private:
3652 
3653  int Compare(const Interval& other) const;
3654 
3655  Interval(OCI_Interval *pInterval, Handle *parent = nullptr);
3656 };
3657 
3666 class Timestamp : public HandleHolder<OCI_Timestamp *>, public Streamable
3667 {
3668  friend class Environment;
3669  friend class Statement;
3670  friend class Resultset;
3671  friend class BindArray;
3672  friend class Object;
3673  friend class Connection;
3674  template<class>
3675  friend class Collection;
3676 
3677 public:
3678 
3685  {
3687  NoTimeZone = OCI_TIMESTAMP,
3689  WithTimeZone = OCI_TIMESTAMP_TZ,
3691  WithLocalTimeZone = OCI_TIMESTAMP_LTZ
3692  };
3693 
3702 
3710  static Timestamp SysTimestamp(TimestampType type = NoTimeZone);
3711 
3717  Timestamp();
3718 
3726  Timestamp(TimestampType type);
3727 
3740  Timestamp(TimestampType type, const ostring& data, const ostring& format = OTEXT(""));
3741 
3747  TimestampType GetType() const;
3748 
3756  void Convert(const Timestamp& other);
3757 
3763  bool IsValid() const;
3764 
3770  int GetYear() const;
3771 
3777  void SetYear(int value);
3778 
3784  int GetMonth() const;
3785 
3791  void SetMonth(int value);
3792 
3798  int GetDay() const;
3799 
3805  void SetDay(int value);
3806 
3812  int GetHours() const;
3813 
3819  void SetHours(int value);
3820 
3826  int GetMinutes() const;
3827 
3833  void SetMinutes(int value);
3834 
3840  int GetSeconds() const;
3841 
3847  void SetSeconds(int value);
3848 
3854  int GetMilliSeconds() const;
3855 
3861  void SetMilliSeconds(int value);
3862 
3872  void GetDate(int &year, int &month, int &day) const;
3873 
3884  void GetTime(int &hour, int &min, int &sec, int &fsec) const;
3885 
3895  void SetDate(int year, int month, int day);
3896 
3907  void SetTime(int hour, int min, int sec, int fsec);
3908 
3922  void GetDateTime(int &year, int &month, int &day, int &hour, int &min, int &sec, int &fsec) const;
3923 
3938  void SetDateTime(int year, int month, int day, int hour, int min, int sec, int fsec, const ostring& timeZone = OTEXT(""));
3939 
3948  ostring GetTimeZone() const;
3949 
3959  void SetTimeZone(const ostring& timeZone);
3960 
3969  void GetTimeZoneOffset(int &hour, int &min) const;
3970 
3983  static void Substract(const Timestamp &lsh, const Timestamp &rsh, Interval &result);
3984 
3996  void FromString(const ostring& data, const ostring& format = OCI_STRING_FORMAT_DATE);
3997 
4009  ostring ToString(const ostring& format, int precision) const;
4010 
4016  ostring ToString() const override;
4017 
4023  Timestamp Clone() const;
4024 
4030  Timestamp& operator ++ ();
4031 
4037  Timestamp operator ++ (int);
4038 
4044  Timestamp& operator -- ();
4045 
4051  Timestamp operator -- (int);
4052 
4058  Timestamp operator + (int value) const;
4059 
4065  Timestamp operator - (int value) const;
4066 
4072  Interval operator - (const Timestamp& other);
4073 
4079  Timestamp& operator += (int value);
4080 
4086  Timestamp& operator -= (int value);
4087 
4093  Timestamp operator + (const Interval& other) const;
4094 
4100  Timestamp operator - (const Interval& other) const;
4101 
4107  Timestamp& operator += (const Interval& other);
4108 
4114  Timestamp& operator -= (const Interval& other);
4115 
4121  bool operator == (const Timestamp& other) const;
4122 
4128  bool operator != (const Timestamp& other) const;
4129 
4135  bool operator > (const Timestamp& other) const;
4136 
4142  bool operator < (const Timestamp& other) const;
4143 
4149  bool operator >= (const Timestamp& other) const;
4150 
4156  bool operator <= (const Timestamp& other) const;
4157 
4158 private:
4159 
4160  int Compare(const Timestamp& other) const;
4161 
4162  Timestamp(OCI_Timestamp *pTimestamp, Handle *parent = nullptr);
4163 };
4164 
4172 template<class T, int U>
4173 class Lob : public HandleHolder<OCI_Lob *>
4174 {
4175  friend class Statement;
4176  friend class Resultset;
4177  friend class BindArray;
4178  friend class Object;
4179  template<class>
4180  friend class Collection;
4181 
4182 public:
4183 
4189  Lob();
4190 
4201  Lob(const Connection &connection);
4202 
4213  T Read(unsigned int length);
4214 
4225  unsigned int Write(const T &content);
4226 
4237  unsigned int Append(const T& content);
4238 
4246  void Append(const Lob& other);
4247 
4262  bool Seek(SeekMode seekMode, big_uint offset);
4263 
4269  LobType GetType() const;
4270 
4276  big_uint GetOffset() const;
4277 
4283  big_uint GetLength() const;
4284 
4290  big_uint GetMaxSize() const;
4291 
4303  big_uint GetChunkSize() const;
4304 
4310  Connection GetConnection() const;
4311 
4319  void Truncate(big_uint length);
4320 
4336  big_uint Erase(big_uint offset, big_uint length);
4337 
4351  void Copy(Lob &dest, big_uint offset, big_uint offsetDest, big_uint length) const;
4352 
4358  bool IsTemporary() const;
4359 
4365  bool IsRemote() const;
4366 
4379  void Open(OpenMode mode);
4380 
4386  void Flush();
4387 
4396  void Close();
4397 
4416  void EnableBuffering(bool value);
4417 
4423  Lob Clone() const;
4424 
4430  Lob& operator += (const Lob& other);
4431 
4437  bool operator == (const Lob& other) const;
4438 
4444  bool operator != (const Lob& other) const;
4445 
4446 private:
4447 
4448  bool Equals(const Lob &other) const;
4449 
4450  Lob(OCI_Lob *pLob, Handle *parent = nullptr);
4451 
4452 };
4453 
4464 
4475 
4486 
4495 class File : public HandleHolder<OCI_File *>
4496 {
4497  friend class Statement;
4498  friend class Resultset;
4499  friend class BindArray;
4500  friend class Object;
4501  template<class>
4502  friend class Collection;
4503 
4504 public:
4505 
4511  File();
4512 
4523  File(const Connection &connection);
4524 
4539  File(const Connection &connection, const ostring& directory, const ostring& name);
4540 
4551  Raw Read(unsigned int size);
4552 
4567  bool Seek(SeekMode seekMode, big_uint offset);
4568 
4577  bool Exists() const;
4578 
4584  big_uint GetOffset() const;
4585 
4591  big_uint GetLength() const;
4592 
4598  Connection GetConnection() const;
4599 
4612  void SetInfos(const ostring& directory, const ostring& name);
4613 
4619  ostring GetName() const;
4620 
4626  ostring GetDirectory() const;
4627 
4633  void Open();
4634 
4640  void Close();
4641 
4647  bool IsOpened() const;
4648 
4654  File Clone() const;
4655 
4661  bool operator == (const File& other) const;
4662 
4668  bool operator != (const File& other) const;
4669 
4670 private:
4671 
4672  bool Equals(const File &other) const;
4673 
4674  File(OCI_File *pFile, Handle *parent = nullptr);
4675 };
4676 
4684 class TypeInfo : public HandleHolder<OCI_TypeInfo *>
4685 {
4686  friend class Object;
4687  friend class Reference;
4688  template<class>
4689  friend class Collection;
4690  friend class Column;
4691 public:
4692 
4699  {
4701  Table = OCI_TIF_TABLE,
4703  View = OCI_TIF_VIEW,
4705  Type = OCI_TIF_TYPE
4706  };
4707 
4716 
4729  TypeInfo(const Connection &connection, const ostring& name, TypeInfoType type);
4730 
4736  TypeInfoType GetType() const;
4737 
4743  ostring GetName() const;
4744 
4750  Connection GetConnection() const;
4751 
4761  unsigned int GetColumnCount() const;
4762 
4777  Column GetColumn(unsigned int index) const;
4778 
4791  boolean IsFinalType() const;
4792 
4807  TypeInfo GetSuperType() const;
4808 
4809 private:
4810 
4811  TypeInfo(OCI_TypeInfo *pTypeInfo);
4812 };
4813 
4821 class Object : public HandleHolder<OCI_Object *>, public Streamable
4822 {
4823  friend class Statement;
4824  friend class Resultset;
4825  friend class BindArray;
4826  friend class Reference;
4827  template<class>
4828  friend class Collection;
4829  friend class Message;
4830 
4831 public:
4832 
4839  {
4841  Persistent = OCI_OBJ_PERSISTENT,
4843  Transient = OCI_OBJ_TRANSIENT,
4845  Value = OCI_OBJ_VALUE
4846  };
4847 
4856 
4862  Object();
4863 
4871  Object(const TypeInfo &typeInfo);
4872 
4880  bool IsAttributeNull(const ostring& name) const;
4881 
4889  void SetAttributeNull(const ostring& name);
4890 
4896  TypeInfo GetTypeInfo() const;
4897 
4903  Reference GetReference() const;
4904 
4910  ObjectType GetType() const;
4911 
4924  template<class T>
4925  T Get(const ostring& name) const;
4926 
4940  template<class T>
4941  void Get(const ostring& name, T &value) const;
4942 
4956  template<class T>
4957  void Get(const ostring& name, Collection<T> &value) const;
4958 
4972  template<class T>
4973  void Set(const ostring& name, const T &value);
4974 
4980  Object Clone() const;
4981 
4987  ostring ToString() const;
4988 
4989 private:
4990 
4991  Object(OCI_Object *pObject, Handle *parent = nullptr);
4992 };
4993 
5001 class Reference : public HandleHolder<OCI_Ref *>, public Streamable
5002 {
5003  friend class Statement;
5004  friend class Resultset;
5005  friend class BindArray;
5006  friend class Object;
5007  template<class>
5008  friend class Collection;
5009 
5010 public:
5011 
5017  Reference();
5018 
5026  Reference(const TypeInfo &typeInfo);
5027 
5033  TypeInfo GetTypeInfo() const;
5034 
5043  Object GetObject() const;
5044 
5050  bool IsReferenceNull() const;
5051 
5060  void SetReferenceNull();
5061 
5067  Reference Clone() const;
5068 
5074  ostring ToString() const override;
5075 
5076 private:
5077 
5078  Reference(OCI_Ref *pRef, Handle *parent = nullptr);
5079 };
5080 
5089 template<class T>
5091 {
5092  template<class>
5093  friend class CollectionIterator;
5094 
5095 public:
5096 
5097  typedef T ValueType;
5099 
5101  CollectionElement(CollectionType *coll, unsigned int pos);
5102  operator T() const;
5103  CollectionElement& operator = (const ValueType& value);
5104  CollectionElement& operator = (const CollectionElement& other);
5105  bool IsNull() const;
5106  void SetNull();
5107 
5108 private:
5109 
5110  CollectionType* _coll;
5111  unsigned int _pos;
5112 };
5113 
5121 template<class T>
5123 {
5124 public:
5125 
5126  template<class>
5127  friend class Collection;
5128 
5129  typedef typename T::ValueType value_type;
5131 
5132  typedef std::random_access_iterator_tag iterator_category;
5133  typedef ptrdiff_t difference_type;
5134  typedef ptrdiff_t distance_type;
5135  typedef value_type* pointer;
5136  typedef value_type& reference;
5137 
5139  CollectionIterator(const CollectionIterator& other);
5140 
5141  CollectionIterator& operator = (const CollectionIterator& other);
5142  CollectionIterator& operator += (difference_type value);
5143  CollectionIterator& operator -= (difference_type value);
5144 
5145  T& operator*();
5146  T* operator->();
5147 
5148  CollectionIterator& operator++();
5149  CollectionIterator& operator--();
5150 
5151  CollectionIterator operator++(int);
5152  CollectionIterator operator--(int);
5153 
5154  CollectionIterator operator + (difference_type value);
5155  CollectionIterator operator - (difference_type value);
5156 
5157  difference_type operator - (const CollectionIterator &other);
5158 
5159  bool operator == (const CollectionIterator& other);
5160  bool operator != (const CollectionIterator& other);
5161  bool operator > (const CollectionIterator& other);
5162  bool operator < (const CollectionIterator& other);
5163  bool operator >= (const CollectionIterator& other);
5164  bool operator <= (const CollectionIterator& other);
5165 
5166 protected:
5167 
5168  CollectionIterator(CollectionType *collection, unsigned int pos);
5169 
5170  T _elem;
5171 };
5172 
5180 template<class T>
5181 class Collection : public HandleHolder<OCI_Coll *>, public Streamable
5182 {
5183  friend class Statement;
5184  friend class Resultset;
5185  friend class BindArray;
5186  friend class Object;
5187  template<class>
5188  friend class CollectionIterator;
5189  template<class>
5190  friend class Collection;
5191 
5192 public:
5193 
5200  {
5202  Varray = OCI_COLL_VARRAY,
5204  NestedTable = OCI_COLL_NESTED_TABLE,
5206  IndexedTable = OCI_COLL_INDEXED_TABLE
5207  };
5208 
5217 
5223  Collection();
5224 
5232  Collection(const TypeInfo &typeInfo);
5233 
5239  CollectionType GetType() const;
5240 
5246  unsigned int GetMax() const;
5247 
5253  unsigned int GetSize() const;
5254 
5265  unsigned int GetCount() const;
5266 
5274  void Truncate(unsigned int size);
5275 
5282  void Clear();
5283 
5294  bool IsElementNull(unsigned int index) const;
5295 
5306  void SetElementNull(unsigned int index);
5307 
5325  bool Delete(unsigned int index) const;
5326 
5334  T Get(unsigned int index) const;
5335 
5344  void Set(unsigned int index, const T &value);
5345 
5354  void Append(const T &data);
5355 
5361  TypeInfo GetTypeInfo() const;
5362 
5368  Collection Clone() const;
5369 
5375  ostring ToString() const override;
5376 
5383 
5390 
5396  iterator begin();
5397 
5403  const_iterator begin() const;
5404 
5410  iterator end();
5411 
5417  const_iterator end() const;
5418 
5424  CollectionElement<T> operator [] (unsigned int index);
5425 
5431  const CollectionElement<T> operator [] (unsigned int index) const;
5432 
5433 private:
5434 
5435  static T GetElem(OCI_Elem *elem, Handle *parent);
5436 
5437  static void SetElem(OCI_Elem *elem, const T &value);
5438 
5439  Collection(OCI_Coll *pColl, Handle *parent = nullptr);
5440 };
5441 
5449 template<class T, int U>
5450 class Long : public HandleHolder<OCI_Long *>
5451 {
5452  friend class Statement;
5453  friend class Resultset;
5454  friend class BindArray;
5455 
5456 public:
5457 
5463  Long();
5464 
5472  Long(const Statement &statement);
5473 
5484  unsigned int Write(const T& content);
5485 
5491  unsigned int GetLength() const;
5492 
5498  T GetContent() const;
5499 
5500 private:
5501 
5502  Long(OCI_Long *pLong, Handle *parent = nullptr);
5503 };
5504 
5512 class BindInfo : public HandleHolder<OCI_Bind *>
5513 {
5514  friend class Statement;
5515 
5516 public:
5517 
5524  {
5526  In = OCI_BDM_IN,
5528  Out = OCI_BDM_OUT,
5530  InOut = OCI_BDM_IN_OUT
5531  };
5532 
5541 
5548  {
5550  AsArray = 1,
5552  AsPlSqlTable = 2
5553  };
5554 
5563 
5569  ostring GetName() const;
5570 
5576  DataType GetType() const;
5577 
5597  unsigned int GetSubType() const;
5598 
5608  unsigned int GetDataCount() const;
5609 
5615  Statement GetStatement() const;
5616 
5637  void SetDataNull(bool value, unsigned int index = 1);
5638 
5653  bool IsDataNull(unsigned int index = 1) const;
5654 
5668  void SetCharsetForm(CharsetForm value);
5669 
5675  BindDirection GetDirection() const;
5676 
5677 private:
5678 
5679  BindInfo(OCI_Bind *pBind, Handle *parent);
5680 };
5681 
5689 class Statement : public HandleHolder<OCI_Statement *>
5690 {
5691  friend class Exception;
5692  friend class Resultset;
5693  template<class, int>
5694  friend class Long;
5695  friend class BindInfo;
5696  friend class BindObject;
5697 
5698 public:
5699 
5706  {
5708  TypeSelect = OCI_CST_SELECT,
5710  TypeUpdate = OCI_CST_UPDATE,
5712  TypeDelete = OCI_CST_DELETE,
5714  TypeInsert = OCI_CST_INSERT,
5716  TypeCreate = OCI_CST_CREATE,
5718  TypeDrop = OCI_CST_DROP,
5720  TypeAlter = OCI_CST_ALTER,
5722  TypeBegin = OCI_CST_BEGIN,
5724  TypeDeclare = OCI_CST_DECLARE,
5726  TypeCall = OCI_CST_CALL,
5728  TypeMerge = OCI_CST_MERGE
5729  };
5730 
5739 
5746  {
5748  FetchForward = OCI_SFM_DEFAULT,
5750  FetchScrollable = OCI_SFM_SCROLLABLE
5751  };
5752 
5761 
5768  {
5770  BindByPosition = OCI_BIND_BY_POS,
5772  BindByName = OCI_BIND_BY_NAME
5773  };
5774 
5783 
5790  {
5792  LongExplicit = OCI_LONG_EXPLICIT,
5794  LongImplicit = OCI_LONG_IMPLICIT
5795  };
5796 
5805 
5811  Statement();
5812 
5823  Statement(const Connection &connection);
5824 
5830  Connection GetConnection() const;
5831 
5858  void Describe(const ostring& sql);
5859 
5883  void Parse(const ostring& sql);
5884 
5895  void Prepare(const ostring& sql);
5896 
5902  void ExecutePrepared();
5903 
5911  void Execute(const ostring& sql);
5912 
5930  template<class T>
5931  unsigned int ExecutePrepared(T callback);
5932 
5953  template<class T, class U>
5954  unsigned int ExecutePrepared(T callback, U adapter);
5955 
5974  template<class T>
5975  unsigned int Execute(const ostring& sql, T callback);
5976 
5998  template<class T, class U>
5999  unsigned int Execute(const ostring& sql, T callback, U adapter);
6000 
6015  unsigned int GetAffectedRows() const;
6016 
6022  ostring GetSql() const;
6023 
6029  ostring GetSqlIdentifier() const;
6030 
6042  Resultset GetResultset();
6043 
6065  Resultset GetNextResultset();
6066 
6091  void SetBindArraySize(unsigned int size);
6092 
6098  unsigned int GetBindArraySize() const;
6099 
6115  void AllowRebinding(bool value);
6116 
6125  bool IsRebindingAllowed() const;
6126 
6143  unsigned int GetBindIndex(const ostring& name) const;
6144 
6150  unsigned int GetBindCount() const;
6151 
6166  BindInfo GetBind(unsigned int index) const;
6167 
6178  BindInfo GetBind(const ostring& name) const;
6179 
6199  template<class T>
6200  void Bind(const ostring& name, T &value, BindInfo::BindDirection mode);
6201 
6223  template<class T, class U>
6224  void Bind(const ostring& name, T &value,U extraInfo, BindInfo::BindDirection mode);
6225 
6237  template<class T>
6238  void Bind(const ostring& name, Collection<T> &value, BindInfo::BindDirection mode);
6239 
6260  template<class T>
6261  void Bind(const ostring& name, std::vector<T> &values, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6262 
6283  template<class T>
6284  void Bind(const ostring& name, std::vector<T> &values, TypeInfo &typeInfo, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6285 
6299  template<class T>
6300  void Bind(const ostring& name, std::vector<Collection<T> > &values, TypeInfo &typeInfo, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6301 
6325  template<class T, class U>
6326  void Bind(const ostring& name, std::vector<T> &values, U extraInfo, BindInfo::BindDirection mode, BindInfo::VectorType type = BindInfo::AsArray);
6327 
6348  template<class T>
6349  void Register(const ostring& name);
6350 
6368  template<class T, class U>
6369  void Register(const ostring& name, U& extraInfo);
6370 
6389  template<class T, class U>
6390  void Register(const ostring& name, U extraInfo);
6391 
6397  StatementType GetStatementType() const;
6398 
6408  unsigned int GetSqlErrorPos() const;
6409 
6420  void SetFetchMode(FetchMode value);
6421 
6430  FetchMode GetFetchMode() const;
6431 
6439  void SetBindMode(BindMode value);
6440 
6449  BindMode GetBindMode() const;
6450 
6458  void SetFetchSize(unsigned int value);
6459 
6468  unsigned int GetFetchSize() const;
6469 
6480  void SetPrefetchSize(unsigned int value);
6481 
6490  unsigned int GetPrefetchSize() const;
6491 
6510  void SetPrefetchMemory(unsigned int value);
6511 
6520  unsigned int GetPrefetchMemory() const;
6521 
6529  void SetLongMaxSize(unsigned int value);
6530 
6539  unsigned int GetLongMaxSize() const;
6540 
6551  void SetLongMode(LongMode value);
6552 
6558  LongMode GetLongMode() const;
6559 
6572  unsigned int GetSQLCommand() const;
6573 
6586  ostring GetSQLVerb() const;
6587 
6593  void GetBatchErrors(std::vector<Exception> &exceptions);
6594 
6595 private:
6596 
6597  static bool IsResultsetHandle(Handle *handle);
6598  static void OnFreeSmartHandle(SmartHandle *smartHandle);
6599 
6600  Statement(OCI_Statement *stmt, Handle *parent = nullptr);
6601 
6602  BindsHolder *GetBindsHolder(bool allocate) const;
6603 
6604  void ReleaseResultsets() const;
6605 
6606  void SetLastBindMode(BindInfo::BindDirection mode);
6607 
6608  void SetInData() const;
6609  void SetOutData() const;
6610  void ClearBinds() const;
6611 
6612  template<typename M, class T>
6613  void Bind1 (M &method, const ostring& name, T& value, BindInfo::BindDirection mode);
6614 
6615  template<typename M, class T>
6616  void Bind2 (M &method, const ostring& name, T &value, BindInfo::BindDirection mode);
6617 
6618  template<typename M, class T>
6619  void BindVector1(M &method, const ostring& name, std::vector<T> &values, BindInfo::BindDirection mode, BindInfo::VectorType type);
6620 
6621  template<typename M, class T, class U>
6622  void BindVector2(M &method, const ostring& name, std::vector<T> &values, BindInfo::BindDirection mode, U subType, BindInfo::VectorType type);
6623 
6624  template<typename T>
6625  unsigned int Fetch(T callback);
6626 
6627  template<typename T, typename U>
6628  unsigned int Fetch(T callback, U adapter);
6629 };
6630 
6638 class Resultset : public HandleHolder<OCI_Resultset *>
6639 {
6640  friend class Statement;
6641 public:
6642 
6649  {
6651  SeekAbsolute = OCI_SFD_ABSOLUTE,
6653  SeekRelative = OCI_SFD_RELATIVE
6654  };
6655 
6664 
6677  template<class T>
6678  T Get(unsigned int index) const;
6679 
6693  template<class T>
6694  void Get(unsigned int index, T &value) const;
6695 
6708  template<class T>
6709  T Get(const ostring& name) const;
6710 
6721  template<class T>
6722  void Get(const ostring &name, T &value) const;
6723 
6738  template<class T, class U>
6739  bool Get(T& value, U adapter) const;
6740 
6756  template<typename T>
6757  unsigned int ForEach(T callback);
6758 
6781  template<typename T, typename U>
6782  unsigned int ForEach(T callback, U adapter);
6783 
6797  bool Next();
6798 
6812  bool Prev();
6813 
6825  bool First();
6826 
6838  bool Last();
6839 
6860  bool Seek(SeekMode mode, int offset);
6861 
6867  unsigned int GetCount() const;
6868 
6879  unsigned int GetCurrentRow() const;
6880 
6894  unsigned int GetColumnIndex(const ostring& name) const;
6895 
6901  unsigned int GetColumnCount() const;
6902 
6913  Column GetColumn(unsigned int index) const;
6914 
6925  Column GetColumn(const ostring& name) const;
6926 
6937  bool IsColumnNull(unsigned int index) const;
6938 
6946  bool IsColumnNull(const ostring& name) const;
6947 
6953  Statement GetStatement() const;
6954 
6960  bool operator ++ (int);
6961 
6967  bool operator -- (int);
6968 
6975  bool operator += (int offset);
6976 
6983  bool operator -= (int offset);
6984 
6985 private:
6986 
6987  Resultset(OCI_Resultset *resultset, Handle *parent);
6988 };
6989 
6997 class Column : public HandleHolder<OCI_Column *>
6998 {
6999  friend class TypeInfo;
7000  friend class Resultset;
7001 
7002 public:
7003 
7010  {
7012  NoFlags = OCI_CPF_NONE,
7015  IsIdentity = OCI_CPF_IS_IDENTITY,
7019  IsGeneratedAlways = OCI_CPF_IS_GEN_ALWAYS,
7022  IsGeneratedByDefaultOnNull = OCI_CPF_IS_GEN_BY_DEFAULT_ON_NULL,
7024  IsLogicalPartitioning = OCI_CPF_IS_LPART,
7026  IsGeneratedByContainers = OCI_CPF_IS_CONID
7027  };
7028 
7037 
7043  ostring GetName() const;
7044 
7053  ostring GetSQLType() const;
7054 
7064  ostring GetFullSQLType() const;
7065 
7071  DataType GetType() const;
7072 
7090  unsigned int GetSubType() const;
7091 
7097  CharsetForm GetCharsetForm() const;
7098 
7104  CollationID GetCollationID() const;
7105 
7115  unsigned int GetSize() const;
7116 
7122  int GetScale() const;
7123 
7129  int GetPrecision() const;
7130 
7136  int GetFractionalPrecision() const;
7137 
7143  int GetLeadingPrecision() const;
7144 
7155  PropertyFlags GetPropertyFlags() const;
7156 
7162  bool IsNullable() const;
7163 
7173  bool IsCharSemanticUsed() const;
7174 
7184  TypeInfo GetTypeInfo() const;
7185 
7186 private:
7187 
7188  Column(OCI_Column *pColumn, Handle *parent);
7189 };
7190 
7201 class Subscription : public HandleHolder<OCI_Subscription *>
7202 {
7203  friend class Event;
7204 
7205 public:
7206 
7214  typedef void (*NotifyHandlerProc) (Event &evt);
7215 
7222  {
7224  ObjectChanges = OCI_CNT_OBJECTS,
7226  RowChanges = OCI_CNT_ROWS,
7228  DatabaseChanges = OCI_CNT_DATABASES,
7230  AllChanges = OCI_CNT_ALL
7231  };
7232 
7241 
7247  Subscription();
7248 
7264  void Register(const Connection &connection, const ostring& name, ChangeTypes changeTypes, NotifyHandlerProc handler, unsigned int port = 0, unsigned int timeout = 0);
7265 
7280  void Unregister();
7281 
7287  void Watch(const ostring& sql);
7288 
7294  ostring GetName() const;
7295 
7301  unsigned int GetTimeout() const;
7302 
7308  unsigned int GetPort() const;
7309 
7318  Connection GetConnection() const;
7319 
7320 private:
7321 
7322  Subscription(OCI_Subscription *pSubcription);
7323 };
7324 
7335 class Event : public HandleHolder<OCI_Event *>
7336 {
7337  friend class Subscription;
7338  friend class Environment;
7339 
7340 public:
7341 
7348  {
7350  DatabaseStart = OCI_ENT_STARTUP,
7352  DatabaseShutdown = OCI_ENT_SHUTDOWN,
7354  DatabaseShutdownAny = OCI_ENT_SHUTDOWN_ANY,
7356  DatabaseDrop = OCI_ENT_DROP_DATABASE,
7358  Unregister = OCI_ENT_DEREGISTER,
7360  ObjectChanged = OCI_ENT_OBJECT_CHANGED
7361  };
7362 
7371 
7378  {
7380  ObjectInserted = OCI_ONT_INSERT,
7382  ObjectUpdated = OCI_ONT_UPDATE,
7384  ObjectDeleted = OCI_ONT_DELETE,
7386  ObjectAltered = OCI_ONT_ALTER,
7388  ObjectDropped = OCI_ONT_DROP,
7390  ObjectGeneric = OCI_ONT_GENERIC
7391  };
7392 
7401 
7407  EventType GetType() const;
7408 
7417  ObjectEvent GetObjectEvent() const;
7418 
7424  ostring GetDatabaseName() const;
7425 
7434  ostring GetObjectName() const;
7435 
7441  ostring GetRowID() const;
7442 
7448  Subscription GetSubscription() const;
7449 
7450 private:
7451 
7452  Event(OCI_Event *pEvent);
7453 };
7454 
7462 class Agent : public HandleHolder<OCI_Agent *>
7463 {
7464  friend class Message;
7465  friend class Dequeue;
7466 
7467 public:
7468 
7491  Agent(const Connection &connection, const ostring& name = OTEXT(""), const ostring& address = OTEXT(""));
7492 
7498  ostring GetName() const;
7499 
7513  void SetName(const ostring& value);
7514 
7523  ostring GetAddress() const;
7524 
7538  void SetAddress(const ostring& value);
7539 
7540 private:
7541 
7542  Agent(OCI_Agent *pAgent, Handle *parent);
7543 };
7544 
7552 class Message : public HandleHolder<OCI_Msg *>
7553 {
7554  friend class Dequeue;
7555 
7556 public:
7557 
7564  {
7566  Ready = OCI_AMS_READY,
7568  Waiting = OCI_AMS_WAITING,
7570  Processed = OCI_AMS_PROCESSED,
7572  Expired = OCI_AMS_EXPIRED
7573  };
7574 
7583 
7613  Message(const TypeInfo &typeInfo);
7614 
7623  void Reset();
7624 
7630  template<class T>
7631  T GetPayload();
7632 
7640  template<class T>
7641  void SetPayload(const T &value);
7642 
7651  Date GetEnqueueTime() const;
7652 
7658  int GetAttemptCount() const;
7659 
7665  MessageState GetState() const;
7666 
7677  Raw GetID() const;
7678 
7687  int GetExpiration() const;
7688 
7708  void SetExpiration(int value);
7709 
7718  int GetEnqueueDelay() const;
7719 
7742  void SetEnqueueDelay(int value);
7743 
7752  int GetPriority() const;
7753 
7766  void SetPriority(int value);
7767 
7777  Raw GetOriginalID() const;
7778 
7790  void SetOriginalID(const Raw &value);
7791 
7800  ostring GetCorrelation() const;
7801 
7812  void SetCorrelation(const ostring& value);
7813 
7827  ostring GetExceptionQueue() const;
7828 
7855  void SetExceptionQueue(const ostring& value);
7856 
7865  Agent GetSender() const;
7866 
7874  void SetSender(const Agent &agent);
7875 
7887  void SetConsumers(std::vector<Agent> &agents);
7888 
7889 private:
7890 
7891  Message(OCI_Msg *pMessage, Handle *parent);
7892 };
7893 
7901 class Enqueue : public HandleHolder<OCI_Enqueue *>
7902 {
7903 public:
7904 
7911  {
7913  Before = OCI_ASD_BEFORE,
7915  OnTop = OCI_ASD_TOP
7916  };
7917 
7926 
7933  {
7935  Immediate = OCI_AMV_IMMEDIATE,
7937  OnCommit = OCI_AMV_ON_COMMIT
7938  };
7939 
7948 
7970  Enqueue(const TypeInfo &typeInfo, const ostring& queueName);
7971 
7979  void Put(const Message &message);
7980 
7989  EnqueueVisibility GetVisibility() const;
7990 
8001  void SetVisibility(EnqueueVisibility value);
8002 
8011  EnqueueMode GetMode() const;
8012 
8031  void SetMode(EnqueueMode value);
8032 
8043  Raw GetRelativeMsgID() const;
8044 
8058  void SetRelativeMsgID(const Raw &value);
8059 };
8060 
8068 class Dequeue : public HandleHolder<OCI_Dequeue *>
8069 {
8070  friend class Environment;
8071 
8072 public:
8073 
8081  typedef void (*NotifyAQHandlerProc) (Dequeue &dequeue);
8082 
8089  {
8091  Browse = OCI_ADM_BROWSE,
8093  Locked = OCI_ADM_LOCKED,
8095  Remove = OCI_ADM_REMOVE,
8097  Confirm = OCI_ADM_REMOVE_NODATA
8098  };
8099 
8108 
8115  {
8117  Immediate = OCI_AMV_IMMEDIATE,
8119  OnCommit = OCI_AMV_ON_COMMIT
8120  };
8121 
8130 
8137  {
8139  FirstMessage = OCI_ADN_FIRST_MSG,
8141  NextMessage = OCI_ADN_NEXT_MSG,
8144  NextTransaction = OCI_ADN_NEXT_TRANSACTION
8145  };
8146 
8155 
8164  Dequeue(const TypeInfo &typeInfo, const ostring& queueName);
8165 
8179  Message Get();
8180 
8196  Agent Listen(int timeout);
8197 
8206  ostring GetConsumer() const;
8207 
8219  void SetConsumer(const ostring& value);
8220 
8229  ostring GetCorrelation() const;
8230 
8242  void SetCorrelation(const ostring& value);
8243 
8252  Raw GetRelativeMsgID() const;
8253 
8261  void SetRelativeMsgID(const Raw &value);
8262 
8271  DequeueVisibility GetVisibility() const;
8272 
8287  void SetVisibility(DequeueVisibility value);
8288 
8297  DequeueMode GetMode() const;
8298 
8309  void SetMode(DequeueMode value);
8310 
8319  NavigationMode GetNavigation() const;
8320 
8340  void SetNavigation(NavigationMode value);
8341 
8350  int GetWaitTime() const;
8351 
8369  void SetWaitTime(int value);
8370 
8378  void SetAgents(std::vector<Agent> &agents);
8379 
8396  void Subscribe(unsigned int port, unsigned int timeout, NotifyAQHandlerProc handler);
8397 
8406  void Unsubscribe();
8407 
8408 private:
8409 
8410  Dequeue(OCI_Dequeue *pDequeue);
8411 };
8412 
8418 class Queue
8419 {
8420 public:
8421 
8428  {
8430  NormalQueue = OCI_AQT_NORMAL,
8432  ExceptionQueue = OCI_AQT_EXCEPTION,
8434  NonPersistentQueue = OCI_AQT_NON_PERSISTENT
8435  };
8436 
8445 
8470  static void Create(const Connection &connection, const ostring& queue, const ostring& table, QueueType type = NormalQueue,
8471  unsigned int maxRetries = 0, unsigned int retryDelay = 0, unsigned int retentionTime = 0,
8472  bool dependencyTracking = false, const ostring& comment = OTEXT(""));
8473 
8494  static void Alter(const Connection &connection, const ostring& queue,
8495  unsigned int maxRetries= 0, unsigned int retryDelay= 0,
8496  unsigned int retentionTime= 0, const ostring& comment = OTEXT(""));
8497 
8513  static void Drop(const Connection &connection, const ostring& queue);
8514 
8532  static void Start(const Connection &connection, const ostring& queue, bool enableEnqueue = true, bool enableDequeue = true);
8533 
8552  static void Stop(const Connection &connection, const ostring& queue, bool stopEnqueue = true, bool stopDequeue = true, bool wait = true);
8553 };
8554 
8561 {
8562 public:
8563 
8571  {
8573  None = OCI_AGM_NONE,
8576  Transactionnal = OCI_AGM_TRANSACTIONNAL
8577  };
8578 
8587 
8595  {
8597  Buffered = OCI_APM_BUFFERED,
8599  Persistent = OCI_APM_PERSISTENT,
8601  All = OCI_APM_ALL
8602  };
8603 
8612 
8647  static void Create(const Connection &connection, const ostring& table, const ostring& payloadType, bool multipleConsumers,
8648  const ostring& storageClause = OTEXT(""), const ostring& sortList = OTEXT(""),
8649  GroupingMode groupingMode = None, const ostring& comment = OTEXT(""),
8650  unsigned int primaryInstance = 0, unsigned int secondaryInstance = 0,
8651  const ostring& compatible = OTEXT(""));
8652 
8671  static void Alter(const Connection &connection, const ostring& table, const ostring& comment, unsigned int primaryInstance = 0, unsigned int secondaryInstance = 0);
8672 
8693  static void Drop(const Connection &connection, const ostring& table, bool force = true);
8694 
8718  static void Purge(const Connection &connection, const ostring& table, PurgeMode mode, const ostring& condition = OTEXT(""), bool block = true);
8719 
8737  static void Migrate(const Connection &connection, const ostring& table, const ostring& compatible = OTEXT(""));
8738 };
8739 
8747 class DirectPath : public HandleHolder<OCI_DirPath *>
8748 {
8749 public:
8750 
8757  {
8759  Default = OCI_DCM_DEFAULT,
8761  Force = OCI_DCM_FORCE
8762  };
8763 
8772 
8779  {
8781  ResultComplete = OCI_DPR_COMPLETE,
8783  ResultError = OCI_DPR_ERROR,
8785  ResultFull = OCI_DPR_FULL ,
8787  ResultPartial = OCI_DPR_PARTIAL,
8789  ResultEmpty = OCI_DPR_EMPTY
8790  };
8791 
8800 
8822  DirectPath(const TypeInfo &typeInfo, unsigned int nbCols, unsigned int nbRows, const ostring& partition = OTEXT(""));
8823 
8840  void SetColumn(unsigned int colIndex, const ostring& name, unsigned int maxSize, const ostring& format = OTEXT(""));
8841 
8872  template<class T>
8873  void SetEntry(unsigned int rowIndex, unsigned int colIndex, const T& value, bool complete = true);
8874 
8885  void Reset();
8886 
8892  void Prepare();
8893 
8912  DirectPath::Result Convert();
8913 
8925  DirectPath::Result Load();
8926 
8935  void Finish();
8936 
8949  void Abort();
8950 
8959  void Save();
8960 
8966  void FlushRow();
8967 
8979  void SetCurrentRows(unsigned int value);
8980 
8989  unsigned int GetCurrentRows() const;
8990 
8999  unsigned int GetMaxRows() const;
9000 
9009  unsigned int GetRowCount() const;
9010 
9023  unsigned int GetAffectedRows() const;
9024 
9038  void SetDateFormat(const ostring& format);
9039 
9066  void SetParallel(bool value);
9067 
9082  void SetNoLog(bool value);
9083 
9097  void SetCacheSize(unsigned int value);
9098 
9109  void SetBufferSize(unsigned int value);
9110 
9124  void SetConversionMode(ConversionMode value);
9125 
9154  unsigned int GetErrorColumn();
9155 
9189  unsigned int GetErrorRow();
9190 };
9191 
9192 }
9193 
9194 #include "ocilib_impl.hpp"
9195 
9196 #endif
9197 
struct OCI_Mutex OCI_Mutex
OCILIB encapsulation of OCI mutexes.
Definition: ocilib.h:699
struct OCI_Agent OCI_Agent
OCILIB encapsulation of A/Q Agent.
Definition: ocilib.h:759
CharsetModeValues
Charset mode enumerated values.
Definition: ocilib.hpp:778
Encapsulate a Resultset column or object member properties.
Definition: ocilib.hpp:6997
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.
Definition: ocilib.hpp:4485
DequeueVisibilityValues
Message visibility enumerated values.
Definition: ocilib.hpp:8114
STL compliant Collection Random iterator class.
Definition: ocilib.hpp:5122
Flags< SessionFlagsValues > SessionFlags
Sessions flags.
Definition: ocilib.hpp:831
struct OCI_Connection OCI_Connection
Oracle physical connection.
Definition: ocilib.h:423
Static class allowing to set/get thread local storage (TLS) values for a given unique key...
Definition: ocilib.hpp:1458
Exception class handling all OCILIB errors.
Definition: ocilib.hpp:536
Provides SQL bind informations.
Definition: ocilib.hpp:5512
TypeInfoTypeValues
Type of object information enumerated values.
Definition: ocilib.hpp:4698
EventTypeValues
Event type enumerated values.
Definition: ocilib.hpp:7347
LobTypeValues
Lob types enumerated values.
Definition: ocilib.hpp:459
CollectionIterator< const CollectionElement< T > > const_iterator
Common const iterator declaration.
Definition: ocilib.hpp:5389
Enum< BindModeValues > BindMode
Bind Modes.
Definition: ocilib.hpp:5782
OCILIB ++ Namespace.
HAEventSourceValues
HA Event sources enumerated values.
Definition: ocilib.hpp:678
Enum< DequeueModeValues > DequeueMode
Dequeue mode.
Definition: ocilib.hpp:8107
Enum< PoolTypeValues > PoolType
Type of Pool.
Definition: ocilib.hpp:1538
Enum< CharsetFormValues > CharsetForm
Type of charsetForm.
Definition: ocilib.hpp:361
FetchModeValues
Fetch Modes enumerated values.
Definition: ocilib.hpp:5745
TimeoutTypeValues
Timeout enumerated values.
Definition: ocilib.hpp:1767
HAEventTypeValues
HA Event types enumerated values.
Definition: ocilib.hpp:710
unsigned int GetRow() const
Return the row index which caused an error during statement execution.
Class allowing the administration of Oracle Queues.
Definition: ocilib.hpp:8418
SessionTraceValues
Session trace enumerated values.
Definition: ocilib.hpp:1872
Enum< GroupingModeValues > GroupingMode
Grouping Mode.
Definition: ocilib.hpp:8586
Subscription Event.
Definition: ocilib.hpp:7335
StatementTypeValues
Statement Type enumerated values.
Definition: ocilib.hpp:5705
Enum< LobTypeValues > LobType
Type of Lob.
Definition: ocilib.hpp:476
Enum< DataTypeValues > DataType
Column data type.
Definition: ocilib.hpp:303
OCI_Mutex * MutexHandle
Alias for an OCI_Mutex pointer.
Definition: ocilib.hpp:187
struct OCI_XID OCI_XID
Global transaction identifier.
ostring GetMessage() const
Retrieve the error message.
Object used for executing SQL or PL/SQL statement and returning the produced results.
Definition: ocilib.hpp:5689
A connection or session with a specific database.
Definition: ocilib.hpp:1742
Flags< PropertyFlagsValues > PropertyFlags
Column properties flags.
Definition: ocilib.hpp:7036
static class allowing to manipulate threads
Definition: ocilib.hpp:1333
PoolTypeValues
Pool type enumerated values.
Definition: ocilib.hpp:1523
struct OCI_Interval OCI_Interval
Oracle internal interval representation.
Definition: ocilib.h:598
Object identifying the SQL data type LONG.
Definition: ocilib.hpp:5450
struct OCI_Dequeue OCI_Dequeue
OCILIB encapsulation of A/Q dequeuing operations.
Definition: ocilib.h:769
int GetOracleErrorCode() const
Return the Oracle error code.
Oracle Transaction object.
Definition: ocilib.hpp:2537
FailoverResultValues
Failover callback results enumerated values.
Definition: ocilib.hpp:1850
struct OCI_Statement OCI_Statement
Oracle SQL or PL/SQL statement.
Definition: ocilib.h:435
struct OCI_Bind OCI_Bind
Internal bind representation.
Definition: ocilib.h:447
STL namespace.
Enum< ObjectTypeValues > ObjectType
Object Type.
Definition: ocilib.hpp:4855
LongTypeValues
Long types enumerated values.
Definition: ocilib.hpp:483
struct OCI_Subscription OCI_Subscription
OCILIB encapsulation of Oracle DCN notification.
Definition: ocilib.h:729
TimestampTypeValues
Interval types enumerated values.
Definition: ocilib.hpp:3684
StartFlagsValues
Oracle instance start flags enumerated values.
Definition: ocilib.hpp:864
Flags< ShutdownFlagsValues > ShutdownFlags
Oracle instance shutdown flags.
Definition: ocilib.hpp:944
AQ identified agent for messages delivery.
Definition: ocilib.hpp:7462
Static class allowing managing mutexes.
Definition: ocilib.hpp:1406
Enum< DequeueVisibilityValues > DequeueVisibility
Message visibility after begin dequeued.
Definition: ocilib.hpp:8129
Enum< OracleVersionValues > OracleVersion
Oracle Version.
Definition: ocilib.hpp:257
Oracle Direct path loading encapsulation.
Definition: ocilib.hpp:8747
Enum< EnqueueVisibilityValues > EnqueueVisibility
Message visibility after begin queued.
Definition: ocilib.hpp:7947
Enum< NavigationModeValues > NavigationMode
Navigation Mode.
Definition: ocilib.hpp:8154
struct OCI_Timestamp OCI_Timestamp
Oracle internal timestamp representation.
Definition: ocilib.h:588
Enum< EventTypeValues > EventType
Event type.
Definition: ocilib.hpp:7370
EnqueueModeValues
Message enqueuing mode enumerated values.
Definition: ocilib.hpp:7910
void(* POCI_THREAD)(OCI_Thread *thread, void *arg)
Thread procedure prototype.
Definition: ocilib.h:808
Template Enumeration template class providing some type safety to some extends for manipulating enume...
Flags< ChangeTypesValues > ChangeTypes
Subscription changes flags.
Definition: ocilib.hpp:7240
Enum< ExceptionTypeValues > ExceptionType
Type of Exception.
Definition: ocilib.hpp:566
ConversionModeValues
Conversion mode enumerated values.
Definition: ocilib.hpp:8756
VectorTypeValues
Vector type values.
Definition: ocilib.hpp:5547
Flags< ShutdownModeValues > ShutdownMode
Oracle instance shutdown modes.
Definition: ocilib.hpp:907
Flags< EnvironmentFlagsValues > EnvironmentFlags
Environment Flags.
Definition: ocilib.hpp:749
ShutdownModeValues
Oracle instance shutdown modes enumerated values.
Definition: ocilib.hpp:888
struct OCI_Msg OCI_Msg
OCILIB encapsulation of A/Q message.
Definition: ocilib.h:749
const void * ThreadId
Thread Unique ID.
Definition: ocilib.hpp:205
Object identifying the SQL data type REF.
Definition: ocilib.hpp:5001
Enum< IntervalTypeValues > IntervalType
Interval types.
Definition: ocilib.hpp:3299
SeekModeValues
Seek Modes enumerated values.
Definition: ocilib.hpp:413
Enum< StatementTypeValues > StatementType
Statement Type.
Definition: ocilib.hpp:5738
PurgeModeValues
Purge mode enumerated values.
Definition: ocilib.hpp:8594
Static class in charge of library initialization / cleanup.
Definition: ocilib.hpp:661
FailoverRequestValues
Failover request enumerated values.
Definition: ocilib.hpp:1800
Class used for handling transient collection value. it is used internally by the Collection<T> class:...
Definition: ocilib.hpp:5090
AllocatedBytesValues
Allocated Bytes enumerated values.
Definition: ocilib.hpp:951
Enum< ObjectEventValues > ObjectEvent
Object events.
Definition: ocilib.hpp:7400
FailoverEventValues
Failover events enumerated values.
Definition: ocilib.hpp:1822
Enum< VectorTypeValues > VectorType
Vector type.
Definition: ocilib.hpp:5562
struct OCI_Ref OCI_Ref
Oracle REF type representation.
Definition: ocilib.h:655
ChangeTypesValues
Subscription changes flags values.
Definition: ocilib.hpp:7221
Enum< SeekModeValues > SeekMode
Seek Modes.
Definition: ocilib.hpp:6663
void * AnyPointer
Alias for the generic void pointer.
Definition: ocilib.hpp:169
const char * what() const override
Override the std::exception::what() method.
ExceptionType GetType() const
Return the Exception type.
Connection GetConnection() const
Return the connection within the error occurred.
Object identifying the SQL data type BFILE.
Definition: ocilib.hpp:4495
Object identifying the SQL data types VARRAY and NESTED TABLE.
Definition: ocilib.hpp:5181
Enum< MessageStateValues > MessageState
Message state.
Definition: ocilib.hpp:7582
struct OCI_Date OCI_Date
Oracle internal date representation.
Definition: ocilib.h:578
Flags< AllocatedBytesValues > AllocatedBytesFlags
Allocated Bytes.
Definition: ocilib.hpp:968
ResultValues
Direct Operation Result enumerated values.
Definition: ocilib.hpp:8778
friend T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so, it raises a C++ exception using the retrieved error handle.
Flags< StartFlagsValues > StartFlags
Oracle instance start flags.
Definition: ocilib.hpp:881
Object identifying the SQL data type INTERVAL.
Definition: ocilib.hpp:3267
Enum< FormatTypeValues > FormatType
Format type.
Definition: ocilib.hpp:526
int GetInternalErrorCode() const
Return the OCILIB error code.
Enum< TimeoutTypeValues > TimeoutType
Timeout Types.
Definition: ocilib.hpp:1793
CollectionTypeValues
Collection type enumerated values.
Definition: ocilib.hpp:5199
Enum< EnqueueModeValues > EnqueueMode
Message enqueuing mode.
Definition: ocilib.hpp:7925
struct OCI_Transaction OCI_Transaction
Oracle Transaction.
Definition: ocilib.h:537
POCI_THREADKEYDEST ThreadKeyFreeProc
Thread Key callback for freeing resources.
Definition: ocilib.hpp:1468
GroupingModeValues
Grouping mode enumerated values.
Definition: ocilib.hpp:8570
Class allowing the administration of Oracle Queue tables.
Definition: ocilib.hpp:8560
Enum< LongModeValues > LongMode
LONG data type mapping modes.
Definition: ocilib.hpp:5804
Enum< TimestampTypeValues > TimestampType
Type of timestamp.
Definition: ocilib.hpp:3701
Enqueue object for queuing messages into an Oracle Queue.
Definition: ocilib.hpp:7901
struct OCI_Resultset OCI_Resultset
Collection of output columns from a select statement.
Definition: ocilib.h:462
SessionFlagsValues
Session flags enumerated values.
Definition: ocilib.hpp:800
TransactionFlagsValues
Transaction flags enumerated values.
Definition: ocilib.hpp:2548
Enum< FailoverEventValues > FailoverEvent
Failover events.
Definition: ocilib.hpp:1843
OpenModeValues
Open Modes enumerated values.
Definition: ocilib.hpp:437
Enum< FetchModeValues > FetchMode
Fetch Modes.
Definition: ocilib.hpp:5760
A connection or session Pool.
Definition: ocilib.hpp:1514
BindModeValues
Bind Modes enumerated values.
Definition: ocilib.hpp:5767
Enum< PurgeModeValues > PurgeMode
Purge mode.
Definition: ocilib.hpp:8611
Enum< HAEventSourceValues > HAEventSource
Source of HA events.
Definition: ocilib.hpp:703
BindDirectionValues
Bind direction enumerated values.
Definition: ocilib.hpp:5523
Enum< FailoverResultValues > FailoverResult
Failover callback results.
Definition: ocilib.hpp:1865
Enum< LongTypeValues > LongType
Type of Long.
Definition: ocilib.hpp:498
struct OCI_File OCI_File
Oracle External Large objects:
Definition: ocilib.h:522
struct OCI_Thread OCI_Thread
OCILIB encapsulation of OCI Threads.
Definition: ocilib.h:709
Enum< HAEventTypeValues > HAEventType
Type of HA events.
Definition: ocilib.hpp:725
ObjectEventValues
Object events enumerated values.
Definition: ocilib.hpp:7377
LongModeValues
LONG data type mapping modes enumerated values.
Definition: ocilib.hpp:5789
Abstract class allowing derived classes to be compatible with any type supporting the operator << oci...
Flags< StartModeValues > StartMode
Oracle instance start modes.
Definition: ocilib.hpp:857
ObjectTypeValues
Object Type enumerated values.
Definition: ocilib.hpp:4838
Enum< ConversionModeValues > ConversionMode
Conversion Mode.
Definition: ocilib.hpp:8771
struct OCI_Number OCI_Number
Oracle NUMBER representation.
Definition: ocilib.h:568
Enum< NumericTypeValues > NumericType
Numeric data type.
Definition: ocilib.hpp:339
void * CallbackPointer
Alias used for storing user callback method pointers.
Definition: ocilib.hpp:214
CollectionIterator< CollectionElement< T > > iterator
Common iterator declaration.
Definition: ocilib.hpp:5382
Enum< CharsetModeValues > CharsetMode
Environment charset mode.
Definition: ocilib.hpp:793
Template class providing OCILIB handles auto memory, life cycle and scope management.
NumericTypeValues
Numeric type enumerated values.
Definition: ocilib.hpp:310
Enum< TypeInfoTypeValues > TypeInfoType
Type of object information.
Definition: ocilib.hpp:4715
OCI_Thread * ThreadHandle
Alias for an OCI_Thread pointer.
Definition: ocilib.hpp:196
Enum< ImportModeValues > ImportMode
OCI libraries import mode.
Definition: ocilib.hpp:771
CharsetFormValues
Charset form enumerated values.
Definition: ocilib.hpp:346
void(* POCI_THREADKEYDEST)(void *data)
Thread key destructor prototype.
Definition: ocilib.h:824
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
Definition: ocilib.hpp:178
CollationIDValues
Collation ID enumerated values.
Definition: ocilib.hpp:368
struct OCI_Long OCI_Long
Oracle Long data type.
Definition: ocilib.h:559
Provides type information on Oracle Database objects.
Definition: ocilib.hpp:4684
EnqueueVisibilityValues
Message visibility enumerated values.
Definition: ocilib.hpp:7932
struct OCI_TypeInfo OCI_TypeInfo
Type info metadata handle.
Definition: ocilib.h:665
NavigationModeValues
Navigation Mode enumerated values.
Definition: ocilib.hpp:8136
Object identifying the SQL data type NUMBER.
Definition: ocilib.hpp:2656
IntervalTypeValues
Interval types enumerated values.
Definition: ocilib.hpp:3284
POCI_THREAD ThreadProc
Thread callback.
Definition: ocilib.hpp:1343
ShutdownFlagsValues
Oracle instance shutdown flags enumerated values.
Definition: ocilib.hpp:914
DequeueModeValues
Dequeue mode enumerated values.
Definition: ocilib.hpp:8088
Statement GetStatement() const
Return the statement within the error occurred.
DataTypeValues
Data type enumerated values.
Definition: ocilib.hpp:264
ImportModeValues
OCI libraries import mode enumerated values.
Definition: ocilib.hpp:756
Enum< FailoverRequestValues > FailoverRequest
Failover requests.
Definition: ocilib.hpp:1815
Lob< ostring, LobNationalCharacter > NClob
Class handling NCLOB oracle type.
Definition: ocilib.hpp:4474
MessageStateValues
Message state enumerated values.
Definition: ocilib.hpp:7563
OracleVersionValues
Oracle Version enumerated values.
Definition: ocilib.hpp:232
Enum< SeekModeValues > SeekMode
Seek Modes.
Definition: ocilib.hpp:430
Object identifying the SQL data type LOB (CLOB, NCLOB and BLOB)
Definition: ocilib.hpp:4173
Enum< CollationIDValues > CollationID
Type of Collation ID.
Definition: ocilib.hpp:405
SeekModeValues
Seek Modes enumerated values.
Definition: ocilib.hpp:6648
Enum< ResultValues > Result
Direct Operation Result.
Definition: ocilib.hpp:8799
QueueTypeValues
Queue Type enumerated values.
Definition: ocilib.hpp:8427
ExceptionTypeValues
Exception type enumerated values.
Definition: ocilib.hpp:549
Lob< ostring, LobCharacter > Clob
Class handling CLOB oracle type.
Definition: ocilib.hpp:4463
Enum< BindDirectionValues > BindDirection
Bind direction.
Definition: ocilib.hpp:5540
struct OCI_Coll OCI_Coll
Oracle Collections (VARRAYs and Nested Tables) representation.
Definition: ocilib.h:618
PropertyFlagsValues
Column properties flags values.
Definition: ocilib.hpp:7009
Enum< SessionTraceValues > SessionTrace
Session traces.
Definition: ocilib.hpp:1891
struct OCI_Elem OCI_Elem
Oracle Collection item representation.
Definition: ocilib.h:628
FormatTypeValues
Format type enumerated values.
Definition: ocilib.hpp:505
AQ message.
Definition: ocilib.hpp:7552
Database resultset.
Definition: ocilib.hpp:6638
Flags< TransactionFlagsValues > TransactionFlags
Transaction flags.
Definition: ocilib.hpp:2572
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: ocilib.hpp:160
struct OCI_Object OCI_Object
Oracle Named types representation.
Definition: ocilib.h:608
StartModeValues
Oracle instance start modes enumerated values.
Definition: ocilib.hpp:838
struct OCI_Column OCI_Column
Oracle SQL Column and Type member representation.
Definition: ocilib.h:474
struct OCI_Error OCI_Error
Encapsulates an Oracle or OCILIB exception.
Definition: ocilib.h:689
Object identifying the SQL data type TIMESTAMP.
Definition: ocilib.hpp:3666
Enum< QueueTypeValues > QueueType
Queue Type.
Definition: ocilib.hpp:8444
Dequeue object for dequeuing messages into an Oracle Queue.
Definition: ocilib.hpp:8068
Object identifying the SQL data type OBJECT.
Definition: ocilib.hpp:4821
EnvironmentFlagsValues
Environment Flags enumerated values.
Definition: ocilib.hpp:732
struct OCI_Event OCI_Event
OCILIB encapsulation of Oracle DCN event.
Definition: ocilib.h:739
Subscription to database or objects changes.
Definition: ocilib.hpp:7201
struct OCI_Lob OCI_Lob
Oracle Internal Large objects:
Definition: ocilib.h:497
Enum< CollectionTypeValues > CollectionType
Collection type.
Definition: ocilib.hpp:5216
Object identifying the SQL data type DATE.
Definition: ocilib.hpp:2831
Enum< OpenModeValues > OpenMode
Open Modes.
Definition: ocilib.hpp:452