67 template<
class I,
class O,
boolean B>
72 static const bool IsHandle = B;
88 template<
class I,
class O>
150 inline Raw
MakeRaw(
void *result,
unsigned int size)
152 unsigned char *ptr =
static_cast<unsigned char *
>(result);
154 return (ptr && size > 0 ?
Raw(ptr, ptr + size) :
Raw());
157 template<
class S,
class C>
158 void ConverString(S &dest,
const C *src,
size_t length)
170 dest[i] =
static_cast<typename S::value_type
>(src[i]);
179 const int UTF8_BytesPerChar = 4;
181 unsigned int res =
sizeof(ostring::value_type);
186 #pragma warning(push) 187 #pragma warning(disable: 4996) 189 char *str = getenv(
"NLS_LANG");
197 std::string nlsLang = str;
199 for (
size_t i = 0; i < nlsLang.size(); ++i)
201 nlsLang[i] =
static_cast<std::string::value_type
>(toupper(nlsLang[i]));
204 if (ostring::npos != nlsLang.find(
"UTF8"))
206 res = UTF8_BytesPerChar;
243 return static_cast<unsigned int>(_value);
249 return other._value == _value;
255 return !(*
this == other);
261 return other == _value;
267 return !(*
this == other);
303 return Flags<T>(_flags | other._flags);
309 return Flags<T>(_flags & other._flags);
315 return Flags<T>(_flags ^ other._flags);
339 _flags |= other._flags;
346 _flags &= other._flags;
353 _flags ^= other._flags;
381 return _flags ==
static_cast<unsigned int>(other);
387 return _flags == other._flags;
393 return ((_flags & other) == _flags);
402 #define OCI_DEFINE_FLAG_OPERATORS(T) \ 403 inline Flags<T> operator | (T a, T b) { return Flags<T>(a) | Flags<T>(b); } \ 421 ManagedBuffer<T>::ManagedBuffer() : _buffer(
nullptr), _size(0)
426 ManagedBuffer<T>::ManagedBuffer(T *buffer,
size_t size) : _buffer(buffer), _size(size)
431 ManagedBuffer<T>::ManagedBuffer(
size_t size) : _buffer(
new T[size]), _size(size)
433 memset(_buffer, 0,
sizeof(T) * _size);
436 ManagedBuffer<T>::~ManagedBuffer()
442 ManagedBuffer<T>::operator T* ()
const 448 ManagedBuffer<T>::operator
const T* ()
const 465 Acquire(other,
nullptr,
nullptr, other._smartHandle ? other._smartHandle->GetParent() :
nullptr);
477 Acquire(other,
nullptr,
nullptr, other._smartHandle ? other._smartHandle->GetParent() :
nullptr);
484 return (static_cast<T>(*
this) == 0);
490 return _smartHandle ? _smartHandle->GetHandle() :
nullptr;
496 return _smartHandle ? _smartHandle->GetHandle() :
nullptr;
514 return static_cast<Handle *
>(_smartHandle);
518 void HandleHolder<T>::Acquire(T handle, HandleFreeFunc handleFreefunc, SmartHandleFreeNotifyFunc freeNotifyFunc, Handle *parent)
520 if (_smartHandle && _smartHandle->GetHandle() == handle)
529 _smartHandle = Environment::GetSmartHandle<SmartHandle*>(handle);
533 _smartHandle =
new SmartHandle(
this, handle, handleFreefunc, freeNotifyFunc, parent);
537 _smartHandle->Acquire(
this);
545 if (&other !=
this && _smartHandle != other._smartHandle)
549 if (other._smartHandle)
551 other._smartHandle->Acquire(
this);
552 _smartHandle = other._smartHandle;
562 _smartHandle->Release(
this);
565 _smartHandle =
nullptr;
568 inline Locker::Locker() : _mutex(
nullptr)
570 SetAccessMode(
false);
573 inline Locker::~Locker()
575 SetAccessMode(
false);
578 inline void Locker::SetAccessMode(
bool threaded)
580 if (threaded && !_mutex)
584 else if (!threaded && _mutex)
591 inline void Locker::Lock()
const 599 inline void Locker::Unlock()
const 607 inline Lockable::Lockable() : _locker(
nullptr)
612 inline Lockable::~Lockable()
617 inline void Lockable::Lock()
const 625 inline void Lockable::Unlock()
const 633 inline void Lockable::SetLocker(Locker *locker)
638 template<
class K,
class V>
639 ConcurrentMap<K, V>::ConcurrentMap()
644 template<
class K,
class V>
645 ConcurrentMap<K, V>::~ConcurrentMap()
650 template<
class K,
class V>
651 void ConcurrentMap<K, V>::Remove(K key)
658 template<
class K,
class V>
659 V ConcurrentMap<K, V>::Get(K key)
664 typename std::map< K, V >::const_iterator it = _map.find(key);
665 if (it != _map.end())
674 template<
class K,
class V>
675 void ConcurrentMap<K, V>::Set(K key, V value)
682 template<
class K,
class V>
683 void ConcurrentMap<K, V>::Clear()
690 template<
class K,
class V>
691 size_t ConcurrentMap<K, V>::GetSize()
694 size_t size = _map.size();
701 ConcurrentList<T>::ConcurrentList() : _list()
707 ConcurrentList<T>::~ConcurrentList()
713 void ConcurrentList<T>::Add(T value)
716 _list.push_back(value);
721 void ConcurrentList<T>::Remove(T value)
729 void ConcurrentList<T>::Clear()
737 size_t ConcurrentList<T>::GetSize()
740 size_t size = _list.size();
747 bool ConcurrentList<T>::Exists(
const T &value)
751 bool res = std::find(_list.begin(), _list.end(), value) != _list.end();
760 bool ConcurrentList<T>::FindIf(P predicate, T &value)
766 typename std::list<T>::iterator it = std::find_if(_list.begin(), _list.end(), predicate);
768 if (it != _list.end())
781 void ConcurrentList<T>::ForEach(A action)
785 std::for_each(_list.begin(), _list.end(), action);
793 HandleHolder *holder, T handle, HandleFreeFunc handleFreefunc,
794 SmartHandleFreeNotifyFunc freeNotifyFunc, Handle *parent
796 : _holders(), _children(), _locker(), _handle(handle), _handleFreeFunc(handleFreefunc),
797 _freeNotifyFunc(freeNotifyFunc), _parent(parent), _extraInfo(
nullptr)
801 _holders.SetLocker(&_locker);
802 _children.SetLocker(&_locker);
804 Environment::SetSmartHandle<SmartHandle*>(handle,
this);
808 if (_parent && _handle)
810 _parent->GetChildren().Add(
this);
820 if (_parent && _handle)
822 _parent->GetChildren().Remove(
this);
825 _children.ForEach(DeleteHandle);
828 _holders.SetLocker(
nullptr);
829 _children.SetLocker(
nullptr);
831 Environment::SetSmartHandle<SmartHandle*>(_handle,
nullptr);
835 _freeNotifyFunc(
this);
838 if (_handleFreeFunc && _handle)
840 ret = _handleFreeFunc(_handle);
855 handle->DetachFromParent();
856 handle->DetachFromHolders();
867 holder->_smartHandle =
nullptr;
874 _holders.Add(holder);
880 _holders.Remove(holder);
882 if (_holders.GetSize() == 0)
887 holder->_smartHandle =
nullptr;
911 _extraInfo = extraInfo;
923 _holders.ForEach(ResetHolder);
937 inline Exception::Exception()
939 _pStatement(
nullptr),
940 _pConnnection(
nullptr),
942 _type(static_cast<ExceptionType::Type>(0)),
954 inline Exception::Exception(
OCI_Error *err)
967 ConverString(_what, str, ostrlen(str));
973 return _what.c_str();
980 #ifdef OCI_CHARSET_WIDE 982 ConverString(message, _what.c_str(), _what.size());
1010 return Statement(_pStatement,
nullptr);
1029 GetInstance().SelfInitialize(mode, libpath);
1034 GetInstance().SelfCleanup();
1042 return GetInstance()._mode;
1057 return GetInstance()._charMaxSize;
1067 return GetInstance()._initialized;
1129 startMode.GetValues(), startFlags.GetValues(), spfile.c_str() ));
1136 shutdownMode.GetValues(), shutdownFlags.GetValues() ));
1146 Check(
OCI_SetHAHandler(static_cast<POCI_HA_HANDLER>(handler !=
nullptr ? Environment::HAHandler :
nullptr)));
1148 Environment::SetUserCallback<HAHandlerProc>(GetEnvironmentHandle(), handler);
1151 inline void Environment::HAHandler(
OCI_Connection *pConnection,
unsigned int source,
unsigned int event,
OCI_Timestamp *pTimestamp)
1153 HAHandlerProc handler = Environment::GetUserCallback<HAHandlerProc>(GetEnvironmentHandle());
1158 Timestamp timestamp(pTimestamp, connection.GetHandle());
1162 HAEventType (static_cast<HAEventType::Type> (event)),
1167 inline unsigned int Environment::TAFHandler(
OCI_Connection *pConnection,
unsigned int type,
unsigned int event)
1169 unsigned int res = OCI_FOC_OK;
1177 res = handler(connection,
1185 inline void Environment::NotifyHandler(
OCI_Event *pEvent)
1196 inline void Environment::NotifyHandlerAQ(
OCI_Dequeue *pDequeue)
1208 T Environment::GetUserCallback(
AnyPointer ptr)
1210 return reinterpret_cast<T
>(GetInstance()._callbacks.Get(ptr));
1214 void Environment::SetUserCallback(
AnyPointer ptr, T callback)
1218 GetInstance()._callbacks.Set(ptr, reinterpret_cast<CallbackPointer>(callback));
1222 GetInstance()._callbacks.Remove(ptr);
1227 void Environment::SetSmartHandle(
AnyPointer ptr, T handle)
1231 GetInstance()._handles.Set(ptr, handle);
1235 GetInstance()._handles.Remove(ptr);
1240 T Environment::GetSmartHandle(
AnyPointer ptr)
1242 return dynamic_cast<T
>(GetInstance()._handles.Get(ptr));
1245 inline Handle * Environment::GetEnvironmentHandle()
1247 return GetInstance()._handle.GetHandle();
1253 if (handle !=
nullptr)
1265 inline Environment::Environment() : _locker(), _handle(), _handles(), _callbacks(), _mode(), _initialized(
false)
1270 inline void Environment::SelfInitialize(
EnvironmentFlags mode,
const ostring& libpath)
1276 _initialized =
true;
1280 _callbacks.SetLocker(&_locker);
1281 _handles.SetLocker(&_locker);
1285 _charMaxSize = ComputeCharMaxSize(GetCharset());
1288 inline void Environment::SelfCleanup()
1290 _locker.SetAccessMode(
false);
1292 _callbacks.SetLocker(
nullptr);
1293 _handles.SetLocker(
nullptr);
1302 _initialized =
false;
1389 Open(db, user, pwd, poolType, minSize, maxSize, increment, sessionFlags);
1397 Acquire(
Check(
OCI_PoolCreate(db.c_str(), user.c_str(), pwd.c_str(), poolType, sessionFlags.GetValues(),
1398 minSize, maxSize, increment)),
reinterpret_cast<HandleFreeFunc
>(
OCI_PoolFree),
nullptr, Environment::GetEnvironmentHandle());
1477 Open(db, user, pwd, sessionFlags);
1482 Acquire(con, reinterpret_cast<HandleFreeFunc>(parent ?
OCI_ConnectionFree :
nullptr),
nullptr, parent);
1488 reinterpret_cast<HandleFreeFunc
>(
OCI_ConnectionFree),
nullptr, Environment::GetEnvironmentHandle());
1622 return (str !=
nullptr);
1631 lines.push_back(str);
1708 Check(
OCI_SetTAFHandler(*
this, static_cast<POCI_TAF_HANDLER>(handler !=
nullptr ? Environment::TAFHandler :
nullptr)));
1710 Environment::SetUserCallback<Connection::TAFHandlerProc>(
static_cast<OCI_Connection*
>(*this), handler);
1744 Acquire(trans,
nullptr,
nullptr,
nullptr);
1796 Acquire(pNumber,
nullptr,
nullptr, parent);
1803 FromString(str, format);
1810 FromString(str, format);
1813 inline void Number::Allocate()
1827 size_t size = OCI_SIZE_BUFFER;
1829 ManagedBuffer<otext> buffer(size + 1);
1833 return MakeString(static_cast<const otext *>(buffer));
1836 return OCI_STRING_NULL;
1855 inline int Number::Compare(
const Number& other)
const 1861 T Number::GetValue()
const 1871 Number& Number::SetValue(
const T &value)
1884 void Number::Add(
const T &value)
1890 void Number::Sub(
const T &value)
1896 void Number::Multiply(
const T &value)
1902 void Number::Divide(
const T &value)
1907 inline Number& Number::operator = (OCI_Number * &lhs)
1909 Acquire(lhs, reinterpret_cast<HandleFreeFunc>(
OCI_NumberFree),
nullptr,
nullptr);
1914 Number& Number::operator = (
const T &lhs)
1921 Number::operator T()
const 1923 return GetValue<T>();
1927 Number Number::operator + (
const T &value)
1929 Number result = Clone();
1935 Number Number::operator - (
const T &value)
1937 Number result = Clone();
1943 Number Number::operator * (
const T &value)
1945 Number result = Clone();
1946 result.Multiply(value);
1951 Number Number::operator / (
const T &value)
1953 Number result = Clone();
1954 result.Divide(value);
1959 Number& Number::operator += (
const T &value)
1966 Number& Number::operator -= (
const T &value)
1973 Number& Number::operator *= (
const T &value)
1980 Number& Number::operator /= (
const T &value)
1986 inline Number& Number::operator ++ ()
1991 inline Number& Number::operator -- ()
1996 inline Number Number::operator ++ (
int)
2001 inline Number Number::operator -- (
int)
2006 inline bool Number::operator == (
const Number& other)
const 2008 return Compare(other) == 0;
2011 inline bool Number::operator != (
const Number& other)
const 2013 return !(*
this == other);
2016 inline bool Number::operator > (
const Number& other)
const 2018 return Compare(other) > 0;
2021 inline bool Number::operator < (
const Number& other)
const 2023 return Compare(other) < 0;
2026 inline bool Number::operator >= (
const Number& other)
const 2028 int res = Compare(other);
2030 return res == 0 || res < 0;
2033 inline bool Number::operator <= (
const Number& other)
const 2035 int res = Compare(other);
2037 return res == 0 || res > 0;
2056 FromString(str, format);
2063 FromString(str, format);
2068 Acquire(pDate,
nullptr,
nullptr, parent);
2071 inline void Date::Allocate()
2098 inline int Date::Compare(
const Date& other)
const 2110 int year = 0, month = 0, day = 0;
2112 GetDate(year, month, day);
2119 int year = 0, month = 0, day = 0;
2121 GetDate(year, month, day);
2122 SetDate(value, month, day);
2127 int year = 0, month = 0, day = 0;
2129 GetDate(year, month, day);
2136 int year = 0, month = 0, day = 0;
2138 GetDate(year, month, day);
2139 SetDate(year, value, day);
2144 int year = 0, month = 0, day = 0;
2146 GetDate(year, month, day);
2153 int year = 0, month = 0, day = 0;
2155 GetDate(year, month, day);
2156 SetDate(year, month, value);
2161 int hour = 0, minutes = 0, seconds = 0;
2163 GetTime(hour, minutes, seconds);
2170 int hour = 0, minutes = 0, seconds = 0;
2172 GetTime(hour, minutes, seconds);
2173 SetTime(value, minutes, seconds);
2178 int hour = 0, minutes = 0, seconds = 0;
2180 GetTime(hour, minutes, seconds);
2187 int hour = 0, minutes = 0, seconds = 0;
2189 GetTime(hour, minutes, seconds);
2190 SetTime(hour, value, seconds);
2195 int hour = 0, minutes = 0, seconds = 0;
2197 GetTime(hour, minutes, seconds);
2204 int hour = 0, minutes = 0, seconds = 0;
2206 GetTime(hour, minutes, seconds);
2207 SetTime(hour, minutes, value);
2257 Date result = Clone();
2266 Date result = Clone();
2287 size_t size = OCI_SIZE_BUFFER;
2289 ManagedBuffer<otext> buffer(size + 1);
2293 return MakeString(static_cast<const otext *>(buffer));
2296 return OCI_STRING_NULL;
2311 Date result = Clone();
2325 Date result = Clone();
2334 Date result = Clone();
2335 return result += value;
2340 Date result = Clone();
2341 return result -= value;
2358 return Compare(other) == 0;
2363 return !(*
this == other);
2368 return Compare(other) > 0;
2373 return Compare(other) < 0;
2378 int res = Compare(other);
2380 return res == 0 || res > 0;
2385 int res = Compare(other);
2387 return res == 0 || res < 0;
2412 Acquire(pInterval,
nullptr,
nullptr, parent);
2417 Interval result(GetType());
2424 inline int Interval::Compare(
const Interval& other)
const 2441 int year = 0, month = 0;
2443 GetYearMonth(year, month);
2450 int year = 0, month = 0;
2452 GetYearMonth(year, month);
2453 SetYearMonth(value, month);
2458 int year = 0, month = 0;
2460 GetYearMonth(year, month);
2467 int year = 0, month = 0;
2469 GetYearMonth(year, month);
2470 SetYearMonth(year, value);
2475 int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
2477 GetDaySecond(day, hour, minutes, seconds, milliseconds);
2484 int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
2486 GetDaySecond(day, hour, minutes, seconds, milliseconds);
2487 SetDaySecond(value, hour, minutes, seconds, milliseconds);
2492 int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
2494 GetDaySecond(day, hour, minutes, seconds, milliseconds);
2501 int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
2503 GetDaySecond(day, hour, minutes, seconds, milliseconds);
2504 SetDaySecond(day, value, minutes, seconds, milliseconds);
2509 int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
2511 GetDaySecond(day, hour, minutes, seconds, milliseconds);
2518 int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
2520 GetDaySecond(day, hour, minutes, seconds, milliseconds);
2521 SetDaySecond(day, hour, value, seconds, milliseconds);
2526 int day, hour, minutes, seconds, milliseconds;
2528 GetDaySecond(day, hour, minutes, seconds, milliseconds);
2535 int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
2537 GetDaySecond(day, hour, minutes, seconds, milliseconds);
2538 SetDaySecond(day, hour, minutes, value, milliseconds);
2543 int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
2545 GetDaySecond(day, hour, minutes, seconds, milliseconds);
2547 return milliseconds;
2552 int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
2554 GetDaySecond(day, hour, minutes, seconds, milliseconds);
2555 SetDaySecond(day, hour, minutes, seconds, value);
2591 size_t size = OCI_SIZE_BUFFER;
2593 ManagedBuffer<otext> buffer(size + 1);
2597 return MakeString(static_cast<const otext *>(buffer));
2600 return OCI_STRING_NULL;
2605 return ToString(OCI_STRING_DEFAULT_PREC, OCI_STRING_DEFAULT_PREC);
2610 Interval result = Clone();
2611 return result += other;
2616 Interval result = Clone();
2617 return result -= other;
2634 return Compare(other) == 0;
2639 return (!(*
this == other));
2644 return (Compare(other) > 0);
2649 return (Compare(other) < 0);
2654 int res = Compare(other);
2656 return (res == 0 || res < 0);
2661 int res = Compare(other);
2663 return (res == 0 || res > 0);
2682 FromString(data, format);
2687 Acquire(pTimestamp,
nullptr,
nullptr, parent);
2692 Timestamp result(GetType());
2699 inline int Timestamp::Compare(
const Timestamp& other)
const 2709 inline void Timestamp::SetDateTime(
int year,
int month,
int day,
int hour,
int min,
int sec,
int fsec,
const ostring& timeZone)
2726 int year, month, day;
2728 GetDate(year, month, day);
2735 int year, month, day;
2737 GetDate(year, month, day);
2738 SetDate(value, month, day);
2743 int year, month, day;
2745 GetDate(year, month, day);
2752 int year, month, day;
2754 GetDate(year, month, day);
2755 SetDate(year, value, day);
2760 int year, month, day;
2762 GetDate(year, month, day);
2769 int year, month, day;
2771 GetDate(year, month, day);
2772 SetDate(year, month, value);
2777 int hour, minutes, seconds, milliseconds;
2779 GetTime(hour, minutes, seconds, milliseconds);
2786 int hour, minutes, seconds, milliseconds;
2788 GetTime(hour, minutes, seconds, milliseconds);
2789 SetTime(value, minutes, seconds, milliseconds);
2794 int hour, minutes, seconds, milliseconds;
2796 GetTime(hour, minutes, seconds, milliseconds);
2803 int hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
2805 GetTime(hour, minutes, seconds, milliseconds);
2806 SetTime(hour, value, seconds, milliseconds);
2811 int hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
2813 GetTime(hour, minutes, seconds, milliseconds);
2820 int hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
2822 GetTime(hour, minutes, seconds, milliseconds);
2823 SetTime(hour, minutes, value, milliseconds);
2828 int hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
2830 GetTime(hour, minutes, seconds, milliseconds);
2832 return milliseconds;
2837 int hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
2839 GetTime(hour, minutes, seconds, milliseconds);
2840 SetTime(hour, minutes, seconds, value);
2860 int tmpYear = 0, tmpMonth = 0, tempDay = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
2862 GetDateTime(tmpYear, tmpMonth, tempDay, hour, minutes, seconds, milliseconds);
2863 SetDateTime(year, month, day, hour, minutes, seconds, milliseconds);
2868 int year = 0, month = 0, day = 0, tmpHour = 0, tmpMinutes = 0, tmpSeconds = 0, tmpMilliseconds = 0;
2870 GetDateTime(year, month, day, tmpHour, tmpMinutes, tmpSeconds, tmpMilliseconds);
2871 SetDateTime(year, month, day, hour, min, sec, fsec);
2876 if (GetType() == WithTimeZone)
2878 int year = 0, month = 0, day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
2880 GetDateTime(year, month, day, hour, minutes, seconds, milliseconds);
2881 SetDateTime(year, month, day, hour, minutes, seconds, milliseconds, timeZone);
2887 if (GetType() != NoTimeZone)
2889 size_t size = OCI_SIZE_BUFFER;
2891 ManagedBuffer<otext> buffer(size + 1);
2895 return MakeString(static_cast<const otext *>(buffer));
2913 Timestamp result(type);
2929 size_t size = OCI_SIZE_BUFFER;
2931 ManagedBuffer<otext> buffer(size + 1);
2935 return MakeString(static_cast<const otext *>(buffer));
2938 return OCI_STRING_NULL;
2953 Timestamp result = Clone();
2967 Timestamp result = Clone();
2976 Timestamp result = Clone();
2979 return result += value;
2984 Timestamp result = Clone();
2987 return result -= value;
2999 Timestamp result = Clone();
3000 return result += other;
3005 Timestamp result = Clone();
3006 return result -= other;
3025 return *
this += interval;
3032 return *
this -= interval;
3037 return Compare(other) == 0;
3042 return (!(*
this == other));
3047 return (Compare(other) > 0);
3052 return (Compare(other) < 0);
3057 int res = Compare(other);
3059 return (res == 0 || res < 0);
3064 int res = Compare(other);
3066 return (res == 0 || res > 0);
3073 template<
class T,
int U>
3078 template<
class T,
int U>
3084 template<
class T,
int U>
3087 Acquire(pLob,
nullptr,
nullptr, parent);
3095 unsigned int charCount = length;
3096 unsigned int byteCount = 0;
3098 if (
Check(
OCI_LobRead2(*
this, static_cast<AnyPointer>(buffer), &charCount, &byteCount)))
3100 length = byteCount /
sizeof(otext);
3103 return MakeString(static_cast<const otext *>(buffer), static_cast<int>(length));
3111 unsigned int charCount = length;
3112 unsigned int byteCount = 0;
3114 if (
Check(
OCI_LobRead2(*
this, static_cast<AnyPointer>(buffer), &charCount, &byteCount)))
3116 length = byteCount /
sizeof(otext);
3119 return MakeString(static_cast<const otext *>(buffer), static_cast<int>(length));
3126 ManagedBuffer<unsigned char> buffer(length + 1);
3128 length =
Check(
OCI_LobRead(*
this, static_cast<AnyPointer>(buffer), length));
3130 return MakeRaw(buffer, length);
3133 template<
class T,
int U>
3136 unsigned int res = 0;
3138 if (content.size() > 0)
3140 unsigned int charCount = 0;
3141 unsigned int byteCount =
static_cast<unsigned int>(content.size() *
sizeof(
typename T::value_type));
3142 AnyPointer buffer =
static_cast<AnyPointer>(
const_cast<typename T::value_type *
>(&content[0]));
3146 res = U == LobBinary ? byteCount : charCount;
3153 template<
class T,
int U>
3159 template<
class T,
int U>
3162 unsigned int res = 0;
3164 if (content.size() > 0)
3166 Check(
OCI_LobAppend(*
this, static_cast<AnyPointer>(const_cast<typename T::value_type *>(&content[0])), static_cast<unsigned int>(content.size())));
3172 template<
class T,
int U>
3178 template<
class T,
int U>
3181 Lob result(GetConnection());
3188 template<
class T,
int U>
3194 template<
class T,
int U>
3200 template<
class T,
int U>
3206 template<
class T,
int U>
3212 template<
class T,
int U>
3218 template<
class T,
int U>
3224 template<
class T,
int U>
3230 template<
class T,
int U>
3236 template<
class T,
int U>
3242 template<
class T,
int U>
3248 template<
class T,
int U>
3254 template<
class T,
int U>
3260 template<
class T,
int U>
3266 template<
class T,
int U>
3272 template<
class T,
int U>
3278 template<
class T,
int U>
3284 template<
class T,
int U>
3291 template<
class T,
int U>
3294 return Equals(other);
3297 template<
class T,
int U>
3300 return !(*
this == other);
3320 SetInfos(directory, name);
3325 Acquire(pFile,
nullptr,
nullptr, parent);
3330 ManagedBuffer<unsigned char> buffer(size + 1);
3344 File result(GetConnection());
3351 inline bool File::Equals(
const File &other)
const 3408 return Equals(other);
3413 return (!(*
this == other));
3422 Acquire(
Check(
OCI_TypeInfoGet(connection, name.c_str(), type)),
static_cast<HandleFreeFunc
>(
nullptr),
nullptr, connection.GetHandle());
3427 Acquire(pTypeInfo,
nullptr,
nullptr,
nullptr);
3481 Acquire(pObject,
nullptr,
nullptr, parent);
3486 Object result(GetTypeInfo());
3517 return Reference(pRef, GetHandle());
3526 inline bool Object::Get<bool>(
const ostring& name)
const 3532 inline short Object::Get<short>(
const ostring& name)
const 3538 inline unsigned short Object::Get<unsigned short>(
const ostring& name)
const 3544 inline int Object::Get<int>(
const ostring& name)
const 3550 inline unsigned int Object::Get<unsigned int>(
const ostring& name)
const 3556 inline big_int Object::Get<big_int>(
const ostring& name)
const 3562 inline big_uint Object::Get<big_uint>(
const ostring& name)
const 3568 inline float Object::Get<float>(
const ostring& name)
const 3574 inline double Object::Get<double>(
const ostring& name)
const 3580 inline Number Object::Get<Number>(
const ostring& name)
const 3586 inline ostring Object::Get<ostring>(
const ostring& name)
const 3592 inline Date Object::Get<Date>(
const ostring& name)
const 3598 inline Timestamp Object::Get<Timestamp>(
const ostring& name)
const 3604 inline Interval Object::Get<Interval>(
const ostring& name)
const 3610 inline Object Object::Get<Object>(
const ostring& name)
const 3616 inline Reference Object::Get<Reference>(
const ostring& name)
const 3622 inline Clob Object::Get<Clob>(
const ostring& name)
const 3628 inline NClob Object::Get<NClob>(
const ostring& name)
const 3634 inline Blob Object::Get<Blob>(
const ostring& name)
const 3640 inline File Object::Get<File>(
const ostring& name)
const 3646 inline Raw Object::Get<Raw>(
const ostring& name)
const 3650 ManagedBuffer<unsigned char> buffer(size + 1);
3664 inline void Object::Set<bool>(
const ostring& name,
const bool &value)
3670 inline void Object::Set<short>(
const ostring& name,
const short &value)
3676 inline void Object::Set<unsigned short>(
const ostring& name,
const unsigned short &value)
3682 inline void Object::Set<int>(
const ostring& name,
const int &value)
3688 inline void Object::Set<unsigned int>(
const ostring& name,
const unsigned int &value)
3694 inline void Object::Set<big_int>(
const ostring& name,
const big_int &value)
3700 inline void Object::Set<big_uint>(
const ostring& name,
const big_uint &value)
3706 inline void Object::Set<float>(
const ostring& name,
const float &value)
3712 inline void Object::Set<double>(
const ostring& name,
const double &value)
3718 inline void Object::Set<Number>(
const ostring& name,
const Number &value)
3724 inline void Object::Set<ostring>(
const ostring& name,
const ostring &value)
3730 inline void Object::Set<Date>(
const ostring& name,
const Date &value)
3736 inline void Object::Set<Timestamp>(
const ostring& name,
const Timestamp &value)
3742 inline void Object::Set<Interval>(
const ostring& name,
const Interval &value)
3748 inline void Object::Set<Object>(
const ostring& name,
const Object &value)
3754 inline void Object::Set<Reference>(
const ostring& name,
const Reference &value)
3760 inline void Object::Set<Clob>(
const ostring& name,
const Clob &value)
3766 inline void Object::Set<NClob>(
const ostring& name,
const NClob &value)
3772 inline void Object::Set<Blob>(
const ostring& name,
const Blob &value)
3778 inline void Object::Set<File>(
const ostring& name,
const File &value)
3784 inline void Object::Set<Raw>(
const ostring& name,
const Raw &value)
3786 if (value.size() > 0)
3788 Check(
OCI_ObjectSetRaw(*
this, name.c_str(),
static_cast<AnyPointer>(
const_cast<Raw::value_type *
>(&value[0])),
static_cast<unsigned int>(value.size())));
3806 unsigned int len = 0;
3810 ManagedBuffer<otext> buffer(len + 1);
3814 return MakeString(static_cast<const otext *>(buffer), static_cast<int>(len));
3817 return OCI_STRING_NULL;
3836 Acquire(pRef,
nullptr,
nullptr, parent);
3851 Reference result(GetTypeInfo());
3874 ManagedBuffer<otext> buffer(size + 1);
3878 return MakeString(static_cast<const otext *>(buffer), static_cast<int>(size));
3881 return OCI_STRING_NULL;
3902 Acquire(pColl,
nullptr,
nullptr, parent);
3992 return iterator(const_cast<Collection*>(
this), GetCount() + 1);
3998 return const_iterator(const_cast<Collection*>(
this), GetCount() + 1);
4012 SetElem(elem, data);
4022 SetElem(elem, value);
4031 ARG_NOT_USED(parent);
4039 ARG_NOT_USED(parent);
4047 ARG_NOT_USED(parent);
4055 ARG_NOT_USED(parent);
4063 ARG_NOT_USED(parent);
4071 ARG_NOT_USED(parent);
4079 ARG_NOT_USED(parent);
4087 ARG_NOT_USED(parent);
4095 ARG_NOT_USED(parent);
4109 ARG_NOT_USED(parent);
4117 ARG_NOT_USED(parent);
4121 ManagedBuffer<unsigned char> buffer(size + 1);
4256 if (value.size() > 0)
4258 Check(
OCI_ElemSetRaw(elem, static_cast<AnyPointer>(const_cast<Raw::value_type *>(&value[0])), static_cast<unsigned int>(value.size())));
4331 unsigned int len = 0;
4335 ManagedBuffer<otext> buffer(len + 1);
4339 return MakeString(static_cast<const otext *>(buffer), static_cast<int>(len));
4342 return OCI_STRING_NULL;
4364 CollectionIterator<T>::CollectionIterator(
CollectionType *collection,
unsigned int pos) : _elem(collection, pos)
4370 CollectionIterator<T>::CollectionIterator(
const CollectionIterator& other) : _elem(other._elem)
4378 _elem._pos = other._elem._pos;
4379 _elem._coll = other._elem._coll;
4387 _elem._pos +=
static_cast<unsigned int>(value);
4394 _elem._pos -=
static_cast<unsigned int>(value);
4420 ++*(
const_cast<unsigned int*
>(&_elem._pos));
4443 return CollectionIterator(_elem._coll, _elem._pos + static_cast<unsigned int>(value));
4449 return CollectionIterator(_elem._coll, _elem._pos - static_cast<unsigned int>(value));
4455 return static_cast<difference_type
>(_elem._pos - value._elem._pos);
4461 return _elem._pos == other._elem._pos && (
static_cast<OCI_Coll *
>(*_elem._coll)) == (
static_cast<OCI_Coll *
>(*other._elem._coll));
4467 return !(*
this == other);
4473 return _elem._pos > other._elem._pos;
4479 return _elem._pos < other._elem._pos;
4485 return _elem._pos >= other._elem._pos;
4491 return _elem._pos <= other._elem._pos;
4509 return _coll->Get(_pos);
4515 _coll->Set(_pos, value);
4522 _coll->Set(_pos, static_cast<T>(other));
4529 return _coll->IsElementNull(_pos);
4535 _coll->SetElementNull(_pos);
4542 template<
class T,
int U>
4547 template<
class T,
int U>
4553 template<
class T,
int U>
4556 Acquire(pLong,
nullptr,
nullptr, parent);
4559 template<
class T,
int U>
4562 unsigned int res = 0;
4564 if (content.size() > 0)
4566 res =
Check(
OCI_LongWrite(*
this, static_cast<AnyPointer>(const_cast<typename T::value_type *>(&content[0])), static_cast<unsigned int>(content.size())));
4572 template<
class T,
int U>
4594 inline BindObject::BindObject(
const Statement &statement,
const ostring& name,
unsigned int mode) : _statement(statement), _name(name), _mode(mode)
4598 inline BindObject::~BindObject()
4602 inline ostring BindObject::GetName()
const 4607 inline Statement BindObject::GetStatement()
const 4612 inline unsigned int BindObject::GetMode()
const 4621 inline BindArray::BindArray(
const Statement &statement,
const ostring& name,
unsigned int mode) : BindObject(statement, name, mode), _object(
nullptr)
4627 void BindArray::SetVector(std::vector<T> & vector,
bool isPlSqlTable,
unsigned int elemSize)
4629 _object =
new BindArrayObject<T>(_statement, GetName(), vector, isPlSqlTable, GetMode(), elemSize);
4632 inline BindArray::~BindArray()
4643 inline void BindArray::SetInData()
4646 if (GetMode() & OCI_BDM_IN || _object->IsHandleObject())
4648 _object->SetInData();
4652 inline void BindArray::SetOutData()
4654 if (GetMode() & OCI_BDM_OUT)
4656 _object->SetOutData();
4660 inline unsigned int BindArray::GetSize()
4662 return _object ? _object->GetSize() : _statement.GetBindArraySize();
4665 inline unsigned int BindArray::GetSizeForBindCall()
4667 return _object ? _object->GetSizeForBindCall() : 0;
4671 BindArray::BindArrayObject<T>::BindArrayObject(
const Statement &statement,
const ostring& name, ObjectVector &vector,
bool isPlSqlTable,
unsigned int mode,
unsigned int elemSize)
4672 : _statement(statement), _name(name), _vector(vector), _data(
nullptr), _isPlSqlTable(isPlSqlTable), _mode(mode), _elemCount(GetSize()), _elemSize(elemSize)
4678 BindArray::BindArrayObject<T>::~BindArrayObject()
4684 void BindArray::BindArrayObject<T>::AllocData()
4686 _data =
new NativeType[_elemCount];
4688 memset(_data, 0,
sizeof(NativeType) * _elemCount);
4692 inline void BindArray::BindArrayObject<ostring>::AllocData()
4694 _data =
new otext[_elemSize * _elemCount];
4696 memset(_data, 0, _elemSize * _elemCount *
sizeof(otext));
4700 inline void BindArray::BindArrayObject<Raw> ::AllocData()
4702 _data =
new unsigned char[_elemSize * _elemCount];
4704 memset(_data, 0, _elemSize * _elemCount *
sizeof(
unsigned char));
4708 void BindArray::BindArrayObject<T>::FreeData()
const 4714 void BindArray::BindArrayObject<T>::SetInData()
4716 typename ObjectVector::iterator it, it_end;
4718 unsigned int index = 0;
4719 unsigned int currElemCount = GetSize();
4721 for (it = _vector.begin(), it_end = _vector.end(); it != it_end && index < _elemCount && index < currElemCount; ++it, ++index)
4723 _data[index] =
static_cast<NativeType
>(*it);
4728 inline void BindArray::BindArrayObject<ostring>::SetInData()
4730 std::vector<ostring>::iterator it, it_end;
4732 unsigned int index = 0;
4733 unsigned int currElemCount = GetSize();
4735 for (it = _vector.begin(), it_end = _vector.end(); it != it_end && index < _elemCount && index < currElemCount; ++it, ++index)
4737 const ostring & value = *it;
4739 memcpy( _data + (_elemSize * index), value.c_str(), (value.size() + 1) *
sizeof(otext));
4744 inline void BindArray::BindArrayObject<Raw>::SetInData()
4746 std::vector<Raw>::iterator it, it_end;
4748 unsigned int index = 0;
4749 unsigned int currElemCount = GetSize();
4751 for (it = _vector.begin(), it_end = _vector.end(); it != it_end && index < _elemCount && index < currElemCount; ++it, ++index)
4755 if (value.size() > 0)
4757 memcpy(_data + (_elemSize * index), &value[0], value.size());
4765 void BindArray::BindArrayObject<T>::SetOutData()
4767 typename ObjectVector::iterator it, it_end;
4769 unsigned int index = 0;
4770 unsigned int currElemCount = GetSize();
4772 for (it = _vector.begin(), it_end = _vector.end(); it != it_end && index < _elemCount && index < currElemCount; ++it, ++index)
4776 object =
static_cast<NativeType
>(_data[index]);
4781 inline void BindArray::BindArrayObject<ostring>::SetOutData()
4783 std::vector<ostring>::iterator it, it_end;
4787 unsigned int index = 0;
4788 unsigned int currElemCount = GetSize();
4790 for (it = _vector.begin(), it_end = _vector.end(); it != it_end && index < _elemCount && index < currElemCount; ++it, ++index)
4792 otext *currData = _data + (_elemSize *
sizeof(otext) * index);
4799 inline void BindArray::BindArrayObject<Raw>::SetOutData()
4801 std::vector<Raw>::iterator it, it_end;
4805 unsigned int index = 0;
4806 unsigned int currElemCount = GetSize();
4808 for (it = _vector.begin(), it_end = _vector.end(); it != it_end && index < _elemCount && index < currElemCount; ++it, ++index)
4810 unsigned char *currData = _data + (_elemSize * index);
4817 ostring BindArray::BindArrayObject<T>::GetName()
4823 bool BindArray::BindArrayObject<T>::IsHandleObject()
4829 unsigned int BindArray::BindArrayObject<T>::GetSize()
4831 return _isPlSqlTable ?
static_cast<unsigned int>(_vector.size()) : _statement.GetBindArraySize();
4835 unsigned int BindArray::BindArrayObject<T>::GetSizeForBindCall()
4837 return _isPlSqlTable ?
static_cast<unsigned int>(_vector.size()) : 0;
4841 BindArray::BindArrayObject<T>::operator ObjectVector & ()
const 4847 BindArray::BindArrayObject<T>::operator NativeType * ()
const 4857 void BindObjectAdaptor<T>::SetInData()
4859 if (GetMode() & OCI_BDM_IN)
4861 size_t size = _object.size();
4870 memcpy(_data, &_object[0], size *
sizeof(NativeType));
4878 void BindObjectAdaptor<T>::SetOutData()
4880 if (GetMode() & OCI_BDM_OUT)
4884 _object.assign(_data, _data + size);
4889 BindObjectAdaptor<T>::BindObjectAdaptor(
const Statement &statement,
const ostring& name,
unsigned int mode, ObjectType &
object,
unsigned int size) :
4890 BindObject(statement, name, mode),
4892 _data(
new NativeType[size + 1]),
4895 memset(_data, 0, _size *
sizeof(NativeType));
4899 BindObjectAdaptor<T>::~BindObjectAdaptor()
4905 BindObjectAdaptor<T>::operator NativeType *()
const 4915 void BindTypeAdaptor<T>::SetInData()
4917 if (GetMode() & OCI_BDM_IN)
4919 *_data =
static_cast<NativeType
>(_object);
4924 void BindTypeAdaptor<T>::SetOutData()
4926 if (GetMode() & OCI_BDM_OUT)
4928 _object =
static_cast<T
>(*_data);
4933 BindTypeAdaptor<T>::BindTypeAdaptor(
const Statement &statement,
const ostring& name,
unsigned int mode, ObjectType &
object) :
4934 BindObject(statement, name, mode),
4936 _data(
new NativeType)
4942 BindTypeAdaptor<T>::~BindTypeAdaptor()
4948 BindTypeAdaptor<T>::operator NativeType *()
const 4954 inline void BindTypeAdaptor<bool>::SetInData()
4956 if (GetMode() & OCI_BDM_IN)
4958 *_data = (_object ==
true);
4963 inline void BindTypeAdaptor<bool>::SetOutData()
4965 if (GetMode() & OCI_BDM_OUT)
4967 _object = (*_data == TRUE);
4975 inline BindsHolder::BindsHolder(
const Statement &statement) : _bindObjects(), _statement(statement)
4980 inline BindsHolder::~BindsHolder()
4985 inline void BindsHolder::Clear()
4987 std::vector<BindObject *>::iterator it, it_end;
4989 for(it = _bindObjects.begin(), it_end = _bindObjects.end(); it != it_end; ++it)
4994 _bindObjects.clear();
4997 inline void BindsHolder::AddBindObject(BindObject *bindObject)
5001 std::vector<BindObject *>::iterator it, it_end;
5003 for(it = _bindObjects.begin(), it_end = _bindObjects.end(); it != it_end; ++it)
5005 if ((*it)->GetName() == bindObject->GetName())
5007 _bindObjects.erase(it);
5013 _bindObjects.push_back(bindObject);
5016 inline void BindsHolder::SetOutData()
5018 std::vector<BindObject *>::iterator it, it_end;
5020 for(it = _bindObjects.begin(), it_end = _bindObjects.end(); it != it_end; ++it)
5022 (*it)->SetOutData();
5026 inline void BindsHolder::SetInData()
5028 std::vector<BindObject *>::iterator it, it_end;
5030 for(it = _bindObjects.begin(), it_end = _bindObjects.end(); it != it_end; ++it)
5040 inline BindInfo::BindInfo(
OCI_Bind *pBind, Handle *parent)
5042 Acquire(pBind,
nullptr,
nullptr, parent);
5112 Acquire(stmt, reinterpret_cast<HandleFreeFunc>(parent ?
OCI_StatementFree :
nullptr), OnFreeSmartHandle, parent);
5123 ReleaseResultsets();
5130 ReleaseResultsets();
5137 ReleaseResultsets();
5143 ReleaseResultsets();
5154 return Fetch(callback);
5157 template<
class T,
class U>
5162 return Fetch(callback, adapter);
5168 ReleaseResultsets();
5177 return Fetch(callback);
5180 template<
class T,
class U>
5185 return Fetch(callback, adapter);
5188 template<
typename T>
5189 unsigned int Statement::Fetch(T callback)
5191 unsigned int res = 0;
5198 rs = GetNextResultset();
5204 template<
class T,
class U>
5205 unsigned int Statement::Fetch(T callback, U adapter)
5207 unsigned int res = 0;
5213 res += rs.
ForEach(callback, adapter);
5214 rs = GetNextResultset();
5285 template<
typename M,
class T>
5288 Check(method(*
this, name.c_str(), &value));
5289 SetLastBindMode(mode);
5292 template<
typename M,
class T>
5296 SetLastBindMode(mode);
5299 template<
typename M,
class T>
5302 BindArray * bnd =
new BindArray(*
this, name, mode);
5305 boolean res = method(*
this, name.c_str(), bnd->GetData<T>(), bnd->GetSizeForBindCall());
5309 BindsHolder *bindsHolder = GetBindsHolder(
true);
5310 bindsHolder->AddBindObject(bnd);
5311 SetLastBindMode(mode);
5321 template<
typename M,
class T,
class U>
5324 BindArray * bnd =
new BindArray(*
this, name, mode);
5327 boolean res = method(*
this, name.c_str(), bnd->GetData<T>(), subType, bnd->GetSizeForBindCall());
5331 BindsHolder *bindsHolder = GetBindsHolder(
true);
5332 bindsHolder->AddBindObject(bnd);
5333 SetLastBindMode(mode);
5346 BindTypeAdaptor<bool> * bnd =
new BindTypeAdaptor<bool>(*
this, name, mode, value);
5348 boolean res =
OCI_BindBoolean(*
this, name.c_str(),
static_cast<boolean *
>(*bnd));
5352 BindsHolder *bindsHolder = GetBindsHolder(
true);
5353 bindsHolder->AddBindObject(bnd);
5354 SetLastBindMode(mode);
5371 inline void Statement::Bind<unsigned short>(
const ostring& name,
unsigned short &value,
BindInfo::BindDirection mode)
5383 inline void Statement::Bind<unsigned int>(
const ostring& name,
unsigned int &value,
BindInfo::BindDirection mode)
5479 inline void Statement::Bind<Clong, unsigned int>(
const ostring& name, Clong &value,
unsigned int maxSize,
BindInfo::BindDirection mode)
5482 SetLastBindMode(mode);
5486 inline void Statement::Bind<Clong, int>(
const ostring& name, Clong &value,
int maxSize,
BindInfo::BindDirection mode)
5488 Bind<Clong, unsigned int>(name, value,
static_cast<unsigned int>(maxSize), mode);
5492 inline void Statement::Bind<Blong, unsigned int>(
const ostring& name, Blong &value,
unsigned int maxSize,
BindInfo::BindDirection mode)
5495 SetLastBindMode(mode);
5499 inline void Statement::Bind<Blong, int>(
const ostring& name, Blong &value,
int maxSize,
BindInfo::BindDirection mode)
5501 Bind<Blong, unsigned int>(name, value,
static_cast<unsigned int>(maxSize), mode);
5505 inline void Statement::Bind<ostring, unsigned int>(
const ostring& name, ostring &value,
unsigned int maxSize,
BindInfo::BindDirection mode)
5509 maxSize =
static_cast<unsigned int>(value.size());
5512 value.reserve(maxSize);
5514 BindObjectAdaptor<ostring> * bnd =
new BindObjectAdaptor<ostring>(*
this, name, mode, value, maxSize + 1);
5516 boolean res =
OCI_BindString(*
this, name.c_str(),
static_cast<otext *
>(*bnd), maxSize);
5520 BindsHolder *bindsHolder = GetBindsHolder(
true);
5521 bindsHolder->AddBindObject(bnd);
5522 SetLastBindMode(mode);
5533 inline void Statement::Bind<ostring, int>(
const ostring& name, ostring &value,
int maxSize,
BindInfo::BindDirection mode)
5535 Bind<ostring, unsigned int>(name, value,
static_cast<unsigned int>(maxSize), mode);
5539 inline void Statement::Bind<Raw, unsigned int>(
const ostring& name, Raw &value,
unsigned int maxSize,
BindInfo::BindDirection mode)
5543 maxSize =
static_cast<unsigned int>(value.size());
5546 value.reserve(maxSize);
5548 BindObjectAdaptor<Raw> * bnd =
new BindObjectAdaptor<Raw>(*
this, name, mode, value, maxSize);
5550 boolean res =
OCI_BindRaw(*
this, name.c_str(),
static_cast<unsigned char *
>(*bnd), maxSize);
5554 BindsHolder *bindsHolder = GetBindsHolder(
true);
5555 bindsHolder->AddBindObject(bnd);
5556 SetLastBindMode(mode);
5567 inline void Statement::Bind<Raw, int>(
const ostring& name, Raw &value,
int maxSize,
BindInfo::BindDirection mode)
5569 Bind<Raw, unsigned int>(name, value,
static_cast<unsigned int>(maxSize), mode);
5636 SetLastBindMode(mode);
5648 Bind<Timestamp, Timestamp::TimestampTypeValues>(name, values, subType.GetValue(), mode, type);
5660 Bind<Interval, Interval::IntervalTypeValues>(name, values, subType.GetValue(), mode, type);
5666 BindVector2(
OCI_BindArrayOfLobs, name, values, mode, static_cast<unsigned int>(OCI_CLOB), type);
5672 BindVector2(
OCI_BindArrayOfLobs, name, values, mode, static_cast<unsigned int>(OCI_NCLOB), type);
5678 BindVector2(
OCI_BindArrayOfLobs, name, values, mode, static_cast<unsigned int>(OCI_BLOB), type);
5684 BindVector2(
OCI_BindArrayOfFiles, name, values, mode, static_cast<unsigned int>(OCI_BFILE), type);
5696 BindVector2(
OCI_BindArrayOfRefs, name, values, mode, static_cast<OCI_TypeInfo *>(typeInfo), type);
5702 BindVector2(
OCI_BindArrayOfColls, name, values, mode, static_cast<OCI_TypeInfo *>(typeInfo), type);
5708 BindArray * bnd =
new BindArray(*
this, name, mode);
5711 boolean res =
OCI_BindArrayOfStrings(*
this, name.c_str(), bnd->GetData<ostring>(), maxSize, bnd->GetSizeForBindCall());
5715 BindsHolder *bindsHolder = GetBindsHolder(
true);
5716 bindsHolder->AddBindObject(bnd);
5717 SetLastBindMode(mode);
5730 Bind<ostring, unsigned int>(name, values,
static_cast<unsigned int>(maxSize), mode, type);
5736 BindArray * bnd =
new BindArray(*
this, name, mode);
5739 boolean res =
OCI_BindArrayOfRaws(*
this, name.c_str(), bnd->GetData<Raw>(), maxSize, bnd->GetSizeForBindCall());
5743 BindsHolder *bindsHolder = GetBindsHolder(
true);
5744 bindsHolder->AddBindObject(bnd);
5745 SetLastBindMode(mode);
5758 BindVector2(
OCI_BindArrayOfColls, name, values, mode, static_cast<OCI_TypeInfo *>(typeInfo), GetArraysize(type, values));
5762 inline void Statement::Register<unsigned short>(
const ostring& name)
5768 inline void Statement::Register<short>(
const ostring& name)
5774 inline void Statement::Register<unsigned int>(
const ostring& name)
5780 inline void Statement::Register<int>(
const ostring& name)
5786 inline void Statement::Register<big_uint>(
const ostring& name)
5792 inline void Statement::Register<big_int>(
const ostring& name)
5798 inline void Statement::Register<float>(
const ostring& name)
5804 inline void Statement::Register<double>(
const ostring& name)
5810 inline void Statement::Register<Number>(
const ostring& name)
5816 inline void Statement::Register<Date>(
const ostring& name)
5828 inline void Statement::Register<Timestamp, Timestamp::TimestampType>(
const ostring& name,
Timestamp::TimestampType type)
5830 Register<Timestamp, Timestamp::TimestampTypeValues>(name, type.GetValue());
5840 inline void Statement::Register<Interval, Interval::IntervalType>(
const ostring& name,
Interval::IntervalType type)
5842 Register<Interval, Interval::IntervalTypeValues>(name, type.GetValue());
5846 inline void Statement::Register<Clob>(
const ostring& name)
5852 inline void Statement::Register<NClob>(
const ostring& name)
5858 inline void Statement::Register<Blob>(
const ostring& name)
5864 inline void Statement::Register<File>(
const ostring& name)
5870 inline void Statement::Register<Object, TypeInfo>(
const ostring& name,
TypeInfo& typeInfo)
5876 inline void Statement::Register<Reference, TypeInfo>(
const ostring& name,
TypeInfo& typeInfo)
5882 inline void Statement::Register<ostring, unsigned int>(
const ostring& name,
unsigned int len)
5888 inline void Statement::Register<ostring, int>(
const ostring& name,
int len)
5890 Register<ostring, unsigned int>(name,
static_cast<unsigned int>(len));
5894 inline void Statement::Register<Raw, unsigned int>(
const ostring& name,
unsigned int len)
5900 inline void Statement::Register<Raw, int>(
const ostring& name,
int len)
5902 Register<Raw, unsigned int>(name,
static_cast<unsigned int>(len));
6009 inline void Statement::ClearBinds()
const 6011 BindsHolder *bindsHolder = GetBindsHolder(
false);
6015 bindsHolder->Clear();
6019 inline void Statement::SetOutData()
const 6021 BindsHolder *bindsHolder = GetBindsHolder(
false);
6025 bindsHolder->SetOutData();
6029 inline void Statement::SetInData()
const 6031 BindsHolder *bindsHolder = GetBindsHolder(
false);
6035 bindsHolder->SetInData();
6039 inline void Statement::ReleaseResultsets()
const 6043 Handle *handle =
nullptr;
6045 while (_smartHandle->GetChildren().FindIf(IsResultsetHandle, handle))
6049 handle->DetachFromHolders();
6059 inline bool Statement::IsResultsetHandle(Handle *handle)
6061 Resultset::SmartHandle *smartHandle =
dynamic_cast<Resultset::SmartHandle *
>(handle);
6063 return smartHandle !=
nullptr;
6066 inline void Statement::OnFreeSmartHandle(SmartHandle *smartHandle)
6070 BindsHolder *bindsHolder =
static_cast<BindsHolder *
>(smartHandle->GetExtraInfos());
6072 smartHandle->SetExtraInfos(
nullptr);
6083 inline BindsHolder * Statement::GetBindsHolder(
bool create)
const 6085 BindsHolder * bindsHolder =
static_cast<BindsHolder *
>(_smartHandle->GetExtraInfos());
6087 if (bindsHolder ==
nullptr && create)
6089 bindsHolder =
new BindsHolder(*
this);
6090 _smartHandle->SetExtraInfos(bindsHolder);
6100 inline Resultset::Resultset(
OCI_Resultset *resultset, Handle *parent)
6102 Acquire(resultset,
nullptr,
nullptr, parent);
6187 return Seek(SeekRelative, offset);
6192 return Seek(SeekRelative, -offset);
6198 value = Get<T>(index);
6204 value = Get<T>(name);
6207 template<
class T,
class TAdapter>
6210 return adapter(static_cast<const Resultset&>(*
this), value);
6213 template<
class TCallback>
6218 if (!callback(static_cast<const Resultset&>(*
this)))
6224 return GetCurrentRow();
6227 template<
class T,
class U>
6232 if (!callback(adapter(static_cast<const Resultset&>(*
this))))
6238 return GetCurrentRow();
6242 inline short Resultset::Get<short>(
unsigned int index)
const 6248 inline short Resultset::Get<short>(
const ostring& name)
const 6254 inline unsigned short Resultset::Get<unsigned short>(
unsigned int index)
const 6260 inline unsigned short Resultset::Get<unsigned short>(
const ostring& name)
const 6266 inline int Resultset::Get<int>(
unsigned int index)
const 6272 inline int Resultset::Get<int>(
const ostring& name)
const 6278 inline unsigned int Resultset::Get<unsigned int>(
unsigned int index)
const 6284 inline unsigned int Resultset::Get<unsigned int>(
const ostring& name)
const 6290 inline big_int Resultset::Get<big_int>(
unsigned int index)
const 6296 inline big_int Resultset::Get<big_int>(
const ostring& name)
const 6302 inline big_uint Resultset::Get<big_uint>(
unsigned int index)
const 6308 inline big_uint Resultset::Get<big_uint>(
const ostring& name)
const 6314 inline float Resultset::Get<float>(
unsigned int index)
const 6320 inline float Resultset::Get<float>(
const ostring& name)
const 6326 inline double Resultset::Get<double>(
unsigned int index)
const 6332 inline double Resultset::Get<double>(
const ostring& name)
const 6338 inline Number Resultset::Get<Number>(
unsigned int index)
const 6344 inline Number Resultset::Get<Number>(
const ostring& name)
const 6350 inline ostring Resultset::Get<ostring>(
unsigned int index)
const 6356 inline ostring Resultset::Get<ostring>(
const ostring& name)
const 6362 inline Raw Resultset::Get<Raw>(
unsigned int index)
const 6366 ManagedBuffer<unsigned char> buffer(size + 1);
6368 size =
Check(
OCI_GetRaw(*
this, index, static_cast<AnyPointer>(buffer), size));
6374 inline Raw Resultset::Get<Raw>(
const ostring& name)
const 6378 ManagedBuffer<unsigned char> buffer(size + 1);
6386 inline Date Resultset::Get<Date>(
unsigned int index)
const 6392 inline Date Resultset::Get<Date>(
const ostring& name)
const 6398 inline Timestamp Resultset::Get<Timestamp>(
unsigned int index)
const 6404 inline Timestamp Resultset::Get<Timestamp>(
const ostring& name)
const 6410 inline Interval Resultset::Get<Interval>(
unsigned int index)
const 6416 inline Interval Resultset::Get<Interval>(
const ostring& name)
const 6422 inline Object Resultset::Get<Object>(
unsigned int index)
const 6428 inline Object Resultset::Get<Object>(
const ostring& name)
const 6434 inline Reference Resultset::Get<Reference>(
unsigned int index)
const 6440 inline Reference Resultset::Get<Reference>(
const ostring& name)
const 6446 inline Statement Resultset::Get<Statement>(
unsigned int index)
const 6452 inline Statement Resultset::Get<Statement>(
const ostring& name)
const 6458 inline Clob Resultset::Get<Clob>(
unsigned int index)
const 6464 inline Clob Resultset::Get<Clob>(
const ostring& name)
const 6470 inline NClob Resultset::Get<NClob>(
unsigned int index)
const 6476 inline NClob Resultset::Get<NClob>(
const ostring& name)
const 6482 inline Blob Resultset::Get<Blob>(
unsigned int index)
const 6488 inline Blob Resultset::Get<Blob>(
const ostring& name)
const 6494 inline File Resultset::Get<File>(
unsigned int index)
const 6500 inline File Resultset::Get<File>(
const ostring& name)
const 6506 inline Clong Resultset::Get<Clong>(
unsigned int index)
const 6512 inline Clong Resultset::Get<Clong>(
const ostring& name)
const 6518 inline Blong Resultset::Get<Blong>(
unsigned int index)
const 6524 inline Blong Resultset::Get<Blong>(
const ostring& name)
const 6545 inline Column::Column(
OCI_Column *pColumn, Handle *parent)
6547 Acquire(pColumn,
nullptr,
nullptr, parent);
6562 unsigned int size = OCI_SIZE_BUFFER;
6564 ManagedBuffer<otext> buffer(size + 1);
6568 return MakeString(static_cast<const otext *>(buffer));
6647 Acquire(pSubcription,
nullptr,
nullptr,
nullptr);
6653 static_cast<POCI_NOTIFY> (handler !=
nullptr ? Environment::NotifyHandler :
nullptr), port, timeout)),
6656 Environment::SetUserCallback<Subscription::NotifyHandlerProc>(
static_cast<OCI_Subscription*
>(*this), handler);
6661 Environment::SetUserCallback<Subscription::NotifyHandlerProc>(
static_cast<OCI_Subscription*
>(*this),
nullptr);
6668 Statement st(GetConnection());
6701 Acquire(pEvent,
nullptr,
nullptr,
nullptr);
6745 Acquire(pAgent,
nullptr,
nullptr, parent);
6779 Acquire(pMessage,
nullptr,
nullptr, parent);
6788 inline Object Message::GetPayload<Object>()
6794 inline void Message::SetPayload<Object>(
const Object &value)
6800 inline Raw Message::GetPayload<Raw>()
6802 unsigned int size = 0;
6804 ManagedBuffer<unsigned char> buffer(size + 1);
6812 inline void Message::SetPayload<Raw>(
const Raw &value)
6814 if (value.size() > 0)
6816 Check(
OCI_MsgSetRaw(*
this, static_cast<AnyPointer>(const_cast<Raw::value_type *>(&value[0])), static_cast<unsigned int>(value.size())));
6841 unsigned int size = OCI_SIZE_BUFFER;
6843 ManagedBuffer<unsigned char> buffer(size + 1);
6882 unsigned int size = OCI_SIZE_BUFFER;
6884 ManagedBuffer<unsigned char> buffer(size + 1);
6893 if (value.size() > 0)
6895 Check(
OCI_MsgSetOriginalID(*
this, static_cast<AnyPointer>(const_cast<Raw::value_type *>(&value[0])), static_cast<unsigned int>(value.size())));
6935 size_t size = agents.size();
6936 ManagedBuffer<OCI_Agent*> buffer(size);
6940 for (
size_t i = 0; i < size; ++i)
6942 pAgents[i] =
static_cast<const Agent &
>(agents[i]);
6984 unsigned int size = OCI_SIZE_BUFFER;
6986 ManagedBuffer<unsigned char> buffer(size + 1);
6995 if (value.size() > 0)
7016 Acquire(pDequeue,
nullptr,
nullptr,
nullptr);
7051 unsigned int size = OCI_SIZE_BUFFER;
7053 ManagedBuffer<unsigned char> buffer(size + 1);
7062 if (value.size() > 0)
7114 size_t size = agents.size();
7115 ManagedBuffer<OCI_Agent*> buffer(size);
7119 for (
size_t i = 0; i < size; ++i)
7121 pAgents[i] =
static_cast<const Agent &
>(agents[i]);
7129 Check(
OCI_DequeueSubscribe(*
this, port, timeout, static_cast<POCI_NOTIFY_AQ>(handler !=
nullptr ? Environment::NotifyHandlerAQ :
nullptr)));
7131 Environment::SetUserCallback<NotifyAQHandlerProc>(
static_cast<OCI_Dequeue*
>(*this), handler);
7148 inline void DirectPath::SetColumn(
unsigned int colIndex,
const ostring& name,
unsigned int maxSize,
const ostring& format)
7156 Check(
OCI_DirPathSetEntry(*
this, rowIndex, colIndex, static_cast<const AnyPointer>(const_cast<typename T::value_type *>(value.c_str())),
static_cast<unsigned int>(value.size()), complete));
7269 unsigned int retryDelay,
unsigned int retentionTime,
bool dependencyTracking,
const ostring& comment)
7271 Check(
OCI_QueueCreate(connection, queue.c_str(), table.c_str(), queueType, maxRetries, retryDelay, retentionTime, dependencyTracking, comment.c_str()));
7274 inline void Queue::Alter(
const Connection &connection,
const ostring& queue,
unsigned int maxRetries,
unsigned int retryDelay,
unsigned int retentionTime,
const ostring& comment)
7276 Check(
OCI_QueueAlter(connection, queue.c_str(), maxRetries, retryDelay, retentionTime, comment.c_str()));
7289 inline void Queue::Stop(
const Connection &connection,
const ostring& queue,
bool stopEnqueue,
bool stopDequeue,
bool wait)
7298 inline void QueueTable::Create(
const Connection &connection,
const ostring& table,
const ostring& payloadType,
bool multipleConsumers,
const ostring& storageClause,
const ostring& sortList,
7299 GroupingMode groupingMode,
const ostring& comment,
unsigned int primaryInstance,
unsigned int secondaryInstance,
const ostring& compatible)
7302 Check(
OCI_QueueTableCreate(connection, table.c_str(), payloadType.c_str(), storageClause.c_str(), sortList.c_str(), multipleConsumers,
7303 groupingMode, comment.c_str(), primaryInstance, secondaryInstance, compatible.c_str()));
7306 inline void QueueTable::Alter(
const Connection &connection,
const ostring& table,
const ostring& comment,
unsigned int primaryInstance,
unsigned int secondaryInstance)
OCI_EXPORT boolean OCI_API OCI_LobRead2(OCI_Lob *lob, void *buffer, unsigned int *char_count, unsigned int *byte_count)
Read a portion of a lob into the given buffer.
OCI_EXPORT OCI_Subscription *OCI_API OCI_EventGetSubscription(OCI_Event *event)
Return the subscription handle that generated this event.
Object()
Create an empty null Object instance.
TimestampType GetType() const
Return the type of the given timestamp object.
OCI_EXPORT boolean OCI_API OCI_ObjectSetFile(OCI_Object *obj, const otext *attr, OCI_File *value)
Set an object attribute of type File.
unsigned int GetAffectedRows() const
Return the number of rows affected by the SQL statement.
OCI_EXPORT boolean OCI_API OCI_BindUnsignedBigInt(OCI_Statement *stmt, const otext *name, big_uint *data)
Bind an unsigned big integer variable.
struct OCI_Agent OCI_Agent
OCILIB encapsulation of A/Q Agent.
OCI_EXPORT unsigned int OCI_API OCI_GetLongMode(OCI_Statement *stmt)
Return the long data type handling mode of a SQL statement.
OCI_EXPORT unsigned int OCI_API OCI_EnqueueGetVisibility(OCI_Enqueue *enqueue)
Get the enqueuing/locking behavior.
OCI_EXPORT OCI_Column *OCI_API OCI_GetColumn(OCI_Resultset *rs, unsigned int index)
Return the column object handle at the given index in the resultset.
bool operator>(const Timestamp &other) const
Indicates if the current Timestamp value is superior to the given Timestamp value.
Interval operator-(const Interval &other) const
Return a new Interval holding the difference of the current Interval value and the given Interval val...
unsigned int GetLongMaxSize() const
Return the LONG data type piece buffer size.
Encapsulate a Resultset column or object member properties.
BindDirection GetDirection() const
Get the direction mode.
OCI_EXPORT int OCI_API OCI_ErrorGetInternalCode(OCI_Error *err)
Retrieve Internal Error code from error handle.
OCI_EXPORT big_int OCI_API OCI_ElemGetBigInt(OCI_Elem *elem)
Return the big int value of the given collection element.
void SetHours(int value)
Set the interval hours value.
OCI_EXPORT const otext *OCI_API OCI_GetVersionServer(OCI_Connection *con)
Return the connected database server version.
OCI_EXPORT boolean OCI_API OCI_DateLastDay(OCI_Date *date)
Place the last day of month (from the given date) into the given date.
unsigned int GetSubType() const
Return the OCILIB object subtype of a column.
OCI_EXPORT boolean OCI_API OCI_MsgGetID(OCI_Msg *msg, void *id, unsigned int *len)
Return the ID of the message.
Agent Listen(int timeout)
Listen for messages that match any recipient of the associated Agent list.
OCI_EXPORT big_uint OCI_API OCI_GetAllocatedBytes(unsigned int mem_type)
Return the current number of bytes allocated internally in the library.
OCI_EXPORT boolean OCI_API OCI_ConnectionFree(OCI_Connection *con)
Close a physical connection to an Oracle database server.
unsigned int GetColumnCount() const
Return the number of columns in the resultset.
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.
OCI_EXPORT boolean OCI_API OCI_QueueStart(OCI_Connection *con, const otext *queue_name, boolean enqueue, boolean dequeue)
Start the given queue.
bool operator<(const Date &other) const
Indicates if the current date value is inferior to the given date value.
OCI_EXPORT boolean OCI_API OCI_DequeueSubscribe(OCI_Dequeue *dequeue, unsigned int port, unsigned int timeout, POCI_NOTIFY_AQ callback)
Subscribe for asynchronous messages notifications.
OCI_EXPORT const otext *OCI_API OCI_ServerGetOutput(OCI_Connection *con)
Retrieve one line of the server buffer.
ostring GetRowID() const
Return the rowid of the altered database object row.
OCI_EXPORT boolean OCI_API OCI_ColumnGetCharUsed(OCI_Column *col)
Return TRUE if the length of the column is character-length or FALSE if it is byte-length.
OCI_EXPORT boolean OCI_API OCI_SubscriptionUnregister(OCI_Subscription *sub)
Unregister a previously registered notification.
STL compliant Collection Random iterator class.
OCI_EXPORT unsigned int OCI_API OCI_LobGetType(OCI_Lob *lob)
Return the type of the given Lob object.
void Open(const ostring &db, const ostring &user, const ostring &pwd, Pool::PoolType poolType, unsigned int minSize, unsigned int maxSize, unsigned int increment=1, Environment::SessionFlags sessionFlags=Environment::SessionDefault)
Create an Oracle pool of connections or sessions.
static void Initialize(EnvironmentFlags mode=Environment::Default, const ostring &libpath=OTEXT(""))
Initialize the OCILIB environment.
OCI_EXPORT boolean OCI_API OCI_CollClear(OCI_Coll *coll)
clear all items of the given collection
bool IsValid() const
Check if the given date is valid.
OCI_EXPORT boolean OCI_API OCI_BindSetNullAtPos(OCI_Bind *bnd, unsigned int position)
Set to null the entry in the bind variable input array.
OCI_EXPORT OCI_Object *OCI_API OCI_ObjectCreate(OCI_Connection *con, OCI_TypeInfo *typinf)
Create a local object instance.
Timestamp & operator-=(int value)
Decrement the Timestamp by the given number of days.
OCI_EXPORT unsigned int OCI_API OCI_MsgGetState(OCI_Msg *msg)
Return the state of the message at the time of the dequeue.
OCI_EXPORT boolean OCI_API OCI_ElemSetNull(OCI_Elem *elem)
Set a collection element value to null.
OCI_EXPORT boolean OCI_API OCI_ObjectSetLob(OCI_Object *obj, const otext *attr, OCI_Lob *value)
Set an object attribute of type Lob.
unsigned int GetCurrentRow() const
Retrieve the current row index.
OCI_EXPORT boolean OCI_API OCI_ExecuteStmt(OCI_Statement *stmt, const otext *sql)
Prepare and Execute a SQL statement or PL/SQL block.
OCI_EXPORT boolean OCI_API OCI_ObjectSetNull(OCI_Object *obj, const otext *attr)
Set an object attribute to null.
OCI_EXPORT OCI_Column *OCI_API OCI_GetColumn2(OCI_Resultset *rs, const otext *name)
Return the column object handle from its name in the resultset.
int GetYear() const
Return the timestamp year value.
OCI_EXPORT boolean OCI_API OCI_DateAddDays(OCI_Date *date, int nb)
Add or subtract days to a date handle.
bool IsRemote() const
Check if the given lob is a remote lob.
OCI_EXPORT boolean OCI_API OCI_RegisterUnsignedShort(OCI_Statement *stmt, const otext *name)
Register an unsigned short output bind placeholder.
bool operator!=(const Interval &other) const
Indicates if the current Interval value is not equal the given Interval value.
Statement GetStatement() const
Return the statement associated with the bind object.
OCI_EXPORT boolean OCI_API OCI_RegisterUnsignedBigInt(OCI_Statement *stmt, const otext *name)
Register an unsigned big integer output bind placeholder.
Connection GetConnection() const
Return the lob parent connection.
void(* NotifyAQHandlerProc)(Dequeue &dequeue)
User callback for dequeue event notifications.
unsigned int GetErrorRow()
Return the index of a row which caused an error during data conversion.
void SetCacheSize(unsigned int value)
Set number of elements in the date cache.
OCI_EXPORT boolean OCI_API OCI_EnqueueSetRelativeMsgID(OCI_Enqueue *enqueue, const void *id, unsigned int len)
Set a message identifier to use for enqueuing messages using a sequence deviation.
OCI_EXPORT boolean OCI_API OCI_RegisterFile(OCI_Statement *stmt, const otext *name, unsigned int type)
Register a file output bind placeholder.
void SetTAFHandler(TAFHandlerProc handler)
Set the Transparent Application Failover (TAF) user handler.
OCI_EXPORT unsigned int OCI_API OCI_GetPrefetchSize(OCI_Statement *stmt)
Return the number of rows pre-fetched by OCI Client.
OCI_EXPORT boolean OCI_API OCI_RegisterDate(OCI_Statement *stmt, const otext *name)
Register a date output bind placeholder.
Lob & operator+=(const Lob &other)
Appending the given lob content to the current lob content.
void GetDateTime(int &year, int &month, int &day, int &hour, int &min, int &sec, int &fsec) const
Extract date and time parts.
void SetFetchSize(unsigned int value)
Set the number of rows fetched per internal server fetch call.
bool Delete(unsigned int index) const
Delete the element at the given position in the Nested Table Collection.
static void EnableWarnings(bool value)
Enable or disable Oracle warning notifications.
Interval()
Create an empty null Interval instance.
ostring GetPassword() const
Return the current logged user password.
OCI_EXPORT OCI_Statement *OCI_API OCI_StatementCreate(OCI_Connection *con)
Create a statement object and return its handle.
OCI_EXPORT boolean OCI_API OCI_ServerDisableOutput(OCI_Connection *con)
Disable the server output.
static unsigned int GetCompileRevisionVersion()
Return the revision version number of OCI used for compiling OCILIB.
void SetFetchMode(FetchMode value)
Set the fetch mode of a SQL statement.
OCI_EXPORT boolean OCI_API OCI_BindUnsignedInt(OCI_Statement *stmt, const otext *name, unsigned int *data)
Bind an unsigned integer variable.
OCI_EXPORT boolean OCI_API OCI_RefSetNull(OCI_Ref *ref)
Nullify the given Ref handle.
struct OCI_Connection OCI_Connection
Oracle physical connection.
OCI_EXPORT int OCI_API OCI_ObjectGetInt(OCI_Object *obj, const otext *attr)
Return the integer value of the given object attribute.
void FromString(const ostring &str, const ostring &format=OTEXT("")) const
Assign to the number object the value provided by the input number time string.
int GetSeconds() const
Return the interval seconds value.
OCI_EXPORT boolean OCI_API OCI_ThreadRun(OCI_Thread *thread, POCI_THREAD proc, void *arg)
Execute the given routine within the given thread object.
Exception class handling all OCILIB errors.
OCI_EXPORT unsigned int OCI_API OCI_GetLongMaxSize(OCI_Statement *stmt)
Return the LONG data type piece buffer size.
File()
Create an empty null File instance.
big_uint GetLength() const
Returns the number of bytes contained in the file.
void SetMinutes(int value)
Set the date minutes value.
OCI_EXPORT boolean OCI_API OCI_BindSetNotNullAtPos(OCI_Bind *bnd, unsigned int position)
Set to NOT null the entry in the bind variable input array.
OCI_EXPORT unsigned int OCI_API OCI_IntervalGetType(OCI_Interval *itv)
Return the type of the given Interval object.
unsigned int GetServerRevisionVersion() const
Return the revision version number of the connected database server.
bool IsCharSemanticUsed() const
Return true if the length of the column is character-length or false if it is byte-length.
Provides SQL bind informations.
bool IsColumnNull(unsigned int index) const
Check if the current row value is null for the column at the given index.
ostring GetServer() const
Return the Oracle server Hos name of the connected database/service name.
OCI_EXPORT boolean OCI_API OCI_DequeueFree(OCI_Dequeue *dequeue)
Free a Dequeue object.
OCI_EXPORT OCI_Connection *OCI_API OCI_ErrorGetConnection(OCI_Error *err)
Retrieve connection handle within the error occurred.
OCI_EXPORT boolean OCI_API OCI_NumberGetValue(OCI_Number *number, unsigned int type, void *value)
Assign the number value to a native C numeric type.
Date operator+(int value) const
Return a new date holding the current date value incremented by the given number of days...
void SetTrace(SessionTrace trace, const ostring &value)
Set tracing information for the session.
unsigned int GetPort() const
Return the port used by the notification.
OCI_EXPORT boolean OCI_API OCI_FileAssign(OCI_File *file, OCI_File *file_src)
Assign a file to another one.
unsigned int GetCount() const
Returns the current number of elements in the collection.
Resultset GetResultset()
Retrieve the resultset from an executed statement.
OCI_EXPORT boolean OCI_API OCI_DateFromText(OCI_Date *date, const otext *str, const otext *fmt)
Convert a string to a date and store it in the given date handle.
OCI_EXPORT const otext *OCI_API OCI_GetUserName(OCI_Connection *con)
Return the current logged user name.
OCI_EXPORT const otext *OCI_API OCI_ColumnGetSQLType(OCI_Column *col)
Return the Oracle SQL type name of the column data type.
OCI_EXPORT boolean OCI_API OCI_PoolSetStatementCacheSize(OCI_Pool *pool, unsigned int value)
Set the maximum number of statements to keep in the pool statement cache.
void SetCharsetForm(CharsetForm value)
Set the charset form of the given character based bind object.
ostring GetName() const
Return the name of the given registered subscription.
bool Next()
Fetch the next row of the resultset.
OCI_EXPORT boolean OCI_API OCI_DequeueSetWaitTime(OCI_Dequeue *dequeue, int timeout)
set the time that OCIDequeueGet() waits for messages if no messages are currently available ...
void Describe(const ostring &sql)
Describe the select list of a SQL select statement.
void SetNoLog(bool value)
Set the logging mode for the loading operation.
OCI_EXPORT boolean OCI_API OCI_FetchPrev(OCI_Resultset *rs)
Fetch the previous row of the resultset.
int GetSeconds() const
Return the timestamp seconds value.
OCI_EXPORT boolean OCI_API OCI_DequeueSetNavigation(OCI_Dequeue *dequeue, unsigned int position)
Set the position of messages to be retrieved.
OCI_EXPORT boolean OCI_API OCI_IsNull(OCI_Resultset *rs, unsigned int index)
Check if the current row value is null for the column at the given index in the resultset.
OCI_EXPORT unsigned int OCI_API OCI_ElemGetUnsignedInt(OCI_Elem *elem)
Return the unsigned int value of the given collection element.
OCI_EXPORT boolean OCI_API OCI_SetUserPassword(const otext *db, const otext *user, const otext *pwd, const otext *new_pwd)
Change the password of the given user on the given database.
OCI_EXPORT boolean OCI_API OCI_ObjectSetRaw(OCI_Object *obj, const otext *attr, void *value, unsigned int len)
Set an object attribute of type RAW.
ostring GetUserName() const
Return the current logged user name.
OCI_EXPORT const otext *OCI_API OCI_ObjectGetString(OCI_Object *obj, const otext *attr)
Return the string value of the given object attribute.
OCI_EXPORT big_uint OCI_API OCI_LobGetOffset(OCI_Lob *lob)
Return the current position in the Lob content buffer.
OCI_EXPORT boolean OCI_API OCI_IntervalSubtract(OCI_Interval *itv, OCI_Interval *itv2)
Subtract an interval handle value from another.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetFullSQLType(OCI_Column *col, otext *buffer, unsigned int len)
Return the Oracle SQL Full name including precision and size of the column data type.
void SetDefaultLobPrefetchSize(unsigned int value)
Enable or disable prefetching for all LOBs fetched in the connection.
void ChangePassword(const ostring &newPwd)
Change the password of the logged user.
OCI_EXPORT double OCI_API OCI_ObjectGetDouble(OCI_Object *obj, const otext *attr)
Return the double value of the given object attribute.
OCI_EXPORT boolean OCI_API OCI_BindString(OCI_Statement *stmt, const otext *name, otext *data, unsigned int len)
Bind a string variable.
void Set(unsigned int index, const T &value)
Set the collection element value at the given position.
OCI_EXPORT unsigned int OCI_API OCI_ObjectGetType(OCI_Object *obj)
Return the type of an object instance.
ostring GetName() const
Return the name of the bind object.
static void Purge(const Connection &connection, const ostring &table, PurgeMode mode, const ostring &condition=OTEXT(""), bool block=true)
Purge messages from the given queue table.
TypeInfo GetTypeInfo() const
Return the type information object associated to the collection.
static void Alter(const Connection &connection, const ostring &queue, unsigned int maxRetries=0, unsigned int retryDelay=0, unsigned int retentionTime=0, const ostring &comment=OTEXT(""))
Alter the given queue.
int GetMonth() const
Return the timestamp month value.
iterator begin()
Returns an iterator pointing to the first element in the collection.
OCI_EXPORT OCI_Enqueue *OCI_API OCI_EnqueueCreate(OCI_TypeInfo *typinf, const otext *name)
Create a Enqueue object for the given queue.
Enum< CharsetFormValues > CharsetForm
Type of charsetForm.
OCI_EXPORT OCI_Elem *OCI_API OCI_ElemCreate(OCI_TypeInfo *typinf)
Create a local collection element instance based on a collection type descriptor. ...
OCI_EXPORT boolean OCI_API OCI_ElemSetRaw(OCI_Elem *elem, void *value, unsigned int len)
Set a RAW value to a collection element.
OCI_EXPORT const otext *OCI_API OCI_ColumnGetName(OCI_Column *col)
Return the name of the given column.
void FromString(const ostring &str, const ostring &format=OTEXT(""))
Assign to the date object the value provided by the input date time string.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfUnsignedShorts(OCI_Statement *stmt, const otext *name, unsigned short *data, unsigned int nbelem)
Bind an array of unsigned shorts.
Object Clone() const
Clone the current instance to a new one performing deep copy.
OCI_EXPORT int OCI_API OCI_ObjectGetRaw(OCI_Object *obj, const otext *attr, void *value, unsigned int len)
Return the raw attribute value of the given object attribute into the given buffer.
OCI_EXPORT boolean OCI_API OCI_BindArraySetSize(OCI_Statement *stmt, unsigned int size)
Set the input array size for bulk operations.
OCI_EXPORT OCI_File *OCI_API OCI_ElemGetFile(OCI_Elem *elem)
Return the File value of the given collection element.
void Put(const Message &message)
Enqueue a message the on queue associated to the Enqueue object.
OCI_EXPORT OCI_Connection *OCI_API OCI_PoolGetConnection(OCI_Pool *pool, const otext *tag)
Get a connection from the pool.
void SetAutoCommit(bool enabled)
Enable or disable auto commit mode (implicit commits after every SQL execution)
OCI_EXPORT unsigned int OCI_API OCI_GetTimeout(OCI_Connection *con, unsigned int type)
Returns the requested timeout value for OCI calls that require server round-trips to the given databa...
CollectionElement< T > operator[](unsigned int index)
Returns the element at a given position in the collection.
OCI_EXPORT boolean OCI_API OCI_IntervalFromTimeZone(OCI_Interval *itv, const otext *str)
Correct an interval handle value with the given time zone.
OCI_EXPORT unsigned int OCI_API OCI_GetImportMode(void)
Return the Oracle shared library import mode.
OCI_EXPORT unsigned int OCI_API OCI_BindGetDirection(OCI_Bind *bnd)
Get the direction mode of a bind handle.
Long< Raw, LongBinary > Blong
Class handling LONG RAW oracle type.
OCI_EXPORT OCI_Connection *OCI_API OCI_FileGetConnection(OCI_File *file)
Retrieve connection handle from the file handle.
OCI_EXPORT boolean OCI_API OCI_SetBindMode(OCI_Statement *stmt, unsigned int mode)
Set the binding mode of a SQL statement.
OCI_EXPORT boolean OCI_API OCI_ObjectToText(OCI_Object *obj, unsigned int *size, otext *str)
Convert an object handle value to a string.
OCI_EXPORT boolean OCI_API OCI_DequeueSetVisibility(OCI_Dequeue *dequeue, unsigned int visibility)
Set whether the new message is dequeued as part of the current transaction.
OCI_EXPORT OCI_Statement *OCI_API OCI_GetStatement(OCI_Resultset *rs, unsigned int index)
Return the current cursor value (Nested table) of the column at the given index in the resultset...
OCI_EXPORT boolean OCI_API OCI_FileExists(OCI_File *file)
Check if the given file exists on server.
OCI_EXPORT boolean OCI_API OCI_FetchLast(OCI_Resultset *rs)
Fetch the last row of the resultset.
unsigned int GetRow() const
Return the row index which caused an error during statement execution.
OCI_EXPORT boolean OCI_API OCI_BindStatement(OCI_Statement *stmt, const otext *name, OCI_Statement *data)
Bind a Statement variable (PL/SQL Ref Cursor)
OCI_EXPORT boolean OCI_API OCI_ObjectSetShort(OCI_Object *obj, const otext *attr, short value)
Set an object attribute of type short.
bool IsTemporary() const
Check if the given lob is a temporary lob.
OCI_EXPORT boolean OCI_API OCI_DateAddMonths(OCI_Date *date, int nb)
Add or subtract months to a date handle.
ostring ToString() const override
Convert the interval value to a string using the default precisions of 10.
void Forget()
Cancel the prepared global transaction validation.
T Get(unsigned int index) const
Return the current value of the column at the given index in the resultset.
void ChangeTimeZone(const ostring &tzSrc, const ostring &tzDst)
Convert the date from one zone to another zone.
ostring GetAddress() const
Get the given AQ agent address.
OCI_EXPORT boolean OCI_API OCI_MutexAcquire(OCI_Mutex *mutex)
Acquire a mutex lock.
OCI_EXPORT boolean OCI_API OCI_ElemSetString(OCI_Elem *elem, const otext *value)
Set a string value to a collection element.
bool operator++(int)
Convenient operator overloading that performs a call to Next()
int GetMonth() const
Return the interval month value.
void SetDaySecond(int day, int hour, int min, int sec, int fsec)
Set the Day / Second parts.
OCI_EXPORT boolean OCI_API OCI_Ping(OCI_Connection *con)
Makes a round trip call to the server to confirm that the connection and the server are active...
big_uint GetChunkSize() const
Returns the current lob chunk size.
StatementType GetStatementType() const
Return the type of a SQL statement.
OCI_EXPORT unsigned int OCI_API OCI_GetAffectedRows(OCI_Statement *stmt)
Return the number of rows affected by the SQL statement.
Date LastDay() const
Return the last day of month from the current date object.
OCI_EXPORT unsigned int OCI_API OCI_LobRead(OCI_Lob *lob, void *buffer, unsigned int len)
[OBSOLETE] Read a portion of a lob into the given buffer
void Open()
Open a file for reading on the server.
void SetHours(int value)
Set the timestamp hours value.
static void Alter(const Connection &connection, const ostring &table, const ostring &comment, unsigned int primaryInstance=0, unsigned int secondaryInstance=0)
Alter the given queue table.
Reference Clone() const
Clone the current instance to a new one performing deep copy.
int GetDay() const
Return the interval day value.
Subscription()
Default constructor.
OCI_EXPORT unsigned short OCI_API OCI_GetUnsignedShort2(OCI_Resultset *rs, const otext *name)
Return the current unsigned short value of the column from its name in the resultset.
OCI_EXPORT boolean OCI_API OCI_ElemSetInterval(OCI_Elem *elem, OCI_Interval *value)
Assign an Interval handle to a collection element.
unsigned int GetRowCount() const
Return the number of rows successfully loaded into the database so far.
Subscription GetSubscription() const
Return the subscription that generated this event.
OCI_EXPORT unsigned int OCI_API OCI_PoolGetStatementCacheSize(OCI_Pool *pool)
Return the maximum number of statements to keep in the pool statement cache.
unsigned int GetSubType() const
Return the OCILIB object subtype of a column.
OCI_EXPORT boolean OCI_API OCI_BindDouble(OCI_Statement *stmt, const otext *name, double *data)
Bind a double variable.
OCI_EXPORT OCI_Ref *OCI_API OCI_ObjectGetRef(OCI_Object *obj, const otext *attr)
Return the Ref value of the given object attribute.
OCI_EXPORT boolean OCI_API OCI_ObjectSetDouble(OCI_Object *obj, const otext *attr, double value)
Set an object attribute of type double.
Date NextDay(const ostring &day) const
Return the date of next day of the week, after the current date object.
OCI_EXPORT OCI_Lob *OCI_API OCI_GetLob2(OCI_Resultset *rs, const otext *name)
Return the current lob value of the column from its name in the resultset.
Date(bool create=false)
Create an empty null Date object.
Enum< LobTypeValues > LobType
Type of Lob.
OCI_EXPORT int OCI_API OCI_ColumnGetScale(OCI_Column *col)
Return the scale of the column for numeric columns.
static void Release(MutexHandle handle)
Release a mutex lock.
OCI_EXPORT boolean OCI_API OCI_SetDefaultLobPrefetchSize(OCI_Connection *con, unsigned int value)
Enable or disable prefetching for all LOBs fetched in the connection.
int GetMinutes() const
Return the date minutes value.
OCI_EXPORT boolean OCI_API OCI_CollDeleteElem(OCI_Coll *coll, unsigned int index)
Delete the element at the given position in the Nested Table Collection.
OCI_EXPORT boolean OCI_API OCI_TimestampFromText(OCI_Timestamp *tmsp, const otext *str, const otext *fmt)
Convert a string to a timestamp and store it in the given timestamp handle.
OCI_EXPORT int OCI_API OCI_DateCompare(OCI_Date *date, OCI_Date *date2)
Compares two date handles.
Enum< DataTypeValues > DataType
Column data type.
OCI_Mutex * MutexHandle
Alias for an OCI_Mutex pointer.
static void Drop(const Connection &connection, const ostring &queue)
Drop the given queue.
struct OCI_XID OCI_XID
Global transaction identifier.
void Copy(Lob &dest, big_uint offset, big_uint offsetDest, big_uint length) const
Copy the given portion of the lob content to another one.
ostring GetMessage() const
Retrieve the error message.
OCI_EXPORT boolean OCI_API OCI_MsgSetOriginalID(OCI_Msg *msg, const void *id, unsigned int len)
Set the original ID of the message in the last queue that generated this message. ...
Timestamp Clone() const
Clone the current instance to a new one performing deep copy.
OCI_EXPORT OCI_Interval *OCI_API OCI_GetInterval(OCI_Resultset *rs, unsigned int index)
Return the current interval value of the column at the given index in the resultset.
OCI_EXPORT boolean OCI_API OCI_ObjectSetRef(OCI_Object *obj, const otext *attr, OCI_Ref *value)
Set an object attribute of type Ref.
static ostring GetFormat(FormatType formatType)
Return the format string for implicit string conversions of the given type.
OCI_EXPORT OCI_Bind *OCI_API OCI_GetBind(OCI_Statement *stmt, unsigned int index)
Return the bind handle at the given index in the internal array of bind handle.
int GetHours() const
Return the interval hours value.
OCI_EXPORT OCI_Lob *OCI_API OCI_ObjectGetLob(OCI_Object *obj, const otext *attr)
Return the lob value of the given object attribute.
bool operator<=(const Date &other) const
Indicates if the current date value is inferior or equal to the given date value. ...
OCI_EXPORT boolean OCI_API OCI_NumberAdd(OCI_Number *number, unsigned int type, void *value)
Add the value of a native C numeric type to the given number.
unsigned int GetBindIndex(const ostring &name) const
Return the index of the bind from its name belonging to the statement.
OCI_EXPORT boolean OCI_API OCI_MsgGetOriginalID(OCI_Msg *msg, void *id, unsigned int *len)
Return the original ID of the message in the last queue that generated this message.
OCI_EXPORT boolean OCI_API OCI_ObjectSetNumber(OCI_Object *obj, const otext *attr, OCI_Number *value)
Set an object attribute of type number.
static void ShutdownDatabase(const ostring &db, const ostring &user, const ostring &pwd, Environment::ShutdownFlags shutdownFlags, Environment::ShutdownMode shutdownMode, Environment::SessionFlags sessionFlags=SessionSysDba)
Shutdown a database instance.
A connection or session with a specific database.
ostring GetFullSQLType() const
Return the Oracle SQL Full name including precision and size of the column data type.
OCI_EXPORT boolean OCI_API OCI_DirPathSetBufferSize(OCI_DirPath *dp, unsigned int size)
Set the size of the internal stream transfer buffer.
Lob()
Create an empty null Lob instance.
OCI_EXPORT boolean OCI_API OCI_Commit(OCI_Connection *con)
Commit current pending changes.
OCI_EXPORT boolean OCI_API OCI_NumberDivide(OCI_Number *number, unsigned int type, void *value)
Divide the given number with the value of a native C numeric.
OCI_EXPORT OCI_Ref *OCI_API OCI_GetRef(OCI_Resultset *rs, unsigned int index)
Return the current Ref value of the column at the given index in the resultset.
void Convert(const Timestamp &other)
Convert the current timestamp to the type of the given timestamp.
OCI_EXPORT boolean OCI_API OCI_StatementFree(OCI_Statement *stmt)
Free a statement and all resources associated to it (resultsets ...)
DequeueVisibility GetVisibility() const
Get the dequeuing/locking behavior.
OCI_EXPORT const otext *OCI_API OCI_GetString(OCI_Resultset *rs, unsigned int index)
Return the current string value of the column at the given index in the resultset.
unsigned int GetOpenedConnectionsCount() const
Return the current number of opened connections/sessions.
void Close()
Close the physical connection to the DB server.
OCI_EXPORT boolean OCI_API OCI_ElemSetBigInt(OCI_Elem *elem, big_int value)
Set a big int value to a collection element.
OCI_EXPORT unsigned int OCI_API OCI_ErrorGetType(OCI_Error *err)
Retrieve the type of error from error handle.
OCI_EXPORT int OCI_API OCI_DateCheck(OCI_Date *date)
Check if the given date is valid.
TypeInfo GetTypeInfo() const
Return the TypeInfo object describing the object.
Timestamp & operator+=(int value)
Increment the Timestamp by the given number of days.
int DaysBetween(const Date &other) const
Return the number of days with the given date.
void SetYear(int value)
Set the interval year value.
OCI_EXPORT boolean OCI_API OCI_BindBigInt(OCI_Statement *stmt, const otext *name, big_int *data)
Bind a big integer variable.
OCI_EXPORT unsigned int OCI_API OCI_DirPathLoad(OCI_DirPath *dp)
Loads the data converted to direct path stream format.
OCI_EXPORT OCI_Date *OCI_API OCI_GetDate(OCI_Resultset *rs, unsigned int index)
Return the current date value of the column at the given index in the resultset.
void SetExceptionQueue(const ostring &value)
Set the name of the queue to which the message is moved to if it cannot be processed successfully...
OCI_EXPORT boolean OCI_API OCI_Break(OCI_Connection *con)
Perform an immediate abort of any currently Oracle OCI call.
big_uint GetOffset() const
Returns the current R/W offset within the file.
NavigationMode GetNavigation() const
Return the navigation position of messages to retrieve from the queue.
T Read(unsigned int length)
Read a portion of a lob.
OCI_EXPORT boolean OCI_API OCI_SetTAFHandler(OCI_Connection *con, POCI_TAF_HANDLER handler)
Set the Transparent Application Failover (TAF) user handler.
OCI_EXPORT boolean OCI_API OCI_DirPathFree(OCI_DirPath *dp)
Free an OCI_DirPath handle.
static void Join(ThreadHandle handle)
Join the given thread.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfIntervals(OCI_Statement *stmt, const otext *name, OCI_Interval **data, unsigned int type, unsigned int nbelem)
Bind an array of interval handles.
OCI_EXPORT unsigned int OCI_API OCI_FileRead(OCI_File *file, void *buffer, unsigned int len)
Read a portion of a file into the given buffer.
void SetBindMode(BindMode value)
Set the binding mode of a SQL statement.
struct OCI_Interval OCI_Interval
Oracle internal interval representation.
Object identifying the SQL data type LONG.
OCI_EXPORT const otext *OCI_API OCI_GetSqlIdentifier(OCI_Statement *stmt)
Returns the statement SQL_ID from the server.
OCI_EXPORT boolean OCI_API OCI_DateFree(OCI_Date *date)
Free a date object.
OCI_EXPORT const otext *OCI_API OCI_MsgGetExceptionQueue(OCI_Msg *msg)
Get the Exception queue name of the message.
bool operator!=(const Timestamp &other) const
Indicates if the current Timestamp value is not equal the given Timestamp value.
static unsigned int GetCompileMinorVersion()
Return the minor version number of OCI used for compiling OCILIB.
bool operator>(const Interval &other) const
Indicates if the current Interval value is superior to the given Interval value.
struct OCI_Dequeue OCI_Dequeue
OCILIB encapsulation of A/Q dequeuing operations.
int GetOracleErrorCode() const
Return the Oracle error code.
void Register(const Connection &connection, const ostring &name, ChangeTypes changeTypes, NotifyHandlerProc handler, unsigned int port=0, unsigned int timeout=0)
Register a notification against the given database.
Oracle Transaction object.
OCI_EXPORT OCI_Object *OCI_API OCI_GetObject2(OCI_Resultset *rs, const otext *name)
Return the current Object value of the column from its name in the resultset.
OCI_EXPORT boolean OCI_API OCI_GetAutoCommit(OCI_Connection *con)
Get current auto commit mode status.
OCI_EXPORT unsigned short OCI_API OCI_ElemGetUnsignedShort(OCI_Elem *elem)
Return the unsigned short value of the given collection element.
struct OCI_Statement OCI_Statement
Oracle SQL or PL/SQL statement.
bool IsNullable() const
Return true if the column is nullable otherwise false.
Agent(const Connection &connection, const ostring &name=OTEXT(""), const ostring &address=OTEXT(""))
Create an AQ agent object.
OCI_EXPORT OCI_Ref *OCI_API OCI_GetRef2(OCI_Resultset *rs, const otext *name)
Return the current Ref value of the column from its name in the resultset.
OCI_EXPORT big_uint OCI_API OCI_FileGetSize(OCI_File *file)
Return the size in bytes of a file.
OCI_EXPORT OCI_File *OCI_API OCI_GetFile2(OCI_Resultset *rs, const otext *name)
Return the current File value of the column from its name in the resultset.
void SetMinutes(int value)
Set the interval minutes value.
int GetMinutes() const
Return the timestamp minutes value.
static unsigned int GetCompileMajorVersion()
Return the major version number of OCI used for compiling OCILIB.
Raw MakeRaw(void *result, unsigned int size)
Internal usage. Constructs a C++ Raw object from the given OCILIB raw buffer.
OCI_EXPORT boolean OCI_API OCI_BindInterval(OCI_Statement *stmt, const otext *name, OCI_Interval *data)
Bind an interval variable.
OCI_EXPORT boolean OCI_API OCI_FileSetName(OCI_File *file, const otext *dir, const otext *name)
Set the directory and file name of FILE handle.
OCI_EXPORT int OCI_API OCI_ErrorGetOCICode(OCI_Error *err)
Retrieve Oracle Error code from error handle.
OCI_EXPORT const otext *OCI_API OCI_MsgGetCorrelation(OCI_Msg *msg)
Get the correlation identifier of the message.
OCI_EXPORT int OCI_API OCI_DateAssign(OCI_Date *date, OCI_Date *date_src)
Assign the value of a date handle to another one.
void ExecutePrepared()
Execute a prepared SQL statement or PL/SQL block.
struct OCI_Bind OCI_Bind
Internal bind representation.
ostring GetObjectName() const
Return the name of the object that generated the event.
OCI_EXPORT boolean OCI_API OCI_BindInt(OCI_Statement *stmt, const otext *name, int *data)
Bind an integer variable.
OCI_EXPORT boolean OCI_API OCI_ThreadKeyCreate(const otext *name, POCI_THREADKEYDEST destfunc)
Create a thread key object.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfTimestamps(OCI_Statement *stmt, const otext *name, OCI_Timestamp **data, unsigned int type, unsigned int nbelem)
Bind an array of timestamp handles.
OCI_EXPORT boolean OCI_API OCI_ObjectSetObject(OCI_Object *obj, const otext *attr, OCI_Object *value)
Set an object attribute of type Object.
int GetHours() const
Return the date hours value.
OCI_EXPORT boolean OCI_API OCI_NumberToText(OCI_Number *number, const otext *fmt, int size, otext *str)
Convert a number value from the given number handle to a string.
OCI_EXPORT boolean OCI_API OCI_TimestampGetDateTime(OCI_Timestamp *tmsp, int *year, int *month, int *day, int *hour, int *min, int *sec, int *fsec)
Extract the date and time parts from a date handle.
struct OCI_Subscription OCI_Subscription
OCILIB encapsulation of Oracle DCN notification.
static Environment::EnvironmentFlags GetMode()
Return the Environment mode flags.
void Close()
Close explicitly a Lob.
int GetDay() const
Return the date day value.
TimestampTypeValues
Interval types enumerated values.
void Parse(const ostring &sql)
Parse a SQL statement or PL/SQL block.
OCI_EXPORT boolean OCI_API OCI_BindFile(OCI_Statement *stmt, const otext *name, OCI_File *data)
Bind a File variable.
ostring ToString() const override
return a string representation of the current collection
StartFlagsValues
Oracle instance start flags enumerated values.
bool Last()
Fetch the last row of the resultset.
bool operator<(const Timestamp &other) const
Indicates if the current Timestamp value is inferior to the given Timestamp value.
AQ identified agent for messages delivery.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfShorts(OCI_Statement *stmt, const otext *name, short *data, unsigned int nbelem)
Bind an array of shorts.
Enum< OracleVersionValues > OracleVersion
Oracle Version.
TypeInfo GetTypeInfo() const
Return the type information object associated to the column.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfDoubles(OCI_Statement *stmt, const otext *name, double *data, unsigned int nbelem)
Bind an array of doubles.
virtual ~Exception()
Virtual destructor required for deriving from std::exception.
void SetEntry(unsigned int rowIndex, unsigned int colIndex, const T &value, bool complete=true)
Set the value of the given row/column array entry from the given string.
void SetSeconds(int value)
Set the date seconds value.
Column GetColumn(unsigned int index) const
Return the column from its index in the resultset.
OCI_EXPORT OCI_Statement *OCI_API OCI_ResultsetGetStatement(OCI_Resultset *rs)
Return the statement handle associated with a resultset handle.
OCI_EXPORT short OCI_API OCI_ObjectGetShort(OCI_Object *obj, const otext *attr)
Return the short value of the given object attribute.
OCI_EXPORT boolean OCI_API OCI_ObjectSetColl(OCI_Object *obj, const otext *attr, OCI_Coll *value)
Set an object attribute of type Collection.
OCI_EXPORT int OCI_API OCI_TimestampCompare(OCI_Timestamp *tmsp, OCI_Timestamp *tmsp2)
Compares two timestamp handles.
OCI_EXPORT double OCI_API OCI_GetDouble2(OCI_Resultset *rs, const otext *name)
Return the current double value of the column from its name in the resultset.
ObjectEvent GetObjectEvent() const
Return the type of operation reported by a notification.
Simplified resolver for scalar types that do not need translation.
OCI_EXPORT boolean OCI_API OCI_ElemSetBoolean(OCI_Elem *elem, boolean value)
Set a boolean value to a collection element.
OCI_EXPORT boolean OCI_API OCI_BindObject(OCI_Statement *stmt, const otext *name, OCI_Object *data)
Bind an object (named type) variable.
Transaction GetTransaction() const
Return the current transaction of the connection.
OCI_EXPORT const otext *OCI_API OCI_SubscriptionGetName(OCI_Subscription *sub)
Return the name of the given registered subscription.
static Environment::ImportMode GetImportMode()
Return the Oracle shared library import mode.
OCI_EXPORT unsigned int OCI_API OCI_PoolGetOpenedCount(OCI_Pool *pool)
Return the current number of opened connections/sessions.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetSubType(OCI_Column *col)
Return the OCILIB object subtype of a column.
OCI_EXPORT unsigned int OCI_API OCI_BindGetDataSize(OCI_Bind *bnd)
Return the actual size of the element held by the given bind handle.
void Reset()
Reset internal arrays and streams to prepare another load.
int GetYear() const
Return the interval year value.
OCI_EXPORT boolean OCI_API OCI_FileIsOpen(OCI_File *file)
Check if the specified file is opened within the file handle.
OCI_EXPORT int OCI_API OCI_GetInt2(OCI_Resultset *rs, const otext *name)
Return the current integer value of the column from its name in the resultset.
ostring GetDatabase() const
Return the Oracle server database name of the connected database/service name.
OCI_EXPORT boolean OCI_API OCI_PoolSetNoWait(OCI_Pool *pool, boolean value)
Set the waiting mode used when no more connections/sessions are available from the pool...
void SetTimeout(TimeoutType timeout, unsigned int value)
Set a given timeout for OCI calls that require server round-trips to the given database.
OCI_EXPORT boolean OCI_API OCI_DateGetDateTime(OCI_Date *date, int *year, int *month, int *day, int *hour, int *min, int *sec)
Extract the date and time parts from a date handle.
OCI_EXPORT OCI_Long *OCI_API OCI_GetLong(OCI_Resultset *rs, unsigned int index)
Return the current Long value of the column at the given index in the resultset.
OCI_EXPORT const otext *OCI_API OCI_EventGetObject(OCI_Event *event)
Return the name of the object that generated the event.
bool operator>=(const Timestamp &other) const
Indicates if the current Timestamp value is superior or equal to the given Timestamp value...
OCI_EXPORT big_uint OCI_API OCI_ObjectGetUnsignedBigInt(OCI_Object *obj, const otext *attr)
Return the unsigned big integer value of the given object attribute.
OCI_EXPORT big_uint OCI_API OCI_GetUnsignedBigInt2(OCI_Resultset *rs, const otext *name)
Return the current unsigned big integer value of the column from its name in the resultset.
OCI_EXPORT OCI_Timestamp *OCI_API OCI_GetInstanceStartTime(OCI_Connection *con)
Return the date and time (Timestamp) server instance start of the connected database/service name...
OCI_EXPORT OCI_Date *OCI_API OCI_GetDate2(OCI_Resultset *rs, const otext *name)
Return the current date value of the column from its name in the resultset.
OCI_EXPORT unsigned int OCI_API OCI_PoolGetIncrement(OCI_Pool *pool)
Return the increment for connections/sessions to be opened to the database when the pool is not full...
static void Stop(const Connection &connection, const ostring &queue, bool stopEnqueue=true, bool stopDequeue=true, bool wait=true)
Stop enqueuing or dequeuing or both on the given queue.
OCI_EXPORT boolean OCI_API OCI_DequeueSetConsumer(OCI_Dequeue *dequeue, const otext *consumer)
Set the current consumer name to retrieve message for.
OCI_EXPORT const otext *OCI_API OCI_GetSessionTag(OCI_Connection *con)
Return the tag associated the given connection.
OCI_EXPORT unsigned int OCI_API OCI_ElemGetRawSize(OCI_Elem *elem)
Return the raw attribute value size of the given element handle.
bool operator==(const Lob &other) const
Indicates if the current lob value is equal to the given lob value.
int GetMonth() const
Return the date month value.
Reference GetReference() const
Creates a reference on the current object.
OCI_EXPORT boolean OCI_API OCI_QueueTableAlter(OCI_Connection *con, const otext *queue_table, const otext *comment, unsigned int primary_instance, unsigned int secondary_instance)
Alter the given queue table.
ostring GetTrace(SessionTrace trace) const
Get the current trace for the trace type from the given connection.
OCI_EXPORT boolean OCI_API OCI_MsgReset(OCI_Msg *msg)
Reset all attributes of a message object.
void SetStatementCacheSize(unsigned int value)
Set the maximum number of statements to keep in the pool's statement cache.
struct OCI_Timestamp OCI_Timestamp
Oracle internal timestamp representation.
int GetPriority() const
Return the priority of the message.
OCI_EXPORT boolean OCI_API OCI_AgentSetName(OCI_Agent *agent, const otext *name)
Set the given AQ agent name.
OCI_EXPORT boolean OCI_API OCI_QueueTablePurge(OCI_Connection *con, const otext *queue_table, const otext *purge_condition, boolean block, unsigned int delivery_mode)
Purge messages from the given queue table.
void SetBufferSize(unsigned int value)
Set the size of the internal stream transfer buffer.
OCI_EXPORT unsigned int OCI_API OCI_PoolGetMax(OCI_Pool *pool)
Return the maximum number of connections/sessions that can be opened to the database.
OCI_EXPORT boolean OCI_API OCI_LobIsEqual(OCI_Lob *lob, OCI_Lob *lob2)
Compare two lob handles for equality.
ostring ToString() const override
return a string representation of the current reference
ostring GetFormat(FormatType formatType)
Return the format string for implicit string conversions of the given type.
ostring GetSql() const
Return the last SQL or PL/SQL statement prepared or executed by the statement.
OCI_EXPORT boolean OCI_API OCI_LobAssign(OCI_Lob *lob, OCI_Lob *lob_src)
Assign a lob to another one.
OCI_EXPORT big_uint OCI_API OCI_LobErase(OCI_Lob *lob, big_uint offset, big_uint len)
Erase a portion of the lob at a given position.
OCI_EXPORT const otext *OCI_API OCI_GetString2(OCI_Resultset *rs, const otext *name)
Return the current string value of the column from its name in the resultset.
OCI_EXPORT OCI_TypeInfo *OCI_API OCI_CollGetTypeInfo(OCI_Coll *coll)
Return the type info object associated to the collection.
OCI_EXPORT boolean OCI_API OCI_SetTimeout(OCI_Connection *con, unsigned int type, unsigned int value)
Set a given timeout for OCI calls that require server round-trips to the given database.
Template Enumeration template class providing some type safety to some extends for manipulating enume...
OCI_EXPORT unsigned int OCI_API OCI_LobGetChunkSize(OCI_Lob *lob)
Returns the chunk size of a LOB.
void Flush()
Flush the lob content to the server (if applicable)
OCI_EXPORT boolean OCI_API OCI_RefToText(OCI_Ref *ref, unsigned int size, otext *str)
Converts a Ref handle value to a hexadecimal string.
OCI_EXPORT boolean OCI_API OCI_ThreadJoin(OCI_Thread *thread)
Join the given thread.
OCI_EXPORT unsigned int OCI_API OCI_GetCharset(void)
Return the OCILIB charset type.
Timestamp & operator++()
Increment the timestamp by 1 day.
OCI_EXPORT float OCI_API OCI_ElemGetFloat(OCI_Elem *elem)
Return the float value of the given collection element.
OCI_EXPORT unsigned int OCI_API OCI_GetServerRevisionVersion(OCI_Connection *con)
Return the revision version number of the connected database server.
Timestamp operator-(int value) const
Return a new Timestamp holding the current Timestamp value decremented by the given number of days...
OCI_EXPORT boolean OCI_API OCI_ObjectAssign(OCI_Object *obj, OCI_Object *obj_src)
Assign an object to another one.
void SetDateTime(int year, int month, int day, int hour, int min, int sec)
Set the date and time part.
Long()
Create an empty null Long instance.
void Reset()
Reset all attributes of the message.
unsigned int GetServerMinorVersion() const
Return the minor version number of the connected database server.
Statement GetStatement() const
Return the statement associated with the resultset.
OCI_EXPORT boolean OCI_API OCI_BindRaw(OCI_Statement *stmt, const otext *name, void *data, unsigned int len)
Bind a raw buffer.
static T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so, it raises a C++ exception using the retrieved error handle.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfLobs(OCI_Statement *stmt, const otext *name, OCI_Lob **data, unsigned int type, unsigned int nbelem)
Bind an array of Lob handles.
void SetHours(int value)
Set the date hours value.
static void Create(const Connection &connection, const ostring &table, const ostring &payloadType, bool multipleConsumers, const ostring &storageClause=OTEXT(""), const ostring &sortList=OTEXT(""), GroupingMode groupingMode=None, const ostring &comment=OTEXT(""), unsigned int primaryInstance=0, unsigned int secondaryInstance=0, const ostring &compatible=OTEXT(""))
Create a queue table for messages of the given type.
void FromString(const ostring &data)
Assign to the interval object the value provided by the input interval string.
Connection GetConnection() const
Return the connection associated with a statement.
Number Clone() const
Clone the current instance to a new one performing deep copy.
OCI_EXPORT boolean OCI_API OCI_ElemGetBoolean(OCI_Elem *elem)
Return the boolean value of the given collection element.
OCI_EXPORT boolean OCI_API OCI_DirPathSetCacheSize(OCI_DirPath *dp, unsigned int size)
Set number of elements in the date cache.
OCI_EXPORT OCI_Date *OCI_API OCI_ElemGetDate(OCI_Elem *elem)
Return the Date value of the given collection element.
static void ChangeUserPassword(const ostring &db, const ostring &user, const ostring &pwd, const ostring &newPwd)
Change the password of the given user on the given database.
OCI_EXPORT unsigned int OCI_API OCI_GetRowCount(OCI_Resultset *rs)
Retrieve the number of rows fetched so far.
OCI_EXPORT boolean OCI_API OCI_BindSetDataSizeAtPos(OCI_Bind *bnd, unsigned int position, unsigned int size)
Set the size of the element at the given position in the bind input array.
OCI_EXPORT unsigned int OCI_API OCI_BindArrayGetSize(OCI_Statement *stmt)
Return the current input array size for bulk operations.
OCI_EXPORT unsigned int OCI_API OCI_EventGetType(OCI_Event *event)
Return the type of event reported by a notification.
boolean OCI_API OCI_BindSetCharsetForm(OCI_Bind *bnd, unsigned int csfrm)
Set the charset form of the given character based bind variable.
OCI_EXPORT boolean OCI_API OCI_DatabaseShutdown(const otext *db, const otext *user, const otext *pwd, unsigned int sess_mode, unsigned int shut_mode, unsigned int shut_flag)
Shutdown a database instance.
OCI_EXPORT boolean OCI_API OCI_DateGetTime(OCI_Date *date, int *hour, int *min, int *sec)
Extract the time part from a date handle.
OCI_EXPORT const otext *OCI_API OCI_GetPassword(OCI_Connection *con)
Return the current logged user password.
ShutdownModeValues
Oracle instance shutdown modes enumerated values.
bool operator<=(const Interval &other) const
Indicates if the current Interval value is inferior or equal to the given Interval value...
OCI_EXPORT boolean OCI_API OCI_TimestampGetTime(OCI_Timestamp *tmsp, int *hour, int *min, int *sec, int *fsec)
Extract the time portion from a timestamp handle.
void SetLongMaxSize(unsigned int value)
Set the LONG data type piece buffer size.
OCI_EXPORT boolean OCI_API OCI_NumberFree(OCI_Number *number)
Free a number object.
unsigned int GetColumnIndex(const ostring &name) const
Return the index of the column in the result from its name.
Column GetColumn(unsigned int index) const
Return the column from its index in the resultset.
OCI_EXPORT boolean OCI_API OCI_LobWrite2(OCI_Lob *lob, void *buffer, unsigned int *char_count, unsigned int *byte_count)
Write a buffer into a LOB.
void Close()
Destroy the current Oracle pool of connections or sessions.
OCI_EXPORT unsigned int OCI_API OCI_GetUnsignedInt2(OCI_Resultset *rs, const otext *name)
Return the current unsigned integer value of the column from its name in the resultset.
OCI_EXPORT OCI_Timestamp *OCI_API OCI_ObjectGetTimestamp(OCI_Object *obj, const otext *attr)
Return the timestamp value of the given object attribute.
OCI_EXPORT boolean OCI_API OCI_BindSetDirection(OCI_Bind *bnd, unsigned int direction)
Set the direction mode of a bind handle.
OCI_EXPORT boolean OCI_API OCI_EnqueueGetRelativeMsgID(OCI_Enqueue *enqueue, void *id, unsigned int *len)
Get the current associated message identifier used for enqueuing messages using a sequence deviation...
struct OCI_Msg OCI_Msg
OCILIB encapsulation of A/Q message.
OCI_EXPORT boolean OCI_API OCI_IsRebindingAllowed(OCI_Statement *stmt)
Indicate if rebinding is allowed on the given statement.
OCI_EXPORT boolean OCI_API OCI_TimestampGetTimeZoneName(OCI_Timestamp *tmsp, int size, otext *str)
Return the time zone name of a timestamp handle.
OCI_EXPORT unsigned int OCI_API OCI_TransactionGetMode(OCI_Transaction *trans)
Return global transaction mode.
OCI_EXPORT OCI_Statement *OCI_API OCI_BindGetStatement(OCI_Bind *bnd)
Return the statement handle associated with a bind handle.
OCI_EXPORT boolean OCI_API OCI_IntervalGetDaySecond(OCI_Interval *itv, int *day, int *hour, int *min, int *sec, int *fsec)
Return the day / time portion of an interval handle.
EventType GetType() const
Return the type of event reported by a notification.
OCI_EXPORT boolean OCI_API OCI_ElemSetRef(OCI_Elem *elem, OCI_Ref *value)
Assign a Ref handle to a collection element.
const void * ThreadId
Thread Unique ID.
OCI_EXPORT OCI_Object *OCI_API OCI_ObjectGetObject(OCI_Object *obj, const otext *attr)
Return the object value of the given object attribute.
OCI_EXPORT unsigned int OCI_API OCI_EventGetOperation(OCI_Event *event)
Return the type of operation reported by a notification.
unsigned int GetMaxRows() const
Return the maximum number of rows allocated in the OCI and OCILIB internal arrays of rows...
void SetConsumer(const ostring &value)
Set the current consumer name to retrieve message for.
void SetUserData(AnyPointer value)
Associate a pointer to user data to the given connection.
OCI_EXPORT boolean OCI_API OCI_ThreadKeySetValue(const otext *name, void *value)
Set a thread key value.
OCI_EXPORT short OCI_API OCI_GetShort2(OCI_Resultset *rs, const otext *name)
Return the current short value of the column from its name in the resultset.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfUnsignedBigInts(OCI_Statement *stmt, const otext *name, big_uint *data, unsigned int nbelem)
Bind an array of unsigned big integers.
OCI_EXPORT boolean OCI_API OCI_TimestampIntervalSub(OCI_Timestamp *tmsp, OCI_Interval *itv)
Subtract an interval value from a timestamp value of a timestamp handle.
void SetDay(int value)
Set the date day value.
OCI_EXPORT boolean OCI_API OCI_MutexFree(OCI_Mutex *mutex)
Destroy a mutex object.
OCI_EXPORT boolean OCI_API OCI_LobIsRemote(OCI_Lob *lob)
Indicates if the given lob belongs to a local or remote database table.
bool operator--(int)
Convenient operator overloading that performs a call to Prev()
void FromString(const ostring &data, const ostring &format=OCI_STRING_FORMAT_DATE)
Assign to the timestamp object the value provided by the input date time string.
ostring GetConsumer() const
Get the current consumer name associated with the dequeuing process.
T GetContent() const
Return the string read from a fetch sequence.
static Date SysDate()
Return the current system date time.
ostring GetExceptionQueue() const
Get the Exception queue name of the message.
OCI_EXPORT boolean OCI_API OCI_TimestampFree(OCI_Timestamp *tmsp)
Free an OCI_Timestamp handle.
OCI_EXPORT unsigned int OCI_API OCI_BindGetSubtype(OCI_Bind *bnd)
Return the OCILIB object subtype of the given bind.
OCI_EXPORT boolean OCI_API OCI_SetUserData(OCI_Connection *con, void *data)
Associate a pointer to user data to the given connection.
unsigned int Write(const T &content)
Write the given content at the current position within the lob.
OCI_EXPORT OCI_Date *OCI_API OCI_DateCreate(OCI_Connection *con)
Create a local date object.
CharsetForm GetCharsetForm() const
Return the charset form of the given column.
OCI_EXPORT OCI_Ref *OCI_API OCI_RefCreate(OCI_Connection *con, OCI_TypeInfo *typinf)
Create a local Ref instance.
OCI_EXPORT OCI_Interval *OCI_API OCI_IntervalCreate(OCI_Connection *con, unsigned int type)
Create a local interval object.
OCI_EXPORT OCI_Connection *OCI_API OCI_LobGetConnection(OCI_Lob *lob)
Retrieve connection handle from the lob handle.
OCI_EXPORT boolean OCI_API OCI_EnqueueSetSequenceDeviation(OCI_Enqueue *enqueue, unsigned int sequence)
Set the enqueuing sequence of messages to put in the queue.
OCI_EXPORT const otext *OCI_API OCI_GetDBName(OCI_Connection *con)
Return the Oracle server database name of the connected database/service name.
void SetDateTime(int year, int month, int day, int hour, int min, int sec, int fsec, const ostring &timeZone=OTEXT(""))
Set the timestamp value from given date time parts.
OCI_EXPORT boolean OCI_API OCI_ElemIsNull(OCI_Elem *elem)
Check if the collection element value is null.
void Stop()
Stop current global transaction.
void SetConversionMode(ConversionMode value)
Set the direct path conversion mode.
Static class in charge of library initialization / cleanup.
OCI_EXPORT boolean OCI_API OCI_RegisterBigInt(OCI_Statement *stmt, const otext *name)
Register a big integer output bind placeholder.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfFloats(OCI_Statement *stmt, const otext *name, float *data, unsigned int nbelem)
Bind an array of floats.
OCI_EXPORT big_uint OCI_API OCI_FileGetOffset(OCI_File *file)
Return the current position in the file.
void SetPrefetchMemory(unsigned int value)
Set the amount of memory pre-fetched by OCI Client.
OCI_EXPORT boolean OCI_API OCI_SetLongMaxSize(OCI_Statement *stmt, unsigned int size)
Set the LONG data type piece buffer size.
OCI_EXPORT OCI_TypeInfo *OCI_API OCI_RefGetTypeInfo(OCI_Ref *ref)
Return the type info object associated to the Ref.
OCI_EXPORT boolean OCI_API OCI_ElemSetLob(OCI_Elem *elem, OCI_Lob *value)
Assign a Lob handle to a collection element.
OCI_EXPORT OCI_File *OCI_API OCI_FileCreate(OCI_Connection *con, unsigned int type)
Create a file object instance.
PropertyFlags GetPropertyFlags() const
Return the column property flags.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfUnsignedInts(OCI_Statement *stmt, const otext *name, unsigned int *data, unsigned int nbelem)
Bind an array of unsigned integers.
void SetMinutes(int value)
Set the timestamp minutes value.
OCI_EXPORT OCI_Transaction *OCI_API OCI_TransactionCreate(OCI_Connection *con, unsigned int timeout, unsigned int mode, OCI_XID *pxid)
Create a new global transaction or a serializable/read-only local transaction.
void SetCorrelation(const ostring &value)
set the correlation identifier of the message to be dequeued
Message Get()
Dequeue messages from the given queue.
void SetDate(int year, int month, int day)
Set the date part.
Reference()
Create an empty null Reference instance.
Class used for handling transient collection value. it is used internally by the Collection<T> class:...
OCI_EXPORT OCI_Coll *OCI_API OCI_GetColl(OCI_Resultset *rs, unsigned int index)
Return the current Collection value of the column at the given index in the resultset.
int GetLeadingPrecision() const
Return the leading precision of the column for Interval columns.
AllocatedBytesValues
Allocated Bytes enumerated values.
void Append(const T &data)
Append the given element value at the end of the collection.
OCI_EXPORT unsigned int OCI_API OCI_ObjectGetUnsignedInt(OCI_Object *obj, const otext *attr)
Return the unsigned integer value of the given object attribute.
static void Create(const Connection &connection, const ostring &queue, const ostring &table, QueueType type=NormalQueue, unsigned int maxRetries=0, unsigned int retryDelay=0, unsigned int retentionTime=0, bool dependencyTracking=false, const ostring &comment=OTEXT(""))
Create a queue.
OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedShort(OCI_Elem *elem, unsigned short value)
Set a unsigned short value to a collection element.
static void Migrate(const Connection &connection, const ostring &table, const ostring &compatible=OTEXT(""))
Migrate a queue table from one version to another.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetCollationID(OCI_Column *col)
Return the column collation ID.
bool operator>=(const Interval &other) const
Indicates if the current Interval value is superior or equal to the given Interval value...
unsigned int GetCurrentRows() const
Return the current number of rows used in the OCILIB internal arrays of rows.
OCI_EXPORT boolean OCI_API OCI_SetPassword(OCI_Connection *con, const otext *password)
Change the password of the logged user.
struct OCI_Ref OCI_Ref
Oracle REF type representation.
unsigned int GetErrorColumn()
Return the index of a column which caused an error during data conversion.
void GetDate(int &year, int &month, int &day) const
Extract the date parts.
void SetRelativeMsgID(const Raw &value)
Set the message identifier of the message to be dequeued.
ChangeTypesValues
Subscription changes flags values.
void SetAgents(std::vector< Agent > &agents)
Set the Agent list to listen to message for.
OCI_EXPORT int OCI_API OCI_TimestampCheck(OCI_Timestamp *tmsp)
Check if the given timestamp is valid.
void(* NotifyHandlerProc)(Event &evt)
User callback for subscriptions event notifications.
void SetTransaction(const Transaction &transaction)
Set a transaction to a connection.
OCI_EXPORT big_uint OCI_API OCI_GetUnsignedBigInt(OCI_Resultset *rs, unsigned int index)
Return the current unsigned big integer value of the column at the given index in the resultset...
int GetPrecision() const
Return the precision of the column for numeric columns.
OCI_EXPORT boolean OCI_API OCI_TransactionForget(OCI_Transaction *trans)
Cancel the prepared global transaction validation.
OCI_EXPORT unsigned int OCI_API OCI_GetRaw2(OCI_Resultset *rs, const otext *name, void *buffer, unsigned int len)
Copy the current raw value of the column from its name into the specified buffer. ...
unsigned int GetLength() const
Return the buffer length.
OCI_EXPORT boolean OCI_API OCI_IntervalToText(OCI_Interval *itv, int leading_prec, int fraction_prec, int size, otext *str)
Convert an interval value from the given interval handle to a string.
void SetCorrelation(const ostring &value)
Set the correlation identifier of the message.
OCI_EXPORT boolean OCI_API OCI_EnableWarnings(boolean value)
Enable or disable Oracle warning notifications.
OCI_EXPORT boolean OCI_API OCI_RegisterInt(OCI_Statement *stmt, const otext *name)
Register an integer output bind placeholder.
OCI_EXPORT OCI_Resultset *OCI_API OCI_GetResultset(OCI_Statement *stmt)
Retrieve the resultset handle from an executed statement.
unsigned int ForEach(T callback)
Fetch all rows in the resultset and call the given callback for row.
CollectionType GetType() const
Return the type of the collection.
void * AnyPointer
Alias for the generic void pointer.
OCI_EXPORT unsigned int OCI_API OCI_GetBindIndex(OCI_Statement *stmt, const otext *name)
Return the index of the bind from its name belonging to the given statement.
OCI_EXPORT boolean OCI_API OCI_TransactionFree(OCI_Transaction *trans)
Free current transaction.
const char * what() const override
Override the std::exception::what() method.
ExceptionType GetType() const
Return the Exception type.
OCI_EXPORT boolean OCI_API OCI_ObjectSetUnsignedBigInt(OCI_Object *obj, const otext *attr, big_uint value)
Set an object attribute of type unsigned big int.
unsigned int GetAffectedRows() const
return the number of rows successfully processed during in the last conversion or loading call ...
OCI_EXPORT void *OCI_API OCI_GetUserData(OCI_Connection *con)
Return the pointer to user data previously associated with the connection.
Raw GetRelativeMsgID() const
Get the current associated message identifier used for enqueuing messages using a sequence deviation...
void Subscribe(unsigned int port, unsigned int timeout, NotifyAQHandlerProc handler)
Subscribe for asynchronous messages notifications.
Connection GetConnection() const
Return the connection within the error occurred.
static void Cleanup()
Clean up all resources allocated by the environment.
void SetMilliSeconds(int value)
Set the interval milliseconds value.
OCI_EXPORT unsigned int OCI_API OCI_DequeueGetMode(OCI_Dequeue *dequeue)
Get the dequeuing/locking behavior.
OCI_EXPORT unsigned short OCI_API OCI_GetUnsignedShort(OCI_Resultset *rs, unsigned int index)
Return the current unsigned short value of the column at the given index in the resultset.
OCI_EXPORT boolean OCI_API OCI_FetchFirst(OCI_Resultset *rs)
Fetch the first row of the resultset.
void Clear()
Clear all items of the collection.
bool IsServerAlive() const
Indicate if the connection is still connected to the server.
Interval operator+(const Interval &other) const
Return a new Interval holding the sum of the current Interval value and the given Interval value...
OCI_EXPORT boolean OCI_API OCI_DateSetTime(OCI_Date *date, int hour, int min, int sec)
Set the time portion if the given date handle.
OCI_EXPORT OCI_Timestamp *OCI_API OCI_GetTimestamp2(OCI_Resultset *rs, const otext *name)
Return the current timestamp value of the column from its name in the resultset.
void SetBindArraySize(unsigned int size)
Set the input array size for bulk operations.
Interval & operator+=(const Interval &other)
Increment the current Value with the given Interval value.
static void Run(ThreadHandle handle, ThreadProc func, void *args)
Execute the given routine within the given thread.
OCI_EXPORT unsigned int OCI_API OCI_SubscriptionGetPort(OCI_Subscription *sub)
Return the port used by the notification.
OCI_EXPORT unsigned int OCI_API OCI_RefGetHexSize(OCI_Ref *ref)
Returns the size of the hex representation of the given Ref handle.
unsigned int GetSize() const
Returns the total number of elements in the collection.
OCI_EXPORT const otext *OCI_API OCI_AgentGetAddress(OCI_Agent *agent)
Get the given AQ agent address.
unsigned int GetFetchSize() const
Return the number of rows fetched per internal server fetch call.
OCI_EXPORT unsigned int OCI_API OCI_GetOCICompileVersion(void)
Return the version of OCI used for compilation.
OCI_EXPORT boolean OCI_API OCI_NumberSub(OCI_Number *number, unsigned int type, void *value)
Subtract the value of a native C numeric type to the given number.
OCI_EXPORT boolean OCI_API OCI_DatabaseStartup(const otext *db, const otext *user, const otext *pwd, unsigned int sess_mode, unsigned int start_mode, unsigned int start_flag, const otext *spfile)
Start a database instance.
OCI_EXPORT float OCI_API OCI_ObjectGetFloat(OCI_Object *obj, const otext *attr)
Return the float value of the given object attribute.
void Prepare()
Prepare a global transaction validation.
OCI_EXPORT int OCI_API OCI_ColumnGetLeadingPrecision(OCI_Column *col)
Return the leading precision of the column for interval columns.
void SetMode(EnqueueMode value)
Set the enqueuing mode of messages to put in the queue.
OCI_EXPORT unsigned int OCI_API OCI_GetServerMinorVersion(OCI_Connection *con)
Return the minor version number of the connected database server.
OCI_EXPORT boolean OCI_API OCI_DirPathReset(OCI_DirPath *dp)
Reset internal arrays and streams to prepare another load.
OCI_EXPORT OCI_Interval *OCI_API OCI_ElemGetInterval(OCI_Elem *elem)
Return the Interval value of the given collection element.
OCI_EXPORT boolean OCI_API OCI_MsgSetObject(OCI_Msg *msg, OCI_Object *obj)
Set the object payload of the given message.
OCI_EXPORT unsigned int OCI_API OCI_CollGetMax(OCI_Coll *coll)
Returns the maximum number of elements of the given collection.
OCI_EXPORT const otext *OCI_API OCI_DequeueGetCorrelation(OCI_Dequeue *dequeue)
Get the correlation identifier of the message to be dequeued.
OCI_EXPORT int OCI_API OCI_NumberCompare(OCI_Number *number1, OCI_Number *number2)
Compares two number handles.
Object identifying the SQL data types VARRAY and NESTED TABLE.
void SetPriority(int value)
Set the priority of the message.
OCI_EXPORT unsigned int OCI_API OCI_ElemGetRaw(OCI_Elem *elem, void *value, unsigned int len)
Read the RAW value of the collection element into the given buffer.
ostring ToString() const override
Convert the date value to a string using default format OCI_STRING_FORMAT_DATE.
bool IsAttributeNull(const ostring &name) const
Check if an object attribute is null.
Timestamp & operator--()
Decrement the Timestamp by 1 day.
OCI_EXPORT OCI_Statement *OCI_API OCI_GetStatement2(OCI_Resultset *rs, const otext *name)
Return the current cursor value of the column from its name in the resultset.
int GetScale() const
Return the scale of the column for numeric columns.
OCI_EXPORT boolean OCI_API OCI_FileFree(OCI_File *file)
Free a local File object.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetPropertyFlags(OCI_Column *col)
Return the column property flags.
void SetNoWait(bool value)
Set the waiting mode used when no more connections/sessions are available from the pool...
OCI_EXPORT boolean OCI_API OCI_LobOpen(OCI_Lob *lob, unsigned int mode)
Open explicitly a Lob.
void SetMonth(int value)
Set the date month value.
struct OCI_Date OCI_Date
Oracle internal date representation.
OCI_EXPORT big_int OCI_API OCI_GetBigInt(OCI_Resultset *rs, unsigned int index)
Return the current big integer value of the column at the given index in the resultset.
Lob Clone() const
Clone the current instance to a new one performing deep copy.
bool operator<=(const Timestamp &other) const
Indicates if the current Timestamp value is inferior or equal to the given Timestamp value...
unsigned int GetMaxSize() const
Return the maximum number of connections/sessions that can be opened to the database.
OracleVersion GetVersion() const
Return the Oracle version supported by the connection.
unsigned int GetStatementCacheSize() const
Return the maximum number of statements to keep in the pool's statement cache.
OCI_EXPORT unsigned int OCI_API OCI_DequeueGetNavigation(OCI_Dequeue *dequeue)
Return the navigation position of messages to retrieve from the queue.
OCI_EXPORT OCI_Number *OCI_API OCI_ElemGetNumber(OCI_Elem *elem)
Return the number value of the given collection element.
OCI_EXPORT boolean OCI_API OCI_PoolGetNoWait(OCI_Pool *pool)
Get the waiting mode used when no more connections/sessions are available from the pool...
OCI_EXPORT unsigned int OCI_API OCI_DirPathConvert(OCI_DirPath *dp)
Convert provided user data to the direct path stream format.
OCI_EXPORT boolean OCI_API OCI_DateSetDate(OCI_Date *date, int year, int month, int day)
Set the date portion if the given date handle.
OCI_EXPORT int OCI_API OCI_DateDaysBetween(OCI_Date *date, OCI_Date *date2)
Return the number of days betWeen two dates.
void SetTimeZone(const ostring &timeZone)
Set the given time zone to the timestamp.
Collection Clone() const
Clone the current instance to a new one performing deep copy.
OCI_EXPORT unsigned int OCI_API OCI_GetVersionConnection(OCI_Connection *con)
Return the highest Oracle version is supported by the connection.
OCI_EXPORT unsigned int OCI_API OCI_BindGetDataSizeAtPos(OCI_Bind *bnd, unsigned int position)
Return the actual size of the element at the given position in the bind input array.
ostring GetTimeZone() const
Return the name of the current time zone.
OCI_EXPORT boolean OCI_API OCI_IsTAFCapable(OCI_Connection *con)
Verify if the given connection support TAF events.
static bool Initialized()
Return true if the environment has been successfully initialized.
OCI_EXPORT const void *OCI_API OCI_HandleGetEnvironment(void)
Return the OCI Environment Handle (OCIEnv *) of OCILIB library.
int GetInternalErrorCode() const
Return the OCILIB error code.
OCI_EXPORT int OCI_API OCI_MsgGetExpiration(OCI_Msg *msg)
Return the duration that the message is available for dequeuing.
int GetMilliSeconds() const
Return the interval seconds value.
static void Destroy(MutexHandle handle)
Destroy a mutex handle.
OCI_EXPORT boolean OCI_API OCI_BindDate(OCI_Statement *stmt, const otext *name, OCI_Date *data)
Bind a date variable.
unsigned int GetCount() const
Retrieve the number of rows fetched so far.
static OracleVersion GetRuntimeVersion()
Return the version of OCI used at runtime.
OCI_EXPORT boolean OCI_API OCI_CollFree(OCI_Coll *coll)
Free a local collection.
void AllowRebinding(bool value)
Allow different host variables to be binded using the same bind name or position between executions o...
OCI_EXPORT boolean OCI_API OCI_DateSysDate(OCI_Date *date)
Return the current system date/time into the date handle.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfRaws(OCI_Statement *stmt, const otext *name, void *data, unsigned int len, unsigned int nbelem)
Bind an array of raw buffers.
OCI_EXPORT OCI_Object *OCI_API OCI_RefGetObject(OCI_Ref *ref)
Returns the object pointed by the Ref handle.
void GetBatchErrors(std::vector< Exception > &exceptions)
Returns all errors that occurred within a DML array statement execution.
OCI_EXPORT OCI_Coll *OCI_API OCI_ElemGetColl(OCI_Elem *elem)
Return the collection value of the given collection element.
void Resume()
Resume a stopped global transaction.
struct OCI_Transaction OCI_Transaction
Oracle Transaction.
void SetSeconds(int value)
Set the timestamp seconds value.
OCI_EXPORT unsigned int OCI_API OCI_CollGetCount(OCI_Coll *coll)
Returns the current number of elements of the given collection.
unsigned int GetPrefetchMemory() const
Return the amount of memory used to retrieve rows pre-fetched by OCI Client.
OCI_EXPORT OCI_Elem *OCI_API OCI_CollGetElem(OCI_Coll *coll, unsigned int index)
Return the element at the given position in the collection.
OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedInt(OCI_Elem *elem, unsigned int value)
Set a unsigned int value to a collection element.
OCI_EXPORT unsigned short OCI_API OCI_ObjectGetUnsignedShort(OCI_Object *obj, const otext *attr)
Return the unsigned short value of the given object attribute.
int GetSeconds() const
Return the date seconds value.
OCI_EXPORT const otext *OCI_API OCI_GetInstanceName(OCI_Connection *con)
Return the Oracle server Instance name of the connected database/service name.
OCI_EXPORT unsigned int OCI_API OCI_GetFetchMode(OCI_Statement *stmt)
Return the fetch mode of a SQL statement.
File Clone() const
Clone the current instance to a new one performing deep copy.
OCI_EXPORT boolean OCI_API OCI_SubscriptionAddStatement(OCI_Subscription *sub, OCI_Statement *stmt)
Add a statement to the notification to monitor.
OCI_EXPORT boolean OCI_API OCI_LobTruncate(OCI_Lob *lob, big_uint size)
Truncate the given lob to a shorter length.
ostring GetName() const
Return the Column name.
void SetAddress(const ostring &value)
Set the given AQ agent address.
OCI_EXPORT void *OCI_API OCI_ThreadKeyGetValue(const otext *name)
Get a thread key value.
POCI_THREADKEYDEST ThreadKeyFreeProc
Thread Key callback for freeing resources.
void SetDay(int value)
Set the timestamp day value.
unsigned int GetBindCount() const
Return the number of binds currently associated to a statement.
Message(const TypeInfo &typeInfo)
Create a message object based on the given payload type.
OCI_EXPORT boolean OCI_API OCI_LobClose(OCI_Lob *lob)
Close explicitly a Lob.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfDates(OCI_Statement *stmt, const otext *name, OCI_Date **data, unsigned int nbelem)
Bind an array of dates.
bool Prev()
Fetch the previous row of the resultset.
OCI_EXPORT OCI_Interval *OCI_API OCI_GetInterval2(OCI_Resultset *rs, const otext *name)
Return the current interval value of the column from its name in the resultset.
void SetTimeout(unsigned int value)
Set the connections/sessions idle timeout.
OCI_EXPORT boolean OCI_API OCI_CollSetElem(OCI_Coll *coll, unsigned int index, OCI_Elem *elem)
Assign the given element value to the element at the given position in the collection.
void SetMode(DequeueMode value)
Set the dequeuing/locking behavior.
LobType GetType() const
return the type of lob
OCI_EXPORT boolean OCI_API OCI_DirPathAbort(OCI_DirPath *dp)
Terminate a direct path operation without committing changes.
OCI_EXPORT boolean OCI_API OCI_CollAppend(OCI_Coll *coll, OCI_Elem *elem)
Append the given element at the end of the collection.
OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedBigInt(OCI_Elem *elem, big_uint value)
Set a unsigned big_int value to a collection element.
OCI_EXPORT boolean OCI_API OCI_BindLob(OCI_Statement *stmt, const otext *name, OCI_Lob *data)
Bind a Lob variable.
Connection GetConnection() const
Return the file parent connection.
OCI_EXPORT boolean OCI_API OCI_RegisterDouble(OCI_Statement *stmt, const otext *name)
Register a double output bind placeholder.
OCI_EXPORT unsigned int OCI_API OCI_GetColumnCount(OCI_Resultset *rs)
Return the number of columns in the resultset.
OCI_EXPORT unsigned int OCI_API OCI_DirPathGetErrorColumn(OCI_DirPath *dp)
Return the index of a column which caused an error during data conversion.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetCharsetForm(OCI_Column *col)
Return the charset form of the given column.
void(* POCI_NOTIFY)(OCI_Event *event)
Database Change Notification User callback prototype.
static void Start(const Connection &connection, const ostring &queue, bool enableEnqueue=true, bool enableDequeue=true)
Start the given queue.
ostring ToString() const override
Convert the number value to a string using default format OCI_STRING_FORMAT_NUMERIC.
OCI_EXPORT boolean OCI_API OCI_AllowRebinding(OCI_Statement *stmt, boolean value)
Allow different host variables to be binded using the same bind name or position between executions o...
OCI_EXPORT boolean OCI_API OCI_Describe(OCI_Statement *stmt, const otext *sql)
Describe the select list of a SQL select statement.
OCI_EXPORT const otext *OCI_API OCI_BindGetName(OCI_Bind *bnd)
Return the name of the given bind.
void UpdateTimeZone(const ostring &timeZone)
Update the interval value with the given time zone.
OCI_EXPORT boolean OCI_API OCI_ServerEnableOutput(OCI_Connection *con, unsigned int bufsize, unsigned int arrsize, unsigned int lnsize)
Enable the server output.
bool operator!=(const Date &other) const
Indicates if the current date value is not equal the given date value.
OCI_EXPORT unsigned int OCI_API OCI_LobAppend(OCI_Lob *lob, void *buffer, unsigned int len)
Append a buffer at the end of a LOB.
OCI_EXPORT unsigned int OCI_API OCI_GetMaxCursors(OCI_Connection *con)
Return the maximum number of SQL statements that can be opened in one session.
OCI_EXPORT boolean OCI_API OCI_LobCopy(OCI_Lob *lob, OCI_Lob *lob_src, big_uint offset_dst, big_uint offset_src, big_uint count)
Copy a portion of a source LOB into a destination LOB.
OCI_EXPORT boolean OCI_API OCI_MsgSetSender(OCI_Msg *msg, OCI_Agent *sender)
Set the original sender of a message.
OCI_EXPORT const otext *OCI_API OCI_GetSQLVerb(OCI_Statement *stmt)
Return the verb of the SQL command held by the statement handle.
int GetMinutes() const
Return the interval minutes value.
OCI_EXPORT const otext *OCI_API OCI_ErrorGetString(OCI_Error *err)
Retrieve error message from error handle.
void SetInfos(const ostring &directory, const ostring &name)
Set the directory and file name of our file object.
struct OCI_Resultset OCI_Resultset
Collection of output columns from a select statement.
OCI_EXPORT const otext *OCI_API OCI_GetDomainName(OCI_Connection *con)
Return the Oracle server domain name of the connected database/service name.
OCI_EXPORT boolean OCI_API OCI_ObjectIsNull(OCI_Object *obj, const otext *attr)
Check if an object attribute is null.
OCI_EXPORT int OCI_API OCI_DequeueGetWaitTime(OCI_Dequeue *dequeue)
Return the time that OCIDequeueGet() waits for messages if no messages are currently available...
OCI_EXPORT boolean OCI_API OCI_Execute(OCI_Statement *stmt)
Execute a prepared SQL statement or PL/SQL block.
DataType GetType() const
Return the OCILIB type of the data associated with the bind object.
void SetStatementCacheSize(unsigned int value)
Set the maximum number of statements to keep in the statement cache.
unsigned int GetMaxCursors() const
Return the maximum number of SQL statements that can be opened in one session.
OCI_EXPORT boolean OCI_API OCI_ObjectFree(OCI_Object *obj)
Free a local object.
OCI_EXPORT boolean OCI_API OCI_ElemSetFile(OCI_Elem *elem, OCI_File *value)
Assign a File handle to a collection element.
Allow resolving a the C API numeric enumerated type from a C++ type.
FetchMode GetFetchMode() const
Return the fetch mode of a SQL statement.
SessionFlagsValues
Session flags enumerated values.
TransactionFlagsValues
Transaction flags enumerated values.
OCI_EXPORT OCI_Error *OCI_API OCI_GetLastError(void)
Retrieve the last error or warning occurred within the last OCILIB call.
OCI_EXPORT boolean OCI_API OCI_TransactionPrepare(OCI_Transaction *trans)
Prepare a global transaction validation.
OCI_EXPORT const otext *OCI_API OCI_FileGetDirectory(OCI_File *file)
Return the directory of the given file.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfInts(OCI_Statement *stmt, const otext *name, int *data, unsigned int nbelem)
Bind an array of integers.
void AddDays(int days)
Add or subtract days.
unsigned int GetIncrement() const
Return the increment for connections/sessions to be opened to the database when the pool is not full...
void GetDate(int &year, int &month, int &day) const
Extract the date parts.
OCI_EXPORT unsigned int OCI_API OCI_DirPathGetAffectedRows(OCI_DirPath *dp)
return the number of rows successfully processed during in the last conversion or loading call ...
OCI_EXPORT OCI_Date *OCI_API OCI_MsgGetEnqueueTime(OCI_Msg *msg)
return the time the message was enqueued
ostring GetName() const
Get the given AQ agent name.
T Get(unsigned int index) const
Return the collection element value at the given position.
OCI_EXPORT boolean OCI_API OCI_BindBoolean(OCI_Statement *stmt, const otext *name, boolean *data)
Bind a boolean variable (PL/SQL ONLY)
static void Destroy(ThreadHandle handle)
Destroy a thread.
OCI_EXPORT int OCI_API OCI_GetInt(OCI_Resultset *rs, unsigned int index)
Return the current integer value of the column at the given index in the resultset.
BindInfo GetBind(unsigned int index) const
Return the bind at the given index in the internal array of bind objects.
bool operator>=(const Date &other) const
Indicates if the current date value is superior or equal to the given date value. ...
void SetTime(int hour, int min, int sec)
Set the time part.
OCI_EXPORT unsigned int OCI_API OCI_GetCurrentRow(OCI_Resultset *rs)
Retrieve the current row number.
OCI_EXPORT OCI_Connection *OCI_API OCI_SubscriptionGetConnection(OCI_Subscription *sub)
Return the connection handle associated with a subscription handle.
OCI_EXPORT boolean OCI_API OCI_ObjectSetUnsignedInt(OCI_Object *obj, const otext *attr, unsigned int value)
Set an object attribute of type unsigned int.
OCI_EXPORT float OCI_API OCI_GetFloat2(OCI_Resultset *rs, const otext *name)
Return the current float value of the column from its name in the resultset.
void GetYearMonth(int &year, int &month) const
Extract the year / month parts from the interval value.
OCI_EXPORT big_int OCI_API OCI_GetBigInt2(OCI_Resultset *rs, const otext *name)
Return the current big integer value of the column from its name in the resultset.
unsigned int GetTimeout() const
Return the timeout of the given registered subscription.
unsigned int GetStatementCacheSize() const
Return the maximum number of statements to keep in the statement cache.
Long< ostring, LongCharacter > Clong
Class handling LONG oracle type.
OCI_EXPORT boolean OCI_API OCI_DirPathSetCurrentRows(OCI_DirPath *dp, unsigned int nb_rows)
Set the current number of rows to convert and load.
void Start()
Start global transaction.
OCI_EXPORT boolean OCI_API OCI_MsgGetRaw(OCI_Msg *msg, void *raw, unsigned int *size)
Get the RAW payload of the given message.
TransactionFlags GetFlags() const
Return the transaction mode.
Raw Read(unsigned int size)
Read a portion of a file.
OCI_EXPORT boolean OCI_API OCI_MutexRelease(OCI_Mutex *mutex)
Release a mutex lock.
void SetMilliSeconds(int value)
Set the timestamp milliseconds value.
OCI_EXPORT boolean OCI_API OCI_TimestampConstruct(OCI_Timestamp *tmsp, int year, int month, int day, int hour, int min, int sec, int fsec, const otext *time_zone)
Set a timestamp handle value.
OCI_EXPORT boolean OCI_API OCI_TimestampSubtract(OCI_Timestamp *tmsp, OCI_Timestamp *tmsp2, OCI_Interval *itv)
Store the difference of two timestamp handles into an interval handle.
void SetVisibility(DequeueVisibility value)
Set whether the new message is dequeued as part of the current transaction.
static AnyPointer GetValue(const ostring &name)
Get a thread key value.
OCI_EXPORT int OCI_API OCI_MsgGetPriority(OCI_Msg *msg)
Return the priority of the message.
void DisableServerOutput()
Disable the server output.
OCI_EXPORT boolean OCI_API OCI_DateZoneToZone(OCI_Date *date, const otext *zone1, const otext *zone2)
Convert a date from one zone to another zone.
bool operator==(const Timestamp &other) const
Indicates if the current Timestamp value is equal to the given Timestamp value.
OCI_EXPORT unsigned int OCI_API OCI_CollGetSize(OCI_Coll *coll)
Returns the total number of elements of the given collection.
unsigned int GetBindArraySize() const
Return the current input array size for bulk operations.
OCI_EXPORT const void *OCI_API OCI_HandleGetThreadID(OCI_Thread *thread)
Return OCI Thread ID (OCIThreadId *) of an OCILIB OCI_Thread object.
Simplified resolver for handle types.
MessageState GetState() const
Return the state of the message at the time of the dequeue.
OCI_EXPORT boolean OCI_API OCI_MsgFree(OCI_Msg *msg)
Free a message object.
void GetDaySecond(int &day, int &hour, int &min, int &sec, int &fsec) const
Extract the date / second parts from the interval value.
void SetColumn(unsigned int colIndex, const ostring &name, unsigned int maxSize, const ostring &format=OTEXT(""))
Describe a column to load into the given table.
OCI_EXPORT boolean OCI_API OCI_RegisterUnsignedInt(OCI_Statement *stmt, const otext *name)
Register an unsigned integer output bind placeholder.
static void Substract(const Timestamp &lsh, const Timestamp &rsh, Interval &result)
Subtract the given two timestamp and store the result into the given Interval.
OCI_EXPORT boolean OCI_API OCI_EnqueueSetVisibility(OCI_Enqueue *enqueue, unsigned int visibility)
Set whether the new message is enqueued as part of the current transaction.
OCI_EXPORT unsigned int OCI_API OCI_PoolGetBusyCount(OCI_Pool *pool)
Return the current number of busy connections/sessions.
OCI_EXPORT OCI_Connection *OCI_API OCI_ConnectionCreate(const otext *db, const otext *user, const otext *pwd, unsigned int mode)
Create a physical connection to an Oracle database server.
IntervalType GetType() const
Return the type of the given interval object.
OCI_EXPORT double OCI_API OCI_GetDouble(OCI_Resultset *rs, unsigned int index)
Return the current double value of the column at the given index in the resultset.
OCI_EXPORT boolean OCI_API OCI_CollAssign(OCI_Coll *coll, OCI_Coll *coll_src)
Assign a collection to another one.
unsigned int GetTimeout(TimeoutType timeout)
Returns the requested timeout value for OCI calls that require server round-trips to the given databa...
unsigned int GetSqlErrorPos() const
Return the error position (in terms of characters) in the SQL statement where the error occurred in c...
OCI_EXPORT unsigned int OCI_API OCI_SubscriptionGetTimeout(OCI_Subscription *sub)
Return the timeout of the given registered subscription.
ostring GetSqlIdentifier() const
Return the server SQL_ID of the last SQL or PL/SQL statement prepared or executed by the statement...
OCI_EXPORT OCI_Agent *OCI_API OCI_MsgGetSender(OCI_Msg *msg)
Return the original sender of a message.
static OracleVersion GetCompileVersion()
Return the version of OCI used for compiling OCILIB.
void Finish()
Terminate a direct path operation and commit changes into the database.
OCI_EXPORT boolean OCI_API OCI_SetHAHandler(POCI_HA_HANDLER handler)
Set the High availability (HA) user handler.
DirectPath::Result Convert()
Convert provided user data to the direct path stream format.
Interval & operator-=(const Interval &other)
Decrement the current Value with the given Interval value.
OCI_EXPORT boolean OCI_API OCI_DateToText(OCI_Date *date, const otext *fmt, int size, otext *str)
Convert a Date value from the given date handle to a string.
OCI_EXPORT short OCI_API OCI_ElemGetShort(OCI_Elem *elem)
Return the short value of the given collection element.
Enqueue(const TypeInfo &typeInfo, const ostring &queueName)
Create a Enqueue object for the given queue.
Dequeue(const TypeInfo &typeInfo, const ostring &queueName)
Parametrized constructor.
static void SetValue(const ostring &name, AnyPointer value)
Set a thread key value.
OCI_EXPORT const otext *OCI_API OCI_EventGetDatabase(OCI_Event *event)
Return the name of the database that generated the event.
OCI_EXPORT boolean OCI_API OCI_RegisterObject(OCI_Statement *stmt, const otext *name, OCI_TypeInfo *typinf)
Register an object output bind placeholder.
OCI_EXPORT boolean OCI_API OCI_ObjectSetBigInt(OCI_Object *obj, const otext *attr, big_int value)
Set an object attribute of type big int.
Connection GetConnection() const
Return the connection associated with a statement.
struct OCI_File OCI_File
Oracle External Large objects:
OCI_EXPORT OCI_Lob *OCI_API OCI_LobCreate(OCI_Connection *con, unsigned int type)
Create a local temporary Lob instance.
static MutexHandle Create()
Create a Mutex handle.
ostring ToString() const override
Convert the timestamp value to a string using default date format and no precision.
OCI_EXPORT const otext *OCI_API OCI_GetDatabase(OCI_Connection *con)
Return the name of the connected database/service name.
OCI_EXPORT boolean OCI_API OCI_IntervalAdd(OCI_Interval *itv, OCI_Interval *itv2)
Adds an interval handle value to another.
bool operator==(const Date &other) const
Indicates if the current date value is equal to the given date value.
OCI_EXPORT boolean OCI_API OCI_BindTimestamp(OCI_Statement *stmt, const otext *name, OCI_Timestamp *data)
Bind a timestamp variable.
OCI_EXPORT boolean OCI_API OCI_SetTrace(OCI_Connection *con, unsigned int trace, const otext *value)
Set tracing information to the session of the given connection.
void GetTime(int &hour, int &min, int &sec) const
Extract time parts.
OCI_EXPORT boolean OCI_API OCI_ObjectSetDate(OCI_Object *obj, const otext *attr, OCI_Date *value)
Set an object attribute of type Date.
bool operator<(const Interval &other) const
Indicates if the current Interval value is inferior to the given Interval value.
void SetDataNull(bool value, unsigned int index=1)
Mark as null or not null the current bind real value(s) used in SQL statements.
unsigned int GetDataCount() const
Return the number of elements associated with the bind object.
void Prepare()
Prepares the OCI direct path load interface before any rows can be converted or loaded.
void GetDateTime(int &year, int &month, int &day, int &hour, int &min, int &sec) const
Extract the date and time parts.
OCI_EXPORT boolean OCI_API OCI_FetchNext(OCI_Resultset *rs)
Fetch the next row of the resultset.
CollationID GetCollationID() const
Return the collation ID of the given column.
OCI_EXPORT float OCI_API OCI_GetFloat(OCI_Resultset *rs, unsigned int index)
Return the current float value of the column at the given index in the resultset. ...
OCI_EXPORT const otext *OCI_API OCI_GetFormat(OCI_Connection *con, unsigned int type)
Return the format string for implicit string conversions of the given type.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfFiles(OCI_Statement *stmt, const otext *name, OCI_File **data, unsigned int type, unsigned int nbelem)
Bind an array of File handles.
OCI_EXPORT boolean OCI_API OCI_MsgSetRaw(OCI_Msg *msg, const void *raw, unsigned int size)
Set the RAW payload of the given message.
OCI_EXPORT boolean OCI_API OCI_MsgSetConsumers(OCI_Msg *msg, OCI_Agent **consumers, unsigned int count)
Set the recipient list of a message to enqueue.
Date & operator--()
Decrement the date by 1 day.
OCI_EXPORT boolean OCI_API OCI_RegisterNumber(OCI_Statement *stmt, const otext *name)
Register a register output bind placeholder.
OCI_EXPORT boolean OCI_API OCI_QueueTableMigrate(OCI_Connection *con, const otext *queue_table, const otext *compatible)
Migrate a queue table from one version to another.
OCI_EXPORT boolean OCI_API OCI_ObjectSetTimestamp(OCI_Object *obj, const otext *attr, OCI_Timestamp *value)
Set an object attribute of type Timestamp.
static unsigned int GetRuntimeRevisionVersion()
Return the revision version number of OCI used at runtime.
OCI_EXPORT boolean OCI_API OCI_RegisterLob(OCI_Statement *stmt, const otext *name, unsigned int type)
Register a lob output bind placeholder.
OCI_EXPORT boolean OCI_API OCI_ThreadFree(OCI_Thread *thread)
Destroy a thread object.
static void Drop(const Connection &connection, const ostring &table, bool force=true)
Drop the given queue table.
DequeueMode GetMode() const
Get the dequeuing/locking behavior.
OCI_EXPORT boolean OCI_API OCI_TimestampIntervalAdd(OCI_Timestamp *tmsp, OCI_Interval *itv)
Add an interval value to a timestamp value of a timestamp handle.
OCI_EXPORT OCI_Date *OCI_API OCI_ObjectGetDate(OCI_Object *obj, const otext *attr)
Return the date value of the given object attribute.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfStrings(OCI_Statement *stmt, const otext *name, otext *data, unsigned int len, unsigned int nbelem)
Bind an array of strings.
OCI_EXPORT boolean OCI_API OCI_ObjectGetSelfRef(OCI_Object *obj, OCI_Ref *ref)
Retrieve an Oracle Ref handle from an object and assign it to the given OCILIB OCI_Ref handle...
bool IsTAFCapable() const
Verify if the connection support TAF events.
unsigned int Write(const T &content)
Write the given string into the long Object.
void SetOriginalID(const Raw &value)
Set the original ID of the message in the last queue that generated this message. ...
big_uint GetLength() const
Returns the number of characters or bytes contained in the lob.
OCI_EXPORT boolean OCI_API OCI_PoolFree(OCI_Pool *pool)
Destroy a pool object.
ostring GetCorrelation() const
Get the correlation identifier of the message.
OCI_EXPORT boolean OCI_API OCI_ElemSetNumber(OCI_Elem *elem, OCI_Number *value)
Set a number value to a collection element.
OCI_EXPORT OCI_Coll *OCI_API OCI_CollCreate(OCI_TypeInfo *typinf)
Create a local collection instance.
bool IsRebindingAllowed() const
Indicate if rebinding is allowed on the statement.
OCI_EXPORT unsigned int OCI_API OCI_GetFetchSize(OCI_Statement *stmt)
Return the number of rows fetched per internal server fetch call.
Connection GetConnection() const
Return the connection associated with a subscription handle.
void SetMonth(int value)
Set the timestamp month value.
OCI_EXPORT boolean OCI_API OCI_ColumnGetNullable(OCI_Column *col)
Return the nullable attribute of the column.
OCI_EXPORT const otext *OCI_API OCI_FileGetName(OCI_File *file)
Return the name of the given file.
OCI_EXPORT unsigned int OCI_API OCI_GetStatementType(OCI_Statement *stmt)
Return the type of a SQL statement.
OCI_EXPORT boolean OCI_API OCI_QueueCreate(OCI_Connection *con, const otext *queue_name, const otext *queue_table, unsigned int queue_type, unsigned int max_retries, unsigned int retry_delay, unsigned int retention_time, boolean dependency_tracking, const otext *comment)
Create a queue.
OCI_EXPORT unsigned int OCI_API OCI_GetRaw(OCI_Resultset *rs, unsigned int index, void *buffer, unsigned int len)
Copy the current raw value of the column at the given index into the specified buffer.
OCI_EXPORT boolean OCI_API OCI_FileSeek(OCI_File *file, big_uint offset, unsigned int mode)
Perform a seek operation on the OCI_File content buffer.
bool operator+=(int offset)
Convenient operator overloading that performs a call to Seek() with Resultset::SeekRelative and the g...
OCI_EXPORT boolean OCI_API OCI_SetAutoCommit(OCI_Connection *con, boolean enable)
Enable / disable auto commit mode.
OCI_EXPORT boolean OCI_API OCI_LobIsTemporary(OCI_Lob *lob)
Check if the given lob is a temporary lob.
OCI_EXPORT boolean OCI_API OCI_DirPathSetColumn(OCI_DirPath *dp, unsigned int index, const otext *name, unsigned int maxsize, const otext *format)
Describe a column to load into the given table.
OCI_EXPORT boolean OCI_API OCI_NumberSetValue(OCI_Number *number, unsigned int type, void *value)
Assign the number value with the value of a native C numeric type.
OCI_EXPORT boolean OCI_API OCI_DirPathSetNoLog(OCI_DirPath *dp, boolean value)
Set the logging mode for the loading operation.
OCI_EXPORT boolean OCI_API OCI_IsConnected(OCI_Connection *con)
Returns TRUE is the given connection is still connected otherwise FALSE.
static void SetHAHandler(HAHandlerProc handler)
Set the High availability (HA) user handler.
static unsigned int GetCharMaxSize()
Return maximum size for a character.
OCI_EXPORT boolean OCI_API OCI_QueueTableCreate(OCI_Connection *con, const otext *queue_table, const otext *queue_payload_type, const otext *storage_clause, const otext *sort_list, boolean multiple_consumers, unsigned int message_grouping, const otext *comment, unsigned int primary_instance, unsigned int secondary_instance, const otext *compatible)
Create a queue table for messages of the given type.
OCI_EXPORT OCI_Bind *OCI_API OCI_GetBind2(OCI_Statement *stmt, const otext *name)
Return a bind handle from its name.
OCI_EXPORT boolean OCI_API OCI_Prepare(OCI_Statement *stmt, const otext *sql)
Prepare a SQL statement or PL/SQL block.
OCI_EXPORT boolean OCI_API OCI_DequeueSetAgentList(OCI_Dequeue *dequeue, OCI_Agent **consumers, unsigned int count)
Set the Agent list to listen to message for.
OCI_EXPORT boolean OCI_API OCI_PoolSetTimeout(OCI_Pool *pool, unsigned int value)
Set the connections/sessions idle timeout.
void SetDate(int year, int month, int day)
Set the date part.
OCI_EXPORT OCI_File *OCI_API OCI_GetFile(OCI_Resultset *rs, unsigned int index)
Return the current File value of the column at the given index in the resultset.
OCI_EXPORT boolean OCI_API OCI_DateSetDateTime(OCI_Date *date, int year, int month, int day, int hour, int min, int sec)
Set the date and time portions if the given date handle.
Connection GetConnection(const ostring &sessionTag=OTEXT(""))
Get a connection from the pool.
OCI_EXPORT boolean OCI_API OCI_ObjectSetInt(OCI_Object *obj, const otext *attr, int value)
Set an object attribute of type int.
ostring GetSessionTag() const
Return the tag associated with the given connection.
OCI_EXPORT big_uint OCI_API OCI_LobGetLength(OCI_Lob *lob)
Return the actual length of a lob.
OCI_EXPORT unsigned int OCI_API OCI_GetServerMajorVersion(OCI_Connection *con)
Return the major version number of the connected database server.
OCI_EXPORT boolean OCI_API OCI_DirPathSetEntry(OCI_DirPath *dp, unsigned int row, unsigned int index, void *value, unsigned size, boolean complete)
Set the value of the given row/column array entry.
OCI_EXPORT OCI_Lob *OCI_API OCI_ElemGetLob(OCI_Elem *elem)
Return the Lob value of the given collection element.
bool operator!=(const File &other) const
Indicates if the current file value is not equal the given file value.
OCI_EXPORT boolean OCI_API OCI_LobEnableBuffering(OCI_Lob *lob, boolean value)
Enable / disable buffering mode on the given lob handle.
OCI_EXPORT unsigned int OCI_API OCI_GetStatementCacheSize(OCI_Connection *con)
Return the maximum number of statements to keep in the statement cache.
void SetConsumers(std::vector< Agent > &agents)
Set the recipient list of a message to enqueue.
OCI_EXPORT boolean OCI_API OCI_SetTransaction(OCI_Connection *con, OCI_Transaction *trans)
Set a transaction to a connection.
OCI_EXPORT boolean OCI_API OCI_CollTrim(OCI_Coll *coll, unsigned int nb_elem)
Trims the given number of elements from the end of the collection.
void Open(const ostring &db, const ostring &user, const ostring &pwd, Environment::SessionFlags sessionFlags=Environment::SessionDefault)
Create a physical connection to an Oracle database server.
OCI_EXPORT boolean OCI_API OCI_RefFree(OCI_Ref *ref)
Free a local Ref.
OCI_EXPORT OCI_Transaction *OCI_API OCI_GetTransaction(OCI_Connection *con)
Return the current transaction of the connection.
AnyPointer GetUserData()
Return the pointer to user data previously associated with the connection.
void SetLongMode(LongMode value)
Set the long data type handling mode of a SQL statement.
OCI_EXPORT boolean OCI_API OCI_DateNextDay(OCI_Date *date, const otext *day)
Gets the date of next day of the week, after a given date.
OCI_EXPORT boolean OCI_API OCI_Rollback(OCI_Connection *con)
Cancel current pending changes.
Template class providing OCILIB handles auto memory, life cycle and scope management.
OCI_EXPORT OCI_TypeInfo *OCI_API OCI_ObjectGetTypeInfo(OCI_Object *obj)
Return the type info object associated to the object.
OCI_EXPORT unsigned int OCI_API OCI_LongGetSize(OCI_Long *lg)
Return the buffer size of a long object in bytes (OCI_BLONG) or character (OCI_CLONG) ...
big_uint GetOffset() const
Returns the current R/W offset within the lob.
OCI_EXPORT boolean OCI_API OCI_FileOpen(OCI_File *file)
Open a file for reading.
OCI_EXPORT boolean OCI_API OCI_FetchSeek(OCI_Resultset *rs, unsigned int mode, int offset)
Custom Fetch of the resultset.
Timestamp()
Create an empty null timestamp instance.
OCI_EXPORT boolean OCI_API OCI_IntervalGetYearMonth(OCI_Interval *itv, int *year, int *month)
Return the year / month portion of an interval handle.
Collection()
Create an empty null Collection instance.
OCI_EXPORT boolean OCI_API OCI_IntervalSetDaySecond(OCI_Interval *itv, int day, int hour, int min, int sec, int fsec)
Set the day / time portion if the given interval handle.
Pool()
Default constructor.
void Prepare(const ostring &sql)
Prepare a SQL statement or PL/SQL block.
Template Flags template class providing some type safety to some extends for manipulating flags set v...
OCI_EXPORT boolean OCI_API OCI_ElemSetColl(OCI_Elem *elem, OCI_Coll *value)
Assign a Collection handle to a collection element.
OCI_EXPORT unsigned int OCI_API OCI_DequeueGetVisibility(OCI_Dequeue *dequeue)
Get the dequeuing/locking behavior.
OCI_EXPORT boolean OCI_API OCI_ElemSetDate(OCI_Elem *elem, OCI_Date *value)
Assign a Date handle to a collection element.
OCI_EXPORT boolean OCI_API OCI_ObjectSetUnsignedShort(OCI_Object *obj, const otext *attr, unsigned short value)
Set an object attribute of type unsigned short.
void GetTime(int &hour, int &min, int &sec, int &fsec) const
Extract time parts.
OCI_EXPORT unsigned int OCI_API OCI_GetDataLength(OCI_Resultset *rs, unsigned int index)
Return the current row data length of the column at the given index in the resultset.
void SetDay(int value)
Set the interval day value.
Date Clone() const
Clone the current instance to a new one performing deep copy.
OCI_EXPORT boolean OCI_API OCI_RegisterString(OCI_Statement *stmt, const otext *name, unsigned int len)
Register a string output bind placeholder.
OCI_EXPORT boolean OCI_API OCI_RegisterShort(OCI_Statement *stmt, const otext *name)
Register a short output bind placeholder.
void Commit()
Commit current pending changes.
OCI_Thread * ThreadHandle
Alias for an OCI_Thread pointer.
OCI_EXPORT OCI_Object *OCI_API OCI_ElemGetObject(OCI_Elem *elem)
Return the object value of the given collection element.
OCI_EXPORT unsigned int OCI_API OCI_GetSQLCommand(OCI_Statement *stmt)
Return the Oracle SQL code the command held by the statement handle.
OCI_EXPORT unsigned int OCI_API OCI_DirPathGetRowCount(OCI_DirPath *dp)
Return the number of rows successfully loaded into the database so far.
unsigned int GetMinSize() const
Return the minimum number of connections/sessions that can be opened to the database.
bool SetFormat(FormatType formatType, const ostring &format)
Set the format string for implicit string conversions of the given type.
void Break()
Perform an immediate abort of any currently Oracle OCI call on the given connection.
OCI_EXPORT boolean OCI_API OCI_TimestampAssign(OCI_Timestamp *tmsp, OCI_Timestamp *tmsp_src)
Assign the value of a timestamp handle to another one.
static void StartDatabase(const ostring &db, const ostring &user, const ostring &pwd, Environment::StartFlags startFlags, Environment::StartMode startMode, Environment::SessionFlags sessionFlags=SessionSysDba, const ostring &spfile=OTEXT(""))
Start a database instance.
unsigned int GetMax() const
Returns the maximum number of elements for the collection.
OCI_EXPORT boolean OCI_API OCI_DirPathSetConvertMode(OCI_DirPath *dp, unsigned int mode)
Set the direct path conversion mode.
void Unsubscribe()
Unsubscribe for asynchronous messages notifications.
OCI_EXPORT int OCI_API OCI_ColumnGetFractionalPrecision(OCI_Column *col)
Return the fractional precision of the column for timestamp and interval columns. ...
void SetYear(int value)
Set the timestamp year value.
OCI_EXPORT unsigned int OCI_API OCI_GetPrefetchMemory(OCI_Statement *stmt)
Return the amount of memory used to retrieve rows pre-fetched by OCI Client.
OCI_EXPORT boolean OCI_API OCI_SetPrefetchSize(OCI_Statement *stmt, unsigned int size)
Set the number of rows pre-fetched by OCI Client.
OCI_EXPORT boolean OCI_API OCI_DequeueGetRelativeMsgID(OCI_Dequeue *dequeue, void *id, unsigned int *len)
Get the message identifier of the message to be dequeued.
OCI_EXPORT boolean OCI_API OCI_DirPathSetParallel(OCI_DirPath *dp, boolean value)
Set the parallel loading mode.
OCI_EXPORT boolean OCI_API OCI_DequeueSetCorrelation(OCI_Dequeue *dequeue, const otext *pattern)
set the correlation identifier of the message to be dequeued
OCI_EXPORT int OCI_API OCI_NumberAssign(OCI_Number *number, OCI_Number *number_src)
Assign the value of a number handle to another one.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfRefs(OCI_Statement *stmt, const otext *name, OCI_Ref **data, OCI_TypeInfo *typinf, unsigned int nbelem)
Bind an array of Ref handles.
OCI_EXPORT boolean OCI_API OCI_QueueAlter(OCI_Connection *con, const otext *queue_name, unsigned int max_retries, unsigned int retry_delay, unsigned int retention_time, const otext *comment)
Alter the given queue.
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
OCI_EXPORT OCI_Dequeue *OCI_API OCI_DequeueCreate(OCI_TypeInfo *typinf, const otext *name)
Create a Dequeue object for the given queue.
OCI_EXPORT OCI_Error *OCI_API OCI_GetBatchError(OCI_Statement *stmt)
Returns the first or next error that occurred within a DML array statement execution.
ostring GetName() const
Return the type info name.
Date operator-(int value) const
Return a new date holding the current date value decremented by the given number of days...
OCI_EXPORT OCI_Resultset *OCI_API OCI_GetNextResultset(OCI_Statement *stmt)
Retrieve the next available resultset.
OCI_EXPORT unsigned int OCI_API OCI_TransactionGetTimeout(OCI_Transaction *trans)
Return global transaction Timeout.
OCI_EXPORT boolean OCI_API OCI_ElemSetInt(OCI_Elem *elem, int value)
Set a int value to a collection element.
OCI_EXPORT boolean OCI_API OCI_LongFree(OCI_Long *lg)
Free a local temporary long.
struct OCI_Long OCI_Long
Oracle Long data type.
OCI_EXPORT double OCI_API OCI_ElemGetDouble(OCI_Elem *elem)
Return the Double value of the given collection element.
Statement()
Create an empty null Statement instance.
ostring GetDomain() const
Return the Oracle server Domain name of the connected database/service name.
Agent GetSender() const
Return the original sender of the message.
OCI_EXPORT boolean OCI_API OCI_RegisterRef(OCI_Statement *stmt, const otext *name, OCI_TypeInfo *typinf)
Register a Ref output bind placeholder.
OCI_EXPORT boolean OCI_API OCI_TimestampToText(OCI_Timestamp *tmsp, const otext *fmt, int size, otext *str, int precision)
Convert a timestamp value from the given timestamp handle to a string.
int GetMilliSeconds() const
Return the timestamp seconds value.
OCI_EXPORT short OCI_API OCI_GetShort(OCI_Resultset *rs, unsigned int index)
Return the current short value of the column at the given index in the resultset. ...
void SetWaitTime(int value)
Set the time that Get() waits for messages if no messages are currently available.
Raw GetID() const
Return the ID of the message.
iterator end()
Returns an iterator referring to the past-the-end element in the collection.
Provides type information on Oracle Database objects.
OCI_EXPORT boolean OCI_API OCI_SetPrefetchMemory(OCI_Statement *stmt, unsigned int size)
Set the amount of memory pre-fetched by OCI Client.
ostring GetName() const
Return the file name.
OCI_EXPORT OCI_Number *OCI_API OCI_GetNumber(OCI_Resultset *rs, unsigned int index)
Return the current Number value of the column at the given index in the resultset.
OCI_EXPORT const otext *OCI_API OCI_EventGetRowid(OCI_Event *event)
Return the rowid of the altered database object row.
struct OCI_TypeInfo OCI_TypeInfo
Type info metadata handle.
EnqueueVisibility GetVisibility() const
Get the enqueuing/locking behavior.
OCI_EXPORT unsigned int OCI_API OCI_DirPathGetErrorRow(OCI_DirPath *dp)
Return the index of a row which caused an error during data conversion.
OCI_EXPORT boolean OCI_API OCI_ObjectGetBoolean(OCI_Object *obj, const otext *attr)
Return the boolean value of the given object attribute (ONLY for PL/SQL records)
TypeInfoType GetType() const
Return the type of the given TypeInfo object.
void Rollback()
Cancel current pending changes.
void SetCurrentRows(unsigned int value)
Set the current number of rows to convert and load.
OCI_EXPORT const otext *OCI_API OCI_ElemGetString(OCI_Elem *elem)
Return the String value of the given collection element.
ostring GetSQLType() const
Return the Oracle SQL type name of the column data type.
OCI_EXPORT const otext *OCI_API OCI_GetServiceName(OCI_Connection *con)
Return the Oracle server service name of the connected database/service name.
OCI_EXPORT OCI_Object *OCI_API OCI_MsgGetObject(OCI_Msg *msg)
Get the object payload of the given message.
Resolve a bind input / output types.
unsigned int GetColumnCount() const
Return the number of columns contained in the type.
OCI_EXPORT boolean OCI_API OCI_BindShort(OCI_Statement *stmt, const otext *name, short *data)
Bind an short variable.
OCI_EXPORT boolean OCI_API OCI_ElemSetDouble(OCI_Elem *elem, double value)
Set a double value to a collection element.
OCI_EXPORT const otext *OCI_API OCI_DequeueGetConsumer(OCI_Dequeue *dequeue)
Get the current consumer name associated with the dequeuing process.
DirectPath::Result Load()
Loads the data converted to direct path stream format.
int GetEnqueueDelay() const
Return the number of seconds that a message is delayed for dequeuing.
IntervalTypeValues
Interval types enumerated values.
OCI_EXPORT boolean OCI_API OCI_ElemSetObject(OCI_Elem *elem, OCI_Object *value)
Assign an Object handle to a collection element.
OCI_EXPORT unsigned int OCI_API OCI_GetUnsignedInt(OCI_Resultset *rs, unsigned int index)
Return the current unsigned integer value of the column at the given index in the resultset...
OCI_EXPORT boolean OCI_API OCI_RefIsNull(OCI_Ref *ref)
Check if the Ref points to an object or not.
unsigned int GetBusyConnectionsCount() const
Return the current number of busy connections/sessions.
OCI_EXPORT unsigned int OCI_API OCI_GetOCIRuntimeVersion(void)
Return the version of OCI used at runtime.
OCI_EXPORT boolean OCI_API OCI_BindFloat(OCI_Statement *stmt, const otext *name, float *data)
Bind a float variable.
OCI_EXPORT boolean OCI_API OCI_IsNull2(OCI_Resultset *rs, const otext *name)
Check if the current row value is null for the column of the given name in the resultset.
void SetPrefetchSize(unsigned int value)
Set the number of rows pre-fetched by OCI Client.
OCI_EXPORT boolean OCI_API OCI_TimestampGetDate(OCI_Timestamp *tmsp, int *year, int *month, int *day)
Extract the date part from a timestamp handle.
POCI_THREAD ThreadProc
Thread callback.
bool IsDataNull(unsigned int index=1) const
Check if the current bind value(s) used in SQL statements is marked as NULL.
Date & operator-=(int value)
Decrement the date by the given number of days.
OCI_EXPORT boolean OCI_API OCI_DequeueSetMode(OCI_Dequeue *dequeue, unsigned int mode)
Set the dequeuing/locking behavior.
Resultset GetNextResultset()
Retrieve the next available resultset.
ShutdownFlagsValues
Oracle instance shutdown flags enumerated values.
OCI_EXPORT big_uint OCI_API OCI_LobGetMaxSize(OCI_Lob *lob)
Return the maximum size that the lob can contain.
OCI_EXPORT int OCI_API OCI_ElemGetInt(OCI_Elem *elem)
Return the int value of the given collection element.
unsigned int GetDefaultLobPrefetchSize() const
Return the default LOB prefetch buffer size for the connection.
OCI_EXPORT boolean OCI_API OCI_FileClose(OCI_File *file)
Close a file.
OCI_EXPORT boolean OCI_API OCI_DirPathPrepare(OCI_DirPath *dp)
Prepares the OCI direct path load interface before any rows can be converted or loaded.
OCI_EXPORT void *OCI_API OCI_LongGetBuffer(OCI_Long *lg)
Return the internal buffer of an OCI_Long object read from a fetch sequence.
void Watch(const ostring &sql)
Add a SQL query to monitor.
Statement GetStatement() const
Return the statement within the error occurred.
ostring GetServerVersion() const
Return the connected database server string version.
OCI_EXPORT boolean OCI_API OCI_SetFetchSize(OCI_Statement *stmt, unsigned int size)
Set the number of rows fetched per internal server fetch call.
ostring GetInstance() const
Return the Oracle server Instance name of the connected database/service name.
int GetFractionalPrecision() const
Return the fractional precision of the column for Timestamp and Interval columns. ...
OCI_EXPORT unsigned int OCI_API OCI_DirPathGetMaxRows(OCI_DirPath *dp)
Return the maximum number of rows allocated in the OCI and OCILIB internal arrays of rows...
OCI_EXPORT unsigned int OCI_API OCI_EnqueueGetSequenceDeviation(OCI_Enqueue *enqueue)
Return the sequence deviation of messages to enqueue to the queue.
Number(bool create=false)
Create an empty null number object.
void EnableServerOutput(unsigned int bufsize, unsigned int arrsize, unsigned int lnsize)
Enable the server output.
OCI_EXPORT OCI_Msg *OCI_API OCI_DequeueGet(OCI_Dequeue *dequeue)
Dequeue messages from the given queue.
OCI_EXPORT OCI_Agent *OCI_API OCI_AgentCreate(OCI_Connection *con, const otext *name, const otext *address)
Create an AQ agent object.
OCI_EXPORT unsigned int OCI_API OCI_GetBindMode(OCI_Statement *stmt)
Return the binding mode of a SQL statement.
OCI_EXPORT big_int OCI_API OCI_ObjectGetBigInt(OCI_Object *obj, const otext *attr)
Return the big integer value of the given object attribute.
OCI_EXPORT boolean OCI_API OCI_TimestampSysTimestamp(OCI_Timestamp *tmsp)
Stores the system current date and time as a timestamp value with time zone into the timestamp handle...
bool Seek(SeekMode seekMode, big_uint offset)
Move the current position within the file for read/write operations.
void Abort()
Terminate a direct path operation without committing changes.
OCI_EXPORT unsigned int OCI_API OCI_CollGetType(OCI_Coll *coll)
Return the collection type.
Date & operator+=(int value)
Increment the date by the given number of days.
OCI_EXPORT boolean OCI_API OCI_CollToText(OCI_Coll *coll, unsigned int *size, otext *str)
Convert a collection handle value to a string.
OCI_EXPORT boolean OCI_API OCI_SetSessionTag(OCI_Connection *con, const otext *tag)
Associate a tag to the given connection/session.
OCI_EXPORT boolean OCI_API OCI_BindIsNullAtPos(OCI_Bind *bnd, unsigned int position)
Check if the current entry value at the given index of the binded array is marked as NULL...
OCI_EXPORT boolean OCI_API OCI_MsgSetExpiration(OCI_Msg *msg, int value)
set the duration that the message is available for dequeuing
OCI_EXPORT unsigned int OCI_API OCI_TimestampGetType(OCI_Timestamp *tmsp)
Return the type of the given Timestamp object.
OCI_EXPORT boolean OCI_API OCI_IntervalFromText(OCI_Interval *itv, const otext *str)
Convert a string to an interval and store it in the given interval handle.
void SetSender(const Agent &agent)
Set the original sender of the message.
void SetTime(int hour, int min, int sec, int fsec)
Set the time part.
ostring MakeString(const otext *result, int size=-1)
Internal usage. Constructs a C++ string object from the given OCILIB string pointer.
Lob< ostring, LobNationalCharacter > NClob
Class handling NCLOB oracle type.
bool IsElementNull(unsigned int index) const
check if the element at the given index is null
TypeInfo GetSuperType() const
Return the super type of the given type (e.g. parent type for a derived ORACLE UDT type) ...
ostring GetCorrelation() const
Get the correlation identifier of the message to be dequeued.
OCI_EXPORT OCI_Timestamp *OCI_API OCI_TimestampCreate(OCI_Connection *con, unsigned int type)
Create a local Timestamp instance.
OCI_EXPORT boolean OCI_API OCI_ObjectSetInterval(OCI_Object *obj, const otext *attr, OCI_Interval *value)
Set an object attribute of type Interval.
static void Acquire(MutexHandle handle)
Acquire a mutex lock.
OCI_EXPORT boolean OCI_API OCI_SetStatementCacheSize(OCI_Connection *con, unsigned int value)
Set the maximum number of statements to keep in the statement cache.
OCI_EXPORT boolean OCI_API OCI_ObjectSetBoolean(OCI_Object *obj, const otext *attr, boolean value)
Set an object attribute of type boolean (ONLY for PL/SQL records)
void SetReferenceNull()
Nullify the given Ref handle.
static big_uint GetAllocatedBytes(AllocatedBytesFlags type)
Return the current number of bytes allocated internally in the library.
OCI_EXPORT OCI_Thread *OCI_API OCI_ThreadCreate(void)
Create a Thread object.
void SetParallel(bool value)
Set the parallel loading mode.
OCI_EXPORT boolean OCI_API OCI_SetFormat(OCI_Connection *con, unsigned int type, const otext *format)
Set the format string for implicit string conversions of the given type.
ostring GetSQLVerb() const
Return the verb of the SQL command held by the statement.
void SetAttributeNull(const ostring &name)
Set the given object attribute to null.
OCI_EXPORT boolean OCI_API OCI_ObjectSetFloat(OCI_Object *obj, const otext *attr, float value)
Set an object attribute of type float.
OCI_EXPORT OCI_Coll *OCI_API OCI_ObjectGetColl(OCI_Object *obj, const otext *attr)
Return the collection value of the given object attribute.
OCI_EXPORT boolean OCI_API OCI_SetLongMode(OCI_Statement *stmt, unsigned int mode)
Set the long data type handling mode of a SQL statement.
ostring GetService() const
Return the Oracle server Service name of the connected database/service name.
OCI_EXPORT boolean OCI_API OCI_AgentFree(OCI_Agent *agent)
Free an AQ agent object.
OCI_EXPORT OCI_Long *OCI_API OCI_GetLong2(OCI_Resultset *rs, const otext *name)
Return the current Long value of the column from its name in the resultset.
OCI_EXPORT int OCI_API OCI_IntervalCheck(OCI_Interval *itv)
Check if the given interval is valid.
OCI_EXPORT OCI_Connection *OCI_API OCI_StatementGetConnection(OCI_Statement *stmt)
Return the connection handle associated with a statement handle.
OCI_EXPORT boolean OCI_API OCI_QueueTableDrop(OCI_Connection *con, const otext *queue_table, boolean force)
Drop the given queue table.
OCI_EXPORT OCI_Timestamp *OCI_API OCI_GetTimestamp(OCI_Resultset *rs, unsigned int index)
Return the current timestamp value of the column at the given index in the resultset.
OCI_EXPORT boolean OCI_API OCI_BindLong(OCI_Statement *stmt, const otext *name, OCI_Long *data, unsigned int size)
Bind a Long variable.
OCI_EXPORT unsigned int OCI_API OCI_GetBindCount(OCI_Statement *stmt)
Return the number of binds currently associated to a statement.
void SetName(const ostring &value)
Set the given AQ agent name.
OCI_EXPORT OCI_Agent *OCI_API OCI_DequeueListen(OCI_Dequeue *dequeue, int timeout)
Listen for messages that match any recipient of the associated Agent list.
OCI_EXPORT boolean OCI_API OCI_MsgSetPriority(OCI_Msg *msg, int value)
Set the priority of the message.
void SetElementNull(unsigned int index)
Nullify the element at the given index.
OCI_EXPORT int OCI_API OCI_MsgGetEnqueueDelay(OCI_Msg *msg)
Return the number of seconds that a message is delayed for dequeuing.
Object identifying the SQL data type LOB (CLOB, NCLOB and BLOB)
OCI_EXPORT OCI_TypeInfo *OCI_API OCI_ColumnGetTypeInfo(OCI_Column *col)
Return the type information object associated to the column.
Enum< CollationIDValues > CollationID
Type of Collation ID.
void SetEnqueueDelay(int value)
set the number of seconds to delay the enqueued message
OCI_EXPORT unsigned int OCI_API OCI_PoolGetTimeout(OCI_Pool *pool)
Get the idle timeout for connections/sessions in the pool.
OCI_EXPORT boolean OCI_API OCI_RegisterTimestamp(OCI_Statement *stmt, const otext *name, unsigned int type)
Register a timestamp output bind placeholder.
OCI_EXPORT OCI_File *OCI_API OCI_ObjectGetFile(OCI_Object *obj, const otext *attr)
Return the file value of the given object attribute.
unsigned int Append(const T &content)
Append the given content to the lob.
ostring GetConnectionString() const
Return the name of the connected database/service name.
unsigned int GetServerMajorVersion() const
Return the major version number of the connected database server.
TypeInfo(const Connection &connection, const ostring &name, TypeInfoType type)
Parametrized constructor.
OCI_EXPORT OCI_Interval *OCI_API OCI_ObjectGetInterval(OCI_Object *obj, const otext *attr)
Return the interval value of the given object attribute.
void Open(OpenMode mode)
Open explicitly a Lob.
OCI_EXPORT boolean OCI_API OCI_IntervalFree(OCI_Interval *itv)
Free an OCI_Interval handle.
Internal usage. Allow resolving a native type used by C API from a C++ type in binding operations...
OCI_EXPORT boolean OCI_API OCI_DirPathSave(OCI_DirPath *dp)
Execute a data save-point (server side)
Object GetObject() const
Returns the object pointed by the reference.
OCI_EXPORT boolean OCI_API OCI_MsgSetEnqueueDelay(OCI_Msg *msg, int value)
set the number of seconds to delay the enqueued message
OCI_EXPORT boolean OCI_API OCI_DateGetDate(OCI_Date *date, int *year, int *month, int *day)
Extract the date part from a date handle.
void Execute(const ostring &sql)
Prepare and execute a SQL statement or PL/SQL block.
TypeInfo GetTypeInfo() const
Return the TypeInfo object describing the referenced object.
bool GetNoWait() const
Get the waiting mode used when no more connections/sessions are available from the pool...
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetSize(OCI_Column *col)
Return the size of the column.
static Timestamp SysTimestamp(TimestampType type=NoTimeZone)
return the current system timestamp
static Environment::CharsetMode GetCharset()
Return the OCILIB charset type.
OCI_EXPORT boolean OCI_API OCI_TransactionStart(OCI_Transaction *trans)
Start global transaction.
int GetYear() const
Return the date year value.
Lob< ostring, LobCharacter > Clob
Class handling CLOB oracle type.
bool operator>(const Date &other) const
Indicates if the current date value is superior to the given date value.
void SetExpiration(int value)
set the duration that the message is available for dequeuing
void SetVisibility(EnqueueVisibility value)
Set whether the new message is enqueued as part of the current transaction.
OCI_EXPORT unsigned int OCI_API OCI_GetColumnIndex(OCI_Resultset *rs, const otext *name)
Return the index of the column in the result from its name.
bool IsValid() const
Check if the given timestamp is valid.
OCI_EXPORT boolean OCI_API OCI_BindColl(OCI_Statement *stmt, const otext *name, OCI_Coll *data)
Bind a Collection variable.
void SetSessionTag(const ostring &tag)
Associate a tag to the given connection/session.
OCI_EXPORT unsigned int OCI_API OCI_LongWrite(OCI_Long *lg, void *buffer, unsigned int len)
Write a buffer into a Long.
struct OCI_Coll OCI_Coll
Oracle Collections (VARRAYs and Nested Tables) representation.
OCI_EXPORT boolean OCI_API OCI_QueueDrop(OCI_Connection *con, const otext *queue_name)
Drop the given queue.
void Set(const ostring &name, const T &value)
Set the given object attribute value.
OCI_EXPORT int OCI_API OCI_ColumnGetPrecision(OCI_Column *col)
Return the precision of the column for numeric columns.
OCI_EXPORT const otext *OCI_API OCI_GetServerName(OCI_Connection *con)
Return the Oracle server machine name of the connected database/service name.
OCI_EXPORT boolean OCI_API OCI_DequeueUnsubscribe(OCI_Dequeue *dequeue)
Unsubscribe for asynchronous messages notifications.
OCI_EXPORT boolean OCI_API OCI_TransactionStop(OCI_Transaction *trans)
Stop current global transaction.
OCI_EXPORT boolean OCI_API OCI_NumberFromText(OCI_Number *number, const otext *str, const otext *fmt)
Convert a string to a number and store it in the given number handle.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfNumbers(OCI_Statement *stmt, const otext *name, OCI_Number **data, unsigned int nbelem)
Bind an array of Number.
OCI_EXPORT unsigned int OCI_API OCI_DirPathGetCurrentRows(OCI_DirPath *dp)
Return the current number of rows used in the OCILIB internal arrays of rows.
OCI_EXPORT boolean OCI_API OCI_MsgSetCorrelation(OCI_Msg *msg, const otext *correlation)
set the correlation identifier of the message
PropertyFlagsValues
Column properties flags values.
OCI_EXPORT unsigned int OCI_API OCI_ErrorGetRow(OCI_Error *err)
Return the row index which caused an error during statement execution.
OCI_EXPORT boolean OCI_API OCI_ElemFree(OCI_Elem *elem)
Free a local collection element.
OCI_EXPORT const otext *OCI_API OCI_AgentGetName(OCI_Agent *agent)
Get the given AQ agent name.
OCI_EXPORT OCI_DirPath *OCI_API OCI_DirPathCreate(OCI_TypeInfo *typinf, const otext *partition, unsigned int nb_cols, unsigned int nb_rows)
Create a direct path object.
void Unregister()
Unregister a previously registered notification.
OCI_EXPORT boolean OCI_API OCI_LobSeek(OCI_Lob *lob, big_uint offset, unsigned int mode)
Perform a seek operation on the OCI_lob content buffer.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfObjects(OCI_Statement *stmt, const otext *name, OCI_Object **data, OCI_TypeInfo *typinf, unsigned int nbelem)
Bind an array of object handles.
void SetYear(int value)
Set the date year value.
struct OCI_Elem OCI_Elem
Oracle Collection item representation.
Interval Clone() const
Clone the current instance to a new one performing deep copy.
OCI_EXPORT boolean OCI_API OCI_DirPathFlushRow(OCI_DirPath *dp)
Flushes a partially loaded row from server.
OCI_EXPORT boolean OCI_API OCI_ElemSetTimestamp(OCI_Elem *elem, OCI_Timestamp *value)
Assign a Timestamp handle to a collection element.
OCI_EXPORT boolean OCI_API OCI_Initialize(POCI_ERROR err_handler, const otext *lib_path, unsigned int mode)
Initialize the library.
OCI_EXPORT const otext *OCI_API OCI_GetSql(OCI_Statement *stmt)
Return the last SQL or PL/SQL statement prepared or executed by the statement.
OCI_EXPORT OCI_Number *OCI_API OCI_ObjectGetNumber(OCI_Object *obj, const otext *attr)
Return the number value of the given object attribute.
Timestamp operator+(int value) const
Return a new Timestamp holding the current Timestamp value incremented by the given number of days...
OCI_EXPORT OCI_Coll *OCI_API OCI_GetColl2(OCI_Resultset *rs, const otext *name)
Return the current Collection value of the column from its name in the resultset. ...
DirectPath(const TypeInfo &typeInfo, unsigned int nbCols, unsigned int nbRows, const ostring &partition=OTEXT(""))
Constructor.
OCI_EXPORT boolean OCI_API OCI_ObjectSetString(OCI_Object *obj, const otext *attr, const otext *value)
Set an object attribute of type string.
Date & operator++()
Increment the date by 1 day.
OCI_EXPORT big_uint OCI_API OCI_ElemGetUnsignedBigInt(OCI_Elem *elem)
Return the unsigned big int value of the given collection element.
OCI_EXPORT unsigned int OCI_API OCI_PoolGetMin(OCI_Pool *pool)
Return the minimum number of connections/sessions that can be opened to the database.
bool PingServer() const
Performs a round trip call to the server to confirm that the connection to the server is still valid...
void SetDateFormat(const ostring &format)
Set the default date format string for input conversion.
bool IsReferenceNull() const
Check if the reference points to an object or not.
OCI_EXPORT int OCI_API OCI_MsgGetAttemptCount(OCI_Msg *msg)
Return the number of attempts that have been made to dequeue the message.
Timestamp GetInstanceStartTime() const
Return the date and time (Timestamp) server instance start of the.
static unsigned int GetRuntimeMinorVersion()
Return the minor version number of OCI used at runtime.
unsigned int GetSize() const
Return the size of the column.
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 ) ...
OCI_EXPORT boolean OCI_API OCI_ElemSetShort(OCI_Elem *elem, short value)
Set a short value to a collection element.
int GetWaitTime() const
Return the time that Get() waits for messages if no messages are currently available.
Date GetEnqueueTime() const
return the time the message was enqueued
bool operator!=(const Lob &other) const
Indicates if the current lob value is not equal the given lob value.
big_uint GetMaxSize() const
Returns the lob maximum possible size.
struct OCI_Object OCI_Object
Oracle Named types representation.
OCI_EXPORT unsigned int OCI_API OCI_BindGetDataCount(OCI_Bind *bnd)
Return the number of elements of the bind handle.
OCI_EXPORT OCI_Mutex *OCI_API OCI_MutexCreate(void)
Create a Mutex object.
unsigned int GetTimeout() const
Get the idle timeout for connections/sessions in the pool.
OCI_EXPORT OCI_Long *OCI_API OCI_LongCreate(OCI_Statement *stmt, unsigned int type)
Create a local temporary Long instance.
OCI_EXPORT boolean OCI_API OCI_IntervalAssign(OCI_Interval *itv, OCI_Interval *itv_src)
Assign the value of a interval handle to another one.
StartModeValues
Oracle instance start modes enumerated values.
OCI_EXPORT int OCI_API OCI_IntervalCompare(OCI_Interval *itv, OCI_Interval *itv2)
Compares two interval handles.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfBigInts(OCI_Statement *stmt, const otext *name, big_int *data, unsigned int nbelem)
Bind an array of big integers.
bool IsValid() const
Check if the given interval is valid.
OCI_EXPORT OCI_Timestamp *OCI_API OCI_ElemGetTimestamp(OCI_Elem *elem)
Return the Timestamp value of the given collection element.
static unsigned int GetRuntimeMajorVersion()
Return the major version number of OCI used at runtime.
int GetDay() const
Return the timestamp day value.
void SetSeconds(int value)
Set the interval seconds value.
bool GetAutoCommit() const
Indicates if auto commit is currently activated.
int GetAttemptCount() const
Return the number of attempts that have been made to dequeue the message.
bool Seek(SeekMode mode, int offset)
Custom Fetch of the resultset.
struct OCI_Column OCI_Column
Oracle SQL Column and Type member representation.
Raw GetRelativeMsgID() const
Get the message identifier of the message to be dequeued.
unsigned int GetPrefetchSize() const
Return the number of rows pre-fetched by OCI Client.
OCI_EXPORT unsigned int OCI_API OCI_GetDefaultLobPrefetchSize(OCI_Connection *con)
Return the default LOB prefetch buffer size for the connection.
bool IsOpened() const
Check if the specified file is currently opened on the server by our object.
OCI_EXPORT boolean OCI_API OCI_LobFree(OCI_Lob *lob)
Free a local temporary lob.
boolean IsFinalType() const
Indicate if the given UDT type is final.
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetType(OCI_Column *col)
Return the type of the given column.
static bool SetFormat(FormatType formatType, const ostring &format)
Set the format string for implicit string conversions of the given type.
void AddMonths(int months)
Add or subtract months.
bool GetServerOutput(ostring &line) const
Retrieve one line of the server buffer.
ObjectType GetType() const
Return the type of the given object.
OCI_EXPORT OCI_Object *OCI_API OCI_GetObject(OCI_Resultset *rs, unsigned int index)
Return the current Object value of the column at the given index in the resultset.
OCI_EXPORT boolean OCI_API OCI_TimestampGetTimeZoneOffset(OCI_Timestamp *tmsp, int *hour, int *min)
Return the time zone (hour, minute) portion of a timestamp handle.
ostring ToString() const
return a string representation of the current object
int GetExpiration() const
Return the duration that the message is available for dequeuing.
OCI_EXPORT boolean OCI_API OCI_EnqueuePut(OCI_Enqueue *enqueue, OCI_Msg *msg)
Enqueue a message on the queue associated to the Enqueue object.
OCI_EXPORT boolean OCI_API OCI_TransactionResume(OCI_Transaction *trans)
Resume a stopped global transaction.
OCI_EXPORT unsigned int OCI_API OCI_GetSqlErrorPos(OCI_Statement *stmt)
Return the error position (in terms of characters) in the SQL statement where the error occurred in c...
DataType GetType() const
Return the type of the given column.
OCI_EXPORT boolean OCI_API OCI_QueueStop(OCI_Connection *con, const otext *queue_name, boolean enqueue, boolean dequeue, boolean wait)
Stop enqueuing or dequeuing or both on the given queue.
OCI_EXPORT boolean OCI_API OCI_LobAppendLob(OCI_Lob *lob, OCI_Lob *lob_src)
Append a source LOB at the end of a destination LOB.
EnqueueMode GetMode() const
Return the enqueuing mode of messages to enqueue.
void Close()
Close the file on the server.
OCI_EXPORT boolean OCI_API OCI_MsgSetExceptionQueue(OCI_Msg *msg, const otext *queue)
Set the name of the queue to which the message is moved to if it cannot be processed successfully...
OCI_EXPORT boolean OCI_API OCI_RegisterInterval(OCI_Statement *stmt, const otext *name, unsigned int type)
Register an interval output bind placeholder.
bool operator==(const File &other) const
Indicates if the current file value is equal the given file value.
struct OCI_Error OCI_Error
Encapsulates an Oracle or OCILIB exception.
void SetMonth(int value)
Set the interval month value.
OCI_EXPORT boolean OCI_API OCI_Parse(OCI_Statement *stmt, const otext *sql)
Parse a SQL statement or PL/SQL block.
OCI_EXPORT boolean OCI_API OCI_IntervalSetYearMonth(OCI_Interval *itv, int year, int month)
Set the year / month portion if the given Interval handle.
unsigned int GetSQLCommand() const
Return the Oracle SQL code the command held by the statement.
OCI_EXPORT OCI_Statement *OCI_API OCI_ErrorGetStatement(OCI_Error *err)
Retrieve statement handle within the error occurred.
void SetNavigation(NavigationMode value)
Set the position of messages to be retrieved.
OCI_EXPORT boolean OCI_API OCI_SetFetchMode(OCI_Statement *stmt, unsigned int mode)
Set the fetch mode of a SQL statement.
void SetRelativeMsgID(const Raw &value)
Set a message identifier to use for enqueuing messages using a sequence deviation.
OCI_EXPORT OCI_Number *OCI_API OCI_GetNumber2(OCI_Resultset *rs, const otext *name)
Return the current number value of the column from its name in the resultset.
OCI_EXPORT boolean OCI_API OCI_BindArrayOfColls(OCI_Statement *stmt, const otext *name, OCI_Coll **data, OCI_TypeInfo *typinf, unsigned int nbelem)
Bind an array of Collection handles.
Dequeue object for dequeuing messages into an Oracle Queue.
OCI_EXPORT boolean OCI_API OCI_DirPathSetDateFormat(OCI_DirPath *dp, const otext *format)
Set the default date format string for input conversion.
void Bind(const ostring &name, T &value, BindInfo::BindDirection mode)
Bind an host variable.
unsigned int GetTimeout() const
Return the transaction Timeout.
void Truncate(big_uint length)
Truncate the lob to a shorter length.
Transaction(const Connection &connection, unsigned int timeout, TransactionFlags flags, OCI_XID *pxid=nullptr)
Create a new global transaction or a serializable/read-only local transaction.
OCI_EXPORT boolean OCI_API OCI_DequeueSetRelativeMsgID(OCI_Dequeue *dequeue, const void *id, unsigned int len)
Set the message identifier of the message to be dequeued.
OCI_EXPORT boolean OCI_API OCI_RegisterRaw(OCI_Statement *stmt, const otext *name, unsigned int len)
Register an raw output bind placeholder.
OCI_EXPORT boolean OCI_API OCI_DirPathFinish(OCI_DirPath *dp)
Terminate a direct path operation and commit changes into the database.
OCI_EXPORT boolean OCI_API OCI_EnqueueFree(OCI_Enqueue *enqueue)
Free a Enqueue object.
bool First()
Fetch the first row of the resultset.
void SetYearMonth(int year, int month)
Set the Year / Month parts.
OCI_EXPORT boolean OCI_API OCI_RefAssign(OCI_Ref *ref, OCI_Ref *ref_src)
Assign a Ref to another one.
OCI_EXPORT const otext *OCI_API OCI_GetTrace(OCI_Connection *con, unsigned int trace)
Get the current trace for the trace type from the given connection.
bool Seek(SeekMode seekMode, big_uint offset)
Move the current position within the lob for read/write operations.
OCI_EXPORT OCI_Msg *OCI_API OCI_MsgCreate(OCI_TypeInfo *typinf)
Create a message object based on the given payload type.
void GetTimeZoneOffset(int &hour, int &min) const
Return the time zone (hour, minute) offsets.
OCI_EXPORT boolean OCI_API OCI_AgentSetAddress(OCI_Agent *agent, const otext *address)
Set the given AQ agent address.
void Truncate(unsigned int size)
Trim the given number of elements from the end of the collection.
static ThreadId GetThreadId(ThreadHandle handle)
Return the system Thread ID of the given thread handle.
bool operator==(const Interval &other) const
Indicates if the current Interval value is equal to the given Interval value.
OCI_EXPORT boolean OCI_API OCI_LobFlush(OCI_Lob *lob)
Flush Lob content to the server.
static void Create(const ostring &name, ThreadKeyFreeProc freeProc=nullptr)
Create a thread key object.
void EnableBuffering(bool value)
Enable / disable buffering mode on the given lob object.
bool operator-=(int offset)
Convenient operator overloading that performs a call to Seek() with Resultset::SeekRelative and the g...
int GetHours() const
Return the timestamp hours value.
T Get(const ostring &name) const
Return the given object attribute value.
EnvironmentFlagsValues
Environment Flags enumerated values.
OCI_EXPORT OCI_Lob *OCI_API OCI_GetLob(OCI_Resultset *rs, unsigned int index)
Return the current lob value of the column at the given index in the resultset.
struct OCI_Event OCI_Event
OCILIB encapsulation of Oracle DCN event.
void FlushRow()
Flushes a partially loaded row from server.
OCI_EXPORT boolean OCI_API OCI_BindUnsignedShort(OCI_Statement *stmt, const otext *name, unsigned short *data)
Bind an unsigned short variable.
OCI_EXPORT OCI_Subscription *OCI_API OCI_SubscriptionRegister(OCI_Connection *con, const otext *name, unsigned int type, POCI_NOTIFY handler, unsigned int port, unsigned int timeout)
Register a notification against the given database.
OCI_EXPORT OCI_Ref *OCI_API OCI_ElemGetRef(OCI_Elem *elem)
Return the Ref value of the given collection element.
OCI_EXPORT boolean OCI_API OCI_RegisterFloat(OCI_Statement *stmt, const otext *name)
Register a float output bind placeholder.
OCI_EXPORT boolean OCI_API OCI_NumberMultiply(OCI_Number *number, unsigned int type, void *value)
Multiply the given number with the value of a native C numeric.
OCI_EXPORT boolean OCI_API OCI_ElemSetFloat(OCI_Elem *elem, float value)
Set a float value to a collection element.
Subscription to database or objects changes.
ostring GetDatabaseName() const
Return the name of the database that generated the event.
Raw GetOriginalID() const
Return the original ID of the message in the last queue that generated this message.
BindMode GetBindMode() const
Return the binding mode of a SQL statement.
OCI_EXPORT unsigned int OCI_API OCI_ObjectGetRawSize(OCI_Object *obj, const otext *attr)
Return the raw attribute value size of the given object attribute into the given buffer.
ostring GetDirectory() const
Return the file directory.
struct OCI_Lob OCI_Lob
Oracle Internal Large objects:
LongMode GetLongMode() const
Return the long data type handling mode of a SQL statement.
OCI_EXPORT boolean OCI_API OCI_BindRef(OCI_Statement *stmt, const otext *name, OCI_Ref *data)
Bind a Ref variable.
OCI_EXPORT boolean OCI_API OCI_FileIsEqual(OCI_File *file, OCI_File *file2)
Compare two file handle for equality.
OCI_EXPORT boolean OCI_API OCI_Cleanup(void)
Clean up all resources allocated by the library.
void Save()
Execute a data save-point (server side)
big_uint Erase(big_uint offset, big_uint length)
Erase a portion of the lob at a given position.
FailoverResult(* TAFHandlerProc)(Connection &con, FailoverRequest failoverRequest, FailoverEvent failoverEvent)
User callback for TAF event notifications.
OCI_EXPORT unsigned int OCI_API OCI_BindGetType(OCI_Bind *bnd)
Return the OCILIB type of the given bind.
OCI_EXPORT OCI_Number *OCI_API OCI_NumberCreate(OCI_Connection *con)
Create a local number object.
static ThreadHandle Create()
Create a Thread.
Connection()
Default constructor.
OCI_EXPORT OCI_Pool *OCI_API OCI_PoolCreate(const otext *db, const otext *user, const otext *pwd, unsigned int type, unsigned int mode, unsigned int min_con, unsigned int max_con, unsigned int incr_con)
Create an Oracle pool of connections or sessions.
bool Exists() const
Check if the given file exists on server.
OCI_EXPORT boolean OCI_API OCI_BindNumber(OCI_Statement *stmt, const otext *name, OCI_Number *data)
Bind an Number variable.
OCI_EXPORT boolean OCI_API OCI_TimestampConvert(OCI_Timestamp *tmsp, OCI_Timestamp *tmsp_src)
Convert one timestamp value from one type to another.