ocilib_impl.hpp
/*
* OCILIB - C Driver for Oracle (C Wrapper for Oracle OCI)
*
* Website: http://www.ocilib.net
*
* Copyright (c) 2007-2017 Vincent ROGIER <vince.rogier@ocilib.net>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* IMPORTANT NOTICE
*
* This C++ header defines C++ wrapper classes around the OCILIB C API
* It requires a compatible version of OCILIB
*
*/
#pragma once
#include <algorithm>
namespace ocilib
{
/* ********************************************************************************************* *
* IMPLEMENTATION
* ********************************************************************************************* */
typedef Long<ostring, LongCharacter> Clong;
typedef Long<Raw, LongBinary> Blong;
template<class I, class O>
struct BindResolverType
{
typedef I InputType;
typedef O OutputType;
};
template<class T>
struct BindResolverScalarType : BindResolverType<T, T> {};
template<> struct BindResolver<bool> : BindResolverType<bool, boolean>{};
template<> struct BindResolver<short> : BindResolverScalarType<short>{};
template<> struct BindResolver<unsigned short> : BindResolverScalarType<unsigned short>{};
template<> struct BindResolver<int> : BindResolverScalarType<int>{};
template<> struct BindResolver<unsigned int> : BindResolverScalarType<unsigned int>{};
template<> struct BindResolver<big_int> : BindResolverScalarType<big_int>{};
template<> struct BindResolver<big_uint> : BindResolverScalarType<big_uint>{};
template<> struct BindResolver<float> : BindResolverScalarType<float>{};
template<> struct BindResolver<double> : BindResolverScalarType<double>{};
template<> struct BindResolver<ostring> : BindResolverType<ostring, otext>{};
template<> struct BindResolver<Raw> : BindResolverType<ostring, unsigned char>{};
template<> struct BindResolver<Number> : BindResolverType<Number, OCI_Number*>{};
template<> struct BindResolver<Date> : BindResolverType<Date, OCI_Date*>{};
template<> struct BindResolver<Timestamp> : BindResolverType<Timestamp, OCI_Timestamp*>{};
template<> struct BindResolver<Interval> : BindResolverType<Interval, OCI_Interval*>{};
template<> struct BindResolver<Clob> : BindResolverType<Clob, OCI_Lob*>{};
template<> struct BindResolver<NClob> : BindResolverType<NClob, OCI_Lob*>{};
template<> struct BindResolver<Blob> : BindResolverType<Blob, OCI_Lob*>{};
template<> struct BindResolver<File> : BindResolverType<File, OCI_File*>{};
template<> struct BindResolver<Clong> : BindResolverType<Clong, OCI_Long*>{};
template<> struct BindResolver<Blong> : BindResolverType<Blong, OCI_Long*>{};
template<> struct BindResolver<Reference> : BindResolverType<Reference, OCI_Ref*>{};
template<> struct BindResolver<Object> : BindResolverType<Object, OCI_Object*>{};
template<> struct BindResolver<Statement> : BindResolverType<Statement, OCI_Statement*>{};
template<class T> struct NumericTypeResolver{};
template<> struct NumericTypeResolver<OCI_Number*> { enum { Value = NumericNumber }; };
template<> struct NumericTypeResolver<Number> { enum { Value = NumericNumber }; };
template<> struct NumericTypeResolver<short> { enum { Value = NumericShort }; };
template<> struct NumericTypeResolver<unsigned short> { enum { Value = NumericUnsignedShort }; };
template<> struct NumericTypeResolver<int> { enum { Value = NumericInt }; };
template<> struct NumericTypeResolver<unsigned int> { enum { Value = NumericUnsignedInt }; };
template<> struct NumericTypeResolver<big_int> { enum { Value = NumericBigInt }; };
template<> struct NumericTypeResolver<big_uint> { enum { Value = NumericUnsignedBigInt }; };
template<> struct NumericTypeResolver<double> { enum { Value = NumericDouble }; };
template<> struct NumericTypeResolver<float> { enum { Value = NumericFloat }; };
template<class T>
T Check(T result)
{
OCI_Error *err = OCI_GetLastError();
if (err)
{
throw Exception(err);
}
return result;
}
inline ostring MakeString(const otext *result, int size)
{
return result ? (size >= 0 ? ostring(result, result + size) : ostring(result)) : ostring();
}
inline Raw MakeRaw(void *result, unsigned int size)
{
unsigned char *ptr = static_cast<unsigned char *>(result);
return (ptr && size > 0 ? Raw(ptr, ptr + size) : Raw());
}
template<class S, class C>
void ConverString(S &dest, const C *src, size_t length)
{
size_t i = 0;
dest.clear();
if (src)
{
dest.resize(length);
while (i < length)
{
dest[i] = static_cast<typename S::value_type>(src[i]);
++i;
}
}
}
/* --------------------------------------------------------------------------------------------- *
* Enum
* --------------------------------------------------------------------------------------------- */
template<class T>
Enum<T>::Enum() : _value(0)
{
}
template<class T>
Enum<T>::Enum(T value) : _value(value)
{
}
template<class T>
T Enum<T>::GetValue()
{
return _value;
}
template<class T>
Enum<T>::operator T ()
{
return GetValue();
}
template<class T>
Enum<T>::operator unsigned int () const
{
return static_cast<unsigned int>(_value);
}
template<class T>
bool Enum<T>::operator == (const Enum& other) const
{
return other._value == _value;
}
template<class T>
bool Enum<T>::operator != (const Enum& other) const
{
return !(*this == other);
}
template<class T>
bool Enum<T>::operator == (const T& other) const
{
return other == _value;
}
template<class T>
bool Enum<T>::operator != (const T& other) const
{
return !(*this == other);
}
/* --------------------------------------------------------------------------------------------- *
* Flags
* --------------------------------------------------------------------------------------------- */
template<class T>
Flags<T>::Flags() : _flags(static_cast<T>(0))
{
}
template<class T>
Flags<T>::Flags(T flag) : _flags( flag)
{
}
template<class T>
Flags<T>::Flags(const Flags& other) : _flags(other._flags)
{
}
template<class T>
Flags<T>::Flags(unsigned int flag) : _flags(static_cast<T>(flag))
{
}
template<class T>
Flags<T> Flags<T>::operator~ () const
{
return Flags<T>(~_flags);
}
template<class T>
Flags<T> Flags<T>::operator | (const Flags& other) const
{
return Flags<T>(_flags | other._flags);
}
template<class T>
Flags<T> Flags<T>::operator & (const Flags& other) const
{
return Flags<T>(_flags & other._flags);
}
template<class T>
Flags<T> Flags<T>::operator ^ (const Flags& other) const
{
return Flags<T>(_flags ^ other._flags);
}
template<class T>
Flags<T> Flags<T>::operator | (T other) const
{
return Flags<T>(_flags | other);
}
template<class T>
Flags<T> Flags<T>::operator & (T other) const
{
return Flags<T>(_flags & other);
}
template<class T>
Flags<T> Flags<T>::operator ^ (T other) const
{
return Flags<T>(_flags ^ other);
}
template<class T>
Flags<T>& Flags<T>::operator |= (const Flags<T>& other)
{
_flags |= other._flags;
return *this;
}
template<class T>
Flags<T>& Flags<T>::operator &= (const Flags<T>& other)
{
_flags &= other._flags;
return *this;
}
template<class T>
Flags<T>& Flags<T>::operator ^= (const Flags<T>& other)
{
_flags ^= other._flags;
return *this;
}
template<class T>
Flags<T>& Flags<T>::operator |= (T other)
{
_flags |= other;
return *this;
}
template<class T>
Flags<T>& Flags<T>::operator &= (T other)
{
_flags &= other;
return *this;
}
template<class T>
Flags<T>& Flags<T>::operator ^= (T other)
{
_flags ^= other;
return *this;
}
template<class T>
bool Flags<T>::operator == (T other) const
{
return _flags == static_cast<unsigned int>(other);
}
template<class T>
bool Flags<T>::operator == (const Flags& other) const
{
return _flags == other._flags;
}
template<class T>
bool Flags<T>::IsSet(T other) const
{
return ((_flags & other) == _flags);
}
template<class T>
unsigned int Flags<T>::GetValues() const
{
return _flags;
}
#define OCI_DEFINE_FLAG_OPERATORS(T) \
inline Flags<T> operator | (T a, T b) { return Flags<T>(a) | Flags<T>(b); } \
OCI_DEFINE_FLAG_OPERATORS(Environment::EnvironmentFlagsValues)
OCI_DEFINE_FLAG_OPERATORS(Environment::SessionFlagsValues)
OCI_DEFINE_FLAG_OPERATORS(Environment::StartFlagsValues)
OCI_DEFINE_FLAG_OPERATORS(Environment::StartModeValues)
OCI_DEFINE_FLAG_OPERATORS(Environment::ShutdownModeValues)
OCI_DEFINE_FLAG_OPERATORS(Environment::ShutdownFlagsValues)
OCI_DEFINE_FLAG_OPERATORS(Environment::AllocatedBytesValues)
OCI_DEFINE_FLAG_OPERATORS(Transaction::TransactionFlagsValues)
OCI_DEFINE_FLAG_OPERATORS(Column::PropertyFlagsValues)
OCI_DEFINE_FLAG_OPERATORS(Subscription::ChangeTypesValues)
/* --------------------------------------------------------------------------------------------- *
* ManagedBuffer
* --------------------------------------------------------------------------------------------- */
template<typename T>
ManagedBuffer<T>::ManagedBuffer() : _buffer(nullptr), _size(0)
{
}
template<typename T>
ManagedBuffer<T>::ManagedBuffer(T *buffer, size_t size) : _buffer(buffer), _size(size)
{
}
template<typename T>
ManagedBuffer<T>::ManagedBuffer(size_t size) : _buffer(new T[size]), _size(size)
{
memset(_buffer, 0, sizeof(T) * _size);
}
template<typename T>
ManagedBuffer<T>::~ManagedBuffer()
{
delete [] _buffer;
}
template<typename T>
ManagedBuffer<T>::operator T* () const
{
return _buffer;
}
template<typename T>
ManagedBuffer<T>::operator const T* () const
{
return _buffer;
}
/* --------------------------------------------------------------------------------------------- *
* Handle
* --------------------------------------------------------------------------------------------- */
template<class T>
HandleHolder<T>::HandleHolder() : _smartHandle(nullptr)
{
}
template<class T>
HandleHolder<T>::HandleHolder(const HandleHolder &other) : _smartHandle(nullptr)
{
Acquire(other, nullptr, nullptr, other._smartHandle ? other._smartHandle->GetParent() : nullptr);
}
template<class T>
HandleHolder<T>::~HandleHolder()
{
Release();
}
template<class T>
HandleHolder<T>& HandleHolder<T>::operator = (const HandleHolder<T> &other)
{
Acquire(other, nullptr, nullptr, other._smartHandle ? other._smartHandle->GetParent() : nullptr);
return *this;
}
template<class T>
bool HandleHolder<T>::IsNull() const
{
return (static_cast<T>(*this) == 0);
}
template<class T>
HandleHolder<T>::operator T()
{
return _smartHandle ? _smartHandle->GetHandle() : nullptr;
}
template<class T>
HandleHolder<T>::operator T() const
{
return _smartHandle ? _smartHandle->GetHandle() : nullptr;
}
template<class T>
HandleHolder<T>::operator bool()
{
return !IsNull();
}
template<class T>
HandleHolder<T>::operator bool() const
{
return !IsNull();
}
template<class T>
Handle * HandleHolder<T>::GetHandle() const
{
return static_cast<Handle *>(_smartHandle);
}
template<class T>
void HandleHolder<T>::Acquire(T handle, HandleFreeFunc handleFreefunc, SmartHandleFreeNotifyFunc freeNotifyFunc, Handle *parent)
{
Release();
if (handle)
{
_smartHandle = Environment::GetSmartHandle<SmartHandle*>(handle);
if (!_smartHandle)
{
_smartHandle = new SmartHandle(this, handle, handleFreefunc, freeNotifyFunc, parent);
}
else
{
_smartHandle->Acquire(this);
}
}
}
template<class T>
void HandleHolder<T>::Acquire(HandleHolder<T> &other)
{
if (&other != this && _smartHandle != other._smartHandle)
{
Release();
if (other._smartHandle)
{
other._smartHandle->Acquire(this);
_smartHandle = other._smartHandle;
}
}
}
template<class T>
void HandleHolder<T>::Release()
{
if (_smartHandle)
{
_smartHandle->Release(this);
}
_smartHandle = nullptr;
}
inline Locker::Locker() : _mutex(nullptr)
{
SetAccessMode(false);
}
inline Locker::~Locker()
{
SetAccessMode(false);
}
inline void Locker::SetAccessMode(bool threaded)
{
if (threaded && !_mutex)
{
_mutex = Mutex::Create();
}
else if (!threaded && _mutex)
{
Mutex::Destroy(_mutex);
_mutex = nullptr;
}
}
inline void Locker::Lock() const
{
if (_mutex)
{
Mutex::Acquire(_mutex);
}
}
inline void Locker::Unlock() const
{
if (_mutex)
{
Mutex::Release(_mutex);
}
}
inline Lockable::Lockable() : _locker(nullptr)
{
}
inline Lockable::~Lockable()
{
}
inline void Lockable::Lock() const
{
if (_locker)
{
_locker->Lock();
}
}
inline void Lockable::Unlock() const
{
if (_locker)
{
_locker->Unlock();
}
}
inline void Lockable::SetLocker(Locker *locker)
{
_locker = locker;
}
template<class K, class V>
ConcurrentMap<K, V>::ConcurrentMap()
{
}
template<class K, class V>
ConcurrentMap<K, V>::~ConcurrentMap()
{
Clear();
}
template<class K, class V>
void ConcurrentMap<K, V>::Remove(K key)
{
Lock();
_map.erase(key);
Unlock();
}
template<class K, class V>
V ConcurrentMap<K, V>::Get(K key)
{
V value = 0;
Lock();
typename std::map< K, V >::const_iterator it = _map.find(key);
if (it != _map.end())
{
value = it->second;
}
Unlock();
return value;
}
template<class K, class V>
void ConcurrentMap<K, V>::Set(K key, V value)
{
Lock();
_map[key] = value;
Unlock();
}
template<class K, class V>
void ConcurrentMap<K, V>::Clear()
{
Lock();
_map.clear();
Unlock();
}
template<class K, class V>
size_t ConcurrentMap<K, V>::GetSize()
{
Lock();
size_t size = _map.size();
Unlock();
return size;
}
template<class T>
ConcurrentList<T>::ConcurrentList()
{
}
template<class T>
ConcurrentList<T>::~ConcurrentList()
{
Clear();
}
template<class T>
void ConcurrentList<T>::Add(T value)
{
Lock();
_list.push_back(value);
Unlock();
}
template<class T>
void ConcurrentList<T>::Remove(T value)
{
Lock();
_list.remove(value);
Unlock();
}
template<class T>
void ConcurrentList<T>::Clear()
{
Lock();
_list.clear();
Unlock();
}
template<class T>
size_t ConcurrentList<T>::GetSize()
{
Lock();
size_t size = _list.size();
Unlock();
return size;
}
template<class T>
bool ConcurrentList<T>::Exists(const T &value)
{
Lock();
bool res = std::find(_list.begin(), _list.end(), value) != _list.end();
Unlock();
return res;
}
template<class T>
template<class P>
bool ConcurrentList<T>::FindIf(P predicate, T &value)
{
bool res = false;
Lock();
typename std::list<T>::iterator it = std::find_if(_list.begin(), _list.end(), predicate);
if (it != _list.end())
{
value = *it;
res = true;
}
Unlock();
return res;
}
template<class T>
template<class A>
void ConcurrentList<T>::ForEach(A action)
{
Lock();
std::for_each(_list.begin(), _list.end(), action);
Unlock();
}
template<class T>
HandleHolder<T>::SmartHandle::SmartHandle
(
HandleHolder *holder, T handle, HandleFreeFunc handleFreefunc,
SmartHandleFreeNotifyFunc freeNotifyFunc, Handle *parent
)
: _holders(), _children(), _locker(), _handle(handle), _handleFreeFunc(handleFreefunc),
_freeNotifyFunc(freeNotifyFunc), _parent(parent), _extraInfo(nullptr)
{
_locker.SetAccessMode((Environment::GetMode() & Environment::Threaded) == Environment::Threaded);
_holders.SetLocker(&_locker);
_children.SetLocker(&_locker);
Environment::SetSmartHandle<SmartHandle*>(handle, this);
Acquire(holder);
if (_parent && _handle)
{
_parent->GetChildren().Add(this);
}
}
template<class T>
HandleHolder<T>::SmartHandle::~SmartHandle()
{
boolean ret = TRUE;
boolean chk = FALSE;
if (_parent && _handle)
{
_parent->GetChildren().Remove(this);
}
_children.ForEach(DeleteHandle);
_children.Clear();
_holders.SetLocker(nullptr);
_children.SetLocker(nullptr);
Environment::SetSmartHandle<SmartHandle*>(_handle, nullptr);
if (_freeNotifyFunc)
{
_freeNotifyFunc(this);
}
if (_handleFreeFunc && _handle)
{
ret = _handleFreeFunc(_handle);
chk = TRUE;
}
if (chk)
{
Check(ret);
}
}
template<class T>
void HandleHolder<T>::SmartHandle::DeleteHandle(Handle *handle)
{
if (handle)
{
handle->DetachFromParent();
handle->DetachFromHolders();
delete handle;
}
}
template<class T>
void HandleHolder<T>::SmartHandle::ResetHolder(HandleHolder *holder)
{
if (holder)
{
holder->_smartHandle = 0;
}
}
template<class T>
void HandleHolder<T>::SmartHandle::Acquire(HandleHolder *holder)
{
_holders.Add(holder);
}
template<class T>
void HandleHolder<T>::SmartHandle::Release(HandleHolder *holder)
{
_holders.Remove(holder);
if (_holders.GetSize() == 0)
{
delete this;
}
holder->_smartHandle = nullptr;
}
template<class T>
T HandleHolder<T>::SmartHandle::GetHandle() const
{
return _handle;
}
template<class T>
Handle * HandleHolder<T>::SmartHandle::GetParent() const
{
return _parent;
}
template<class T>
AnyPointer HandleHolder<T>::SmartHandle::GetExtraInfos() const
{
return _extraInfo;
}
template<class T>
void HandleHolder<T>::SmartHandle::SetExtraInfos(AnyPointer extraInfo)
{
_extraInfo = extraInfo;
}
template<class T>
ConcurrentList<Handle *> & HandleHolder<T>::SmartHandle::GetChildren()
{
return _children;
}
template<class T>
void HandleHolder<T>::SmartHandle::DetachFromHolders()
{
_holders.ForEach(ResetHolder);
_holders.Clear();
}
template<class T>
void HandleHolder<T>::SmartHandle::DetachFromParent()
{
_parent = nullptr;
}
/* --------------------------------------------------------------------------------------------- *
* Exception
* --------------------------------------------------------------------------------------------- */
inline Exception::Exception()
: _what(),
_pStatement(nullptr),
_pConnnection(nullptr),
_row(0),
_type(static_cast<ExceptionType::Type>(0)),
_errLib(0),
_errOracle(0)
{
}
inline Exception::~Exception() throw ()
{
}
inline Exception::Exception(OCI_Error *err)
: _what(),
_pStatement(OCI_ErrorGetStatement(err)),
_pConnnection(OCI_ErrorGetConnection(err)),
_row(OCI_ErrorGetRow(err)),
_type(static_cast<ExceptionType::Type>(OCI_ErrorGetType(err))),
_errLib(OCI_ErrorGetInternalCode(err)),
_errOracle(OCI_ErrorGetOCICode(err))
{
const otext *str = OCI_ErrorGetString(err);
if (str)
{
ConverString(_what, str, ostrlen(str));
}
}
inline const char * Exception::what() const throw()
{
return _what.c_str();
}
inline ostring Exception::GetMessage() const
{
ostring message;
#ifdef OCI_CHARSET_WIDE
ConverString(message, _what.c_str(), _what.size());
#else
message = _what;
#endif
return message;
}
inline Exception::ExceptionType Exception::GetType() const
{
return _type;
}
inline int Exception::GetOracleErrorCode() const
{
return _errOracle;
}
inline int Exception::GetInternalErrorCode() const
{
return _errLib;
}
inline Statement Exception::GetStatement() const
{
return Statement(_pStatement, nullptr);
}
inline Connection Exception::GetConnection() const
{
return Connection(_pConnnection, nullptr);
}
inline unsigned int Exception::GetRow() const
{
return _row;
}
/* --------------------------------------------------------------------------------------------- *
* Environment
* --------------------------------------------------------------------------------------------- */
inline void Environment::Initialize(EnvironmentFlags mode, const ostring& libpath)
{
GetInstance().SelfInitialize(mode, libpath);
}
inline void Environment::Cleanup()
{
GetInstance().SelfCleanup();
}
inline Environment::EnvironmentFlags Environment::GetMode()
{
return GetInstance()._mode;
}
inline Environment::ImportMode Environment::GetImportMode()
{
return ImportMode(static_cast<ImportMode::Type>(Check(OCI_GetImportMode())));
}
inline Environment::CharsetMode Environment::GetCharset()
{
return CharsetMode(static_cast<CharsetMode::Type>(Check(OCI_GetCharset())));
}
inline big_uint Environment::GetAllocatedBytes(AllocatedBytesFlags type)
{
return Check(OCI_GetAllocatedBytes(type.GetValues()));
}
inline bool Environment::Initialized()
{
return GetInstance()._initialized;
}
inline OracleVersion Environment::GetCompileVersion()
{
return OracleVersion(static_cast<OracleVersion::Type>(Check(OCI_GetOCICompileVersion())));
}
inline OracleVersion Environment::GetRuntimeVersion()
{
return OracleVersion(static_cast<OracleVersion::Type>(Check(OCI_GetOCIRuntimeVersion())));
}
inline unsigned int Environment::GetCompileMajorVersion()
{
return OCI_VER_MAJ(Check(OCI_GetOCICompileVersion()));
}
inline unsigned int Environment::GetCompileMinorVersion()
{
return OCI_VER_MIN(Check(OCI_GetOCICompileVersion()));
}
inline unsigned int Environment::GetCompileRevisionVersion()
{
return OCI_VER_REV(Check(OCI_GetOCICompileVersion()));
}
inline unsigned int Environment::GetRuntimeMajorVersion()
{
return OCI_VER_MAJ(Check(OCI_GetOCIRuntimeVersion()));
}
inline unsigned int Environment::GetRuntimeMinorVersion()
{
return OCI_VER_MIN(Check(OCI_GetOCIRuntimeVersion()));
}
inline unsigned int Environment::GetRuntimeRevisionVersion()
{
return OCI_VER_REV(Check(OCI_GetOCIRuntimeVersion()));
}
inline void Environment::EnableWarnings(bool value)
{
OCI_EnableWarnings(static_cast<boolean>(value));
}
inline bool Environment::SetFormat(FormatType formatType, const ostring& format)
{
return Check(OCI_SetFormat(nullptr, formatType, format.c_str()) == TRUE);
}
inline ostring Environment::GetFormat(FormatType formatType)
{
return MakeString(Check(OCI_GetFormat(nullptr, formatType)));
}
inline void Environment::StartDatabase(const ostring& db, const ostring& user, const ostring &pwd, Environment::StartFlags startFlags,
Environment::StartMode startMode, Environment::SessionFlags sessionFlags, const ostring& spfile)
{
Check(OCI_DatabaseStartup(db.c_str(), user.c_str(), pwd.c_str(), sessionFlags.GetValues(),
startMode.GetValues(), startFlags.GetValues(), spfile.c_str() ));
}
inline void Environment::ShutdownDatabase(const ostring& db, const ostring& user, const ostring &pwd, Environment::ShutdownFlags shutdownFlags,
Environment::ShutdownMode shutdownMode, Environment::SessionFlags sessionFlags)
{
Check(OCI_DatabaseShutdown(db.c_str(), user.c_str(), pwd.c_str(), sessionFlags.GetValues(),
shutdownMode.GetValues(), shutdownFlags.GetValues() ));
}
inline void Environment::ChangeUserPassword(const ostring& db, const ostring& user, const ostring& pwd, const ostring& newPwd)
{
Check(OCI_SetUserPassword(db.c_str(), user.c_str(), pwd.c_str(), newPwd.c_str()));
}
inline void Environment::SetHAHandler(HAHandlerProc handler)
{
Check(OCI_SetHAHandler(static_cast<POCI_HA_HANDLER>(handler != nullptr ? Environment::HAHandler : nullptr)));
Environment::SetUserCallback<HAHandlerProc>(GetEnvironmentHandle(), handler);
}
inline void Environment::HAHandler(OCI_Connection *pConnection, unsigned int source, unsigned int event, OCI_Timestamp *pTimestamp)
{
HAHandlerProc handler = Environment::GetUserCallback<HAHandlerProc>(GetEnvironmentHandle());
if (handler)
{
Connection connection(pConnection, nullptr);
Timestamp timestamp(pTimestamp, connection.GetHandle());
handler(connection,
HAEventSource(static_cast<HAEventSource::Type>(source)),
HAEventType (static_cast<HAEventType::Type> (event)),
timestamp);
}
}
inline unsigned int Environment::TAFHandler(OCI_Connection *pConnection, unsigned int type, unsigned int event)
{
unsigned int res = OCI_FOC_OK;
Connection::TAFHandlerProc handler = Environment::GetUserCallback<Connection::TAFHandlerProc>(Check(pConnection));
if (handler)
{
Connection connection(pConnection, nullptr);
res = handler(connection,
Connection::FailoverRequest( static_cast<Connection::FailoverRequest::Type> (type)),
Connection::FailoverEvent ( static_cast<Connection::FailoverEvent::Type> (event)));
}
return res;
}
inline void Environment::NotifyHandler(OCI_Event *pEvent)
{
Subscription::NotifyHandlerProc handler = Environment::GetUserCallback<Subscription::NotifyHandlerProc>((Check(OCI_EventGetSubscription(pEvent))));
if (handler)
{
Event evt(pEvent);
handler(evt);
}
}
inline void Environment::NotifyHandlerAQ(OCI_Dequeue *pDequeue)
{
Dequeue::NotifyAQHandlerProc handler = Environment::GetUserCallback<Dequeue::NotifyAQHandlerProc>(Check(pDequeue));
if (handler)
{
Dequeue dequeue(pDequeue);
handler(dequeue);
}
}
template<class T>
T Environment::GetUserCallback(AnyPointer ptr)
{
return reinterpret_cast<T>(GetInstance()._callbacks.Get(ptr));
}
template<class T>
void Environment::SetUserCallback(AnyPointer ptr, T callback)
{
if (callback)
{
GetInstance()._callbacks.Set(ptr, reinterpret_cast<CallbackPointer>(callback));
}
else
{
GetInstance()._callbacks.Remove(ptr);
}
}
template<class T>
void Environment::SetSmartHandle(AnyPointer ptr, T handle)
{
if (handle)
{
GetInstance()._handles.Set(ptr, handle);
}
else
{
GetInstance()._handles.Remove(ptr);
}
}
template<class T>
T Environment::GetSmartHandle(AnyPointer ptr)
{
return dynamic_cast<T>(GetInstance()._handles.Get(ptr));
}
inline Handle * Environment::GetEnvironmentHandle()
{
return GetInstance()._handle.GetHandle();
}
inline Environment& Environment::GetInstance()
{
static Environment envHandle;
return envHandle;
}
inline Environment::Environment() : _locker(), _handle(), _handles(), _callbacks(), _mode(), _initialized(false)
{
}
inline void Environment::SelfInitialize(EnvironmentFlags mode, const ostring& libpath)
{
_mode = mode;
Check(OCI_Initialize(nullptr, libpath.c_str(), _mode.GetValues() | OCI_ENV_CONTEXT));
_initialized = true;
_locker.SetAccessMode((_mode & Environment::Threaded) == Environment::Threaded);
_callbacks.SetLocker(&_locker);
_handles.SetLocker(&_locker);
_handle.Acquire(const_cast<AnyPointer>(Check(OCI_HandleGetEnvironment())), nullptr, nullptr, nullptr);
}
inline void Environment::SelfCleanup()
{
_locker.SetAccessMode(false);
_callbacks.SetLocker(nullptr);
_handles.SetLocker(nullptr);
_handle.Release();
if (_initialized)
{
Check(OCI_Cleanup());
}
_initialized = false;
}
/* --------------------------------------------------------------------------------------------- *
* Mutex
* --------------------------------------------------------------------------------------------- */
inline MutexHandle Mutex::Create()
{
return Environment::GetInstance().Initialized() ? Check(OCI_MutexCreate()) : nullptr;
}
inline void Mutex::Destroy(MutexHandle mutex)
{
Check(OCI_MutexFree(mutex));
}
inline void Mutex::Acquire(MutexHandle mutex)
{
Check(OCI_MutexAcquire(mutex));
}
inline void Mutex::Release(MutexHandle mutex)
{
Check(OCI_MutexRelease(mutex));
}
/* --------------------------------------------------------------------------------------------- *
* Thread
* --------------------------------------------------------------------------------------------- */
inline ThreadHandle Thread::Create()
{
return Check(OCI_ThreadCreate());
}
inline void Thread::Destroy(ThreadHandle handle)
{
Check(OCI_ThreadFree(handle));
}
inline void Thread::Run(ThreadHandle handle, ThreadProc func, AnyPointer args)
{
Check(OCI_ThreadRun(handle, func, args));
}
inline void Thread::Join(ThreadHandle handle)
{
Check(OCI_ThreadJoin(handle));
}
inline ThreadId Thread::GetThreadId(ThreadHandle handle)
{
return Check(OCI_HandleGetThreadID(handle));
}
/* --------------------------------------------------------------------------------------------- *
* ThreadKey
* --------------------------------------------------------------------------------------------- */
inline void ThreadKey::Create(const ostring& name, ThreadKeyFreeProc freeProc)
{
Check(OCI_ThreadKeyCreate(name.c_str(), freeProc));
}
inline void ThreadKey::SetValue(const ostring& name, AnyPointer value)
{
Check(OCI_ThreadKeySetValue(name.c_str(), value));
}
inline AnyPointer ThreadKey::GetValue(const ostring& name)
{
return Check(OCI_ThreadKeyGetValue(name.c_str()));
}
/* --------------------------------------------------------------------------------------------- *
* Pool
* --------------------------------------------------------------------------------------------- */
inline Pool::Pool()
{
}
inline Pool::Pool(const ostring& db, const ostring& user, const ostring& pwd, Pool::PoolType poolType,
unsigned int minSize, unsigned int maxSize, unsigned int increment, Environment::SessionFlags sessionFlags)
{
Open(db, user, pwd, poolType, minSize, maxSize, increment, sessionFlags);
}
inline void Pool::Open(const ostring& db, const ostring& user, const ostring& pwd, Pool::PoolType poolType,
unsigned int minSize, unsigned int maxSize, unsigned int increment, Environment::SessionFlags sessionFlags)
{
Release();
Acquire(Check(OCI_PoolCreate(db.c_str(), user.c_str(), pwd.c_str(), poolType, sessionFlags.GetValues(),
minSize, maxSize, increment)), reinterpret_cast<HandleFreeFunc>(OCI_PoolFree), nullptr, Environment::GetEnvironmentHandle());
}
inline void Pool::Close()
{
Release();
}
inline Connection Pool::GetConnection(const ostring& sessionTag)
{
return Connection(Check( OCI_PoolGetConnection(*this, sessionTag.c_str())), GetHandle());
}
inline unsigned int Pool::GetTimeout() const
{
return Check( OCI_PoolGetTimeout(*this));
}
inline void Pool::SetTimeout(unsigned int value)
{
Check( OCI_PoolSetTimeout(*this, value));
}
inline bool Pool::GetNoWait() const
{
return (Check( OCI_PoolGetNoWait(*this)) == TRUE);
}
inline void Pool::SetNoWait(bool value)
{
Check( OCI_PoolSetNoWait(*this, value));
}
inline unsigned int Pool::GetBusyConnectionsCount() const
{
return Check( OCI_PoolGetBusyCount(*this));
}
inline unsigned int Pool::GetOpenedConnectionsCount() const
{
return Check( OCI_PoolGetOpenedCount(*this));
}
inline unsigned int Pool::GetMinSize() const
{
return Check( OCI_PoolGetMin(*this));
}
inline unsigned int Pool::GetMaxSize() const
{
return Check( OCI_PoolGetMax(*this));
}
inline unsigned int Pool::GetIncrement() const
{
return Check( OCI_PoolGetIncrement(*this));
}
inline unsigned int Pool::GetStatementCacheSize() const
{
return Check( OCI_PoolGetStatementCacheSize(*this));
}
inline void Pool::SetStatementCacheSize(unsigned int value)
{
Check( OCI_PoolSetStatementCacheSize(*this, value));
}
/* --------------------------------------------------------------------------------------------- *
* Connection
* --------------------------------------------------------------------------------------------- */
inline Connection::Connection()
{
}
inline Connection::Connection(const ostring& db, const ostring& user, const ostring& pwd, Environment::SessionFlags sessionFlags)
{
Open(db, user, pwd, sessionFlags);
}
inline Connection::Connection(OCI_Connection *con, Handle *parent)
{
Acquire(con, reinterpret_cast<HandleFreeFunc>(parent ? OCI_ConnectionFree : nullptr), nullptr, parent);
}
inline void Connection::Open(const ostring& db, const ostring& user, const ostring& pwd, Environment::SessionFlags sessionFlags)
{
Acquire(Check(OCI_ConnectionCreate(db.c_str(), user.c_str(), pwd.c_str(), sessionFlags.GetValues())),
reinterpret_cast<HandleFreeFunc>(OCI_ConnectionFree), nullptr, Environment::GetEnvironmentHandle());
}
inline void Connection::Close()
{
Release();
}
inline void Connection::Commit()
{
Check(OCI_Commit(*this));
}
inline void Connection::Rollback()
{
Check(OCI_Rollback(*this));
}
inline void Connection::Break()
{
Check(OCI_Break(*this));
}
inline void Connection::SetAutoCommit(bool enabled)
{
Check(OCI_SetAutoCommit(*this, enabled));
}
inline bool Connection::GetAutoCommit() const
{
return (Check(OCI_GetAutoCommit(*this)) == TRUE);
}
inline bool Connection::IsServerAlive() const
{
return (Check(OCI_IsConnected(*this)) == TRUE);
}
inline bool Connection::PingServer() const
{
return( Check(OCI_Ping(*this)) == TRUE);
}
inline ostring Connection::GetConnectionString() const
{
return MakeString(Check(OCI_GetDatabase(*this)));
}
inline ostring Connection::GetUserName() const
{
return MakeString(Check(OCI_GetUserName(*this)));
}
inline ostring Connection::GetPassword() const
{
return MakeString(Check(OCI_GetPassword(*this)));
}
inline OracleVersion Connection::GetVersion() const
{
return OracleVersion(static_cast<OracleVersion::Type>(Check(OCI_GetVersionConnection(*this))));
}
inline ostring Connection::GetServerVersion() const
{
return MakeString(Check( OCI_GetVersionServer(*this)));
}
inline unsigned int Connection::GetServerMajorVersion() const
{
return Check(OCI_GetServerMajorVersion(*this));
}
inline unsigned int Connection::GetServerMinorVersion() const
{
return Check(OCI_GetServerMinorVersion(*this));
}
inline unsigned int Connection::GetServerRevisionVersion() const
{
return Check(OCI_GetServerRevisionVersion(*this));
}
inline void Connection::ChangePassword(const ostring& newPwd)
{
Check(OCI_SetPassword(*this, newPwd.c_str()));
}
inline ostring Connection::GetSessionTag() const
{
return MakeString(Check(OCI_GetSessionTag(*this)));
}
inline void Connection::SetSessionTag(const ostring& tag)
{
Check(OCI_SetSessionTag(*this, tag.c_str()));
}
inline Transaction Connection::GetTransaction() const
{
return Transaction(Check(OCI_GetTransaction(*this)));
}
inline void Connection::SetTransaction(const Transaction &transaction)
{
Check(OCI_SetTransaction(*this, transaction));
}
inline bool Connection::SetFormat(FormatType formatType, const ostring& format)
{
return Check(OCI_SetFormat(*this, formatType, format.c_str()) == TRUE);
}
inline ostring Connection::GetFormat(FormatType formatType)
{
return MakeString(Check(OCI_GetFormat(*this, formatType)));
}
inline void Connection::EnableServerOutput(unsigned int bufsize, unsigned int arrsize, unsigned int lnsize)
{
Check(OCI_ServerEnableOutput(*this, bufsize, arrsize, lnsize));
}
inline void Connection::DisableServerOutput()
{
Check(OCI_ServerDisableOutput(*this));
}
inline bool Connection::GetServerOutput(ostring &line) const
{
const otext * str = Check(OCI_ServerGetOutput(*this));
line = MakeString(str);
return (str != nullptr);
}
inline void Connection::GetServerOutput(std::vector<ostring> &lines) const
{
const otext * str = Check(OCI_ServerGetOutput(*this));
while (str)
{
lines.push_back(str);
str = Check(OCI_ServerGetOutput(*this));
}
}
inline void Connection::SetTrace(SessionTrace trace, const ostring& value)
{
Check(OCI_SetTrace(*this, trace, value.c_str()));
}
inline ostring Connection::GetTrace(SessionTrace trace) const
{
return MakeString(Check(OCI_GetTrace(*this, trace)));
}
inline ostring Connection::GetDatabase() const
{
return MakeString(Check(OCI_GetDBName(*this)));
}
inline ostring Connection::GetInstance() const
{
return Check(OCI_GetInstanceName(*this));
}
inline ostring Connection::GetService() const
{
return MakeString(Check(OCI_GetServiceName(*this)));
}
inline ostring Connection::GetServer() const
{
return Check(OCI_GetServerName(*this));
}
inline ostring Connection::GetDomain() const
{
return MakeString(Check(OCI_GetDomainName(*this)));
}
inline Timestamp Connection::GetInstanceStartTime() const
{
return Timestamp(Check(OCI_GetInstanceStartTime(*this)), GetHandle());
}
inline unsigned int Connection::GetStatementCacheSize() const
{
return Check(OCI_GetStatementCacheSize(*this));
}
inline void Connection::SetStatementCacheSize(unsigned int value)
{
Check(OCI_SetStatementCacheSize(*this, value));
}
inline unsigned int Connection::GetDefaultLobPrefetchSize() const
{
return Check(OCI_GetDefaultLobPrefetchSize(*this));
}
inline void Connection::SetDefaultLobPrefetchSize(unsigned int value)
{
Check(OCI_SetDefaultLobPrefetchSize(*this, value));
}
inline unsigned int Connection::GetMaxCursors() const
{
return Check(OCI_GetMaxCursors(*this));
}
inline bool Connection::IsTAFCapable() const
{
return (Check(OCI_IsTAFCapable(*this)) == TRUE);
}
inline void Connection::SetTAFHandler(TAFHandlerProc handler)
{
Check(OCI_SetTAFHandler(*this, static_cast<POCI_TAF_HANDLER>(handler != nullptr ? Environment::TAFHandler : nullptr)));
Environment::SetUserCallback<Connection::TAFHandlerProc>(static_cast< OCI_Connection*>(*this), handler);
}
inline void* Connection::GetUserData()
{
return Check(OCI_GetUserData(*this));
}
inline void Connection::SetUserData(AnyPointer value)
{
Check(OCI_SetUserData(*this, value));
}
/* --------------------------------------------------------------------------------------------- *
* Transaction
* --------------------------------------------------------------------------------------------- */
inline Transaction::Transaction(const Connection &connection, unsigned int timeout, TransactionFlags flags, OCI_XID *pxid)
{
Acquire(Check(OCI_TransactionCreate(connection, timeout, flags.GetValues(), pxid)), reinterpret_cast<HandleFreeFunc>(OCI_TransactionFree), nullptr, nullptr);
}
inline Transaction::Transaction(OCI_Transaction *trans)
{
Acquire(trans, nullptr, nullptr, nullptr);
}
inline void Transaction::Prepare()
{
Check(OCI_TransactionPrepare(*this));
}
inline void Transaction::Start()
{
Check(OCI_TransactionStart(*this));
}
inline void Transaction::Stop()
{
Check(OCI_TransactionStop(*this));
}
inline void Transaction::Resume()
{
Check(OCI_TransactionResume(*this));
}
inline void Transaction::Forget()
{
Check(OCI_TransactionForget(*this));
}
inline Transaction::TransactionFlags Transaction::GetFlags() const
{
return TransactionFlags(static_cast<TransactionFlags::Type>(Check(OCI_TransactionGetMode(*this))));
}
inline unsigned int Transaction::GetTimeout() const
{
return Check(OCI_TransactionGetTimeout(*this));
}
/* --------------------------------------------------------------------------------------------- *
* Number
* --------------------------------------------------------------------------------------------- */
inline Number::Number(bool create)
{
if (create)
{
Allocate();
}
}
inline Number::Number(OCI_Number *pNumber, Handle *parent)
{
Acquire(pNumber, nullptr, nullptr, parent);
}
inline Number::Number(const ostring& str, const ostring& format)
{
Allocate();
FromString(str, format);
}
inline Number::Number(const otext* str, const otext* format)
{
Allocate();
FromString(str, format);
}
inline void Number::Allocate()
{
Acquire(Check(OCI_NumberCreate(nullptr)), reinterpret_cast<HandleFreeFunc>(OCI_NumberFree), nullptr, nullptr);
}
inline void Number::FromString(const ostring& str, const ostring& format) const
{
Check(OCI_NumberFromText(*this, str.c_str(), format.size() > 0 ? format.c_str() : Environment::GetFormat(FormatNumeric).c_str()));
}
inline ostring Number::ToString(const ostring& format) const
{
if (!IsNull())
{
size_t size = OCI_SIZE_BUFFER;
ManagedBuffer<otext> buffer(size + 1);
Check(OCI_NumberToText(*this, format.c_str(), static_cast<int>(size), buffer));
return MakeString(static_cast<const otext *>(buffer));
}
return OCI_STRING_NULL;
}
inline ostring Number::ToString() const
{
return ToString(Environment::GetFormat(FormatNumeric));
}
inline Number Number::Clone() const
{
Number result;
result.Allocate();
Check(OCI_NumberAssign(result, *this));
return result;
}
inline int Number::Compare(const Number& other) const
{
return Check(OCI_NumberCompare(*this, other));
}
template<class T>
T Number::GetValue() const
{
T value;
Check(OCI_NumberGetValue(*this, NumericTypeResolver<T>::Value, &value));
return value;
}
template<class T>
Number& Number::SetValue(const T &value)
{
if (IsNull())
{
Allocate();
}
Check(OCI_NumberSetValue(*this, NumericTypeResolver<T>::Value, reinterpret_cast<void*>(const_cast<T*>(&value))));
return *this;
}
template<class T>
void Number::Add(const T &value)
{
Check(OCI_NumberAdd(*this, NumericTypeResolver<T>::Value, reinterpret_cast<void*>(const_cast<T*>(&value))));
}
template<class T>
void Number::Sub(const T &value)
{
Check(OCI_NumberSub(*this, NumericTypeResolver<T>::Value, reinterpret_cast<void*>(const_cast<T*>(&value))));
}
template<class T>
void Number::Multiply(const T &value)
{
Check(OCI_NumberMultiply(*this, NumericTypeResolver<T>::Value, reinterpret_cast<void*>(const_cast<T*>(&value))));
}
template<class T>
void Number::Divide(const T &value)
{
Check(OCI_NumberDivide(*this, NumericTypeResolver<T>::Value, reinterpret_cast<void*>(const_cast<T*>(&value))));
}
inline Number& Number::operator = (OCI_Number * &lhs)
{
Acquire(lhs, reinterpret_cast<HandleFreeFunc>(OCI_NumberFree), nullptr, nullptr);
return *this;
}
template<class T>
Number& Number::operator = (const T &lhs)
{
SetValue<T>(lhs);
return *this;
}
template<class T>
Number::operator T() const
{
return GetValue<T>();
}
template<class T>
Number Number::operator + (const T &value)
{
Number result = Clone();
result.Add(value);
return result;
}
template<class T>
Number Number::operator - (const T &value)
{
Number result = Clone();
result.Sub(value);
return result;
}
template<class T>
Number Number::operator * (const T &value)
{
Number result = Clone();
result.Multiply(value);
return result;
}
template<class T>
Number Number::operator / (const T &value)
{
Number result = Clone();
result.Divide(value);
return result;
}
template<class T>
Number& Number::operator += (const T &value)
{
Add<T>(value);
return *this;
}
template<class T>
Number& Number::operator -= (const T &value)
{
Sub<T>(value);
return *this;
}
template<class T>
Number& Number::operator *= (const T &value)
{
Multiply<T>(value);
return *this;
}
template<class T>
Number& Number::operator /= (const T &value)
{
Divide<T>(value);
return *this;
}
inline Number& Number::operator ++ ()
{
return *this += 1;
}
inline Number& Number::operator -- ()
{
return *this += 1;
}
inline Number Number::operator ++ (int)
{
return *this + 1;
}
inline Number Number::operator -- (int)
{
return *this - 1;
}
inline bool Number::operator == (const Number& other) const
{
return Compare(other) == 0;
}
inline bool Number::operator != (const Number& other) const
{
return !(*this == other);
}
inline bool Number::operator > (const Number& other) const
{
return Compare(other) > 0;
}
inline bool Number::operator < (const Number& other) const
{
return Compare(other) < 0;
}
inline bool Number::operator >= (const Number& other) const
{
int res = Compare(other);
return res == 0 || res < 0;
}
inline bool Number::operator <= (const Number& other) const
{
int res = Compare(other);
return res == 0 || res > 0;
}
/* --------------------------------------------------------------------------------------------- *
* Date
* --------------------------------------------------------------------------------------------- */
inline Date::Date(bool create)
{
if (create)
{
Allocate();
}
}
inline Date::Date(const ostring& str, const ostring& format)
{
Allocate();
FromString(str, format);
}
inline Date::Date(const otext* str, const otext* format)
{
Allocate();
FromString(str, format);
}
inline Date::Date(OCI_Date *pDate, Handle *parent)
{
Acquire(pDate, nullptr, nullptr, parent);
}
inline void Date::Allocate()
{
Acquire(Check(OCI_DateCreate(nullptr)), reinterpret_cast<HandleFreeFunc>(OCI_DateFree), nullptr, nullptr);
}
inline Date Date::SysDate()
{
Date result;
result.Allocate();
Check(OCI_DateSysDate(result));
return result;
}
inline Date Date::Clone() const
{
Date result;
result.Allocate();
Check(OCI_DateAssign(result, *this));
return result;
}
inline int Date::Compare(const Date& other) const
{
return Check(OCI_DateCompare(*this, other));
}
inline bool Date::IsValid() const
{
return (Check(OCI_DateCheck(*this)) == 0);
}
inline int Date::GetYear() const
{
int year = 0, month = 0, day = 0;
GetDate(year, month, day);
return year;
}
inline void Date::SetYear(int value)
{
int year = 0, month = 0, day = 0;
GetDate(year, month, day);
SetDate(value, month, day);
}
inline int Date::GetMonth() const
{
int year = 0, month = 0, day = 0;
GetDate(year, month, day);
return month;
}
inline void Date::SetMonth(int value)
{
int year = 0, month = 0, day = 0;
GetDate(year, month, day);
SetDate(year, value, day);
}
inline int Date::GetDay() const
{
int year = 0, month = 0, day = 0;
GetDate(year, month, day);
return day;
}
inline void Date::SetDay(int value)
{
int year = 0, month = 0, day = 0;
GetDate(year, month, day);
SetDate(year, month, value);
}
inline int Date::GetHours() const
{
int hour = 0, minutes = 0, seconds = 0;
GetTime(hour, minutes, seconds);
return hour;
}
inline void Date::SetHours(int value)
{
int hour = 0, minutes = 0, seconds = 0;
GetTime(hour, minutes, seconds);
SetTime(value, minutes, seconds);
}
inline int Date::GetMinutes() const
{
int hour = 0, minutes = 0, seconds = 0;
GetTime(hour, minutes, seconds);
return minutes;
}
inline void Date::SetMinutes(int value)
{
int hour = 0, minutes = 0, seconds = 0;
GetTime(hour, minutes, seconds);
SetTime(hour, value, seconds);
}
inline int Date::GetSeconds() const
{
int hour = 0, minutes = 0, seconds = 0;
GetTime(hour, minutes, seconds);
return seconds;
}
inline void Date::SetSeconds(int value)
{
int hour = 0, minutes = 0, seconds = 0;
GetTime(hour, minutes, seconds);
SetTime(hour, minutes, value);
}
inline int Date::DaysBetween(const Date& other) const
{
return Check(OCI_DateDaysBetween(*this, other));
}
inline void Date::SetDate(int year, int month, int day)
{
Check(OCI_DateSetDate(*this, year, month, day));
}
inline void Date::SetTime(int hour, int min, int sec)
{
Check(OCI_DateSetTime(*this, hour, min , sec));
}
inline void Date::SetDateTime(int year, int month, int day, int hour, int min, int sec)
{
Check(OCI_DateSetDateTime(*this, year, month, day, hour, min , sec));
}
inline void Date::GetDate(int &year, int &month, int &day) const
{
Check(OCI_DateGetDate(*this, &year, &month, &day));
}
inline void Date::GetTime(int &hour, int &min, int &sec) const
{
Check(OCI_DateGetTime(*this, &hour, &min , &sec));
}
inline void Date::GetDateTime(int &year, int &month, int &day, int &hour, int &min, int &sec) const
{
Check(OCI_DateGetDateTime(*this, &year, &month, &day, &hour, &min , &sec));
}
inline void Date::AddDays(int days)
{
Check(OCI_DateAddDays(*this, days));
}
inline void Date::AddMonths(int months)
{
OCI_DateAddMonths(*this, months);
}
inline Date Date::NextDay(const ostring& day) const
{
Date result = Clone();
Check(OCI_DateNextDay(result, day.c_str()));
return result;
}
inline Date Date::LastDay() const
{
Date result = Clone();
Check(OCI_DateLastDay(result));
return result;
}
inline void Date::ChangeTimeZone(const ostring& tzSrc, const ostring& tzDst)
{
Check(OCI_DateZoneToZone(*this, tzSrc.c_str(), tzDst.c_str()));
}
inline void Date::FromString(const ostring& str, const ostring& format)
{
Check(OCI_DateFromText(*this, str.c_str(), format.size() > 0 ? format.c_str() : Environment::GetFormat(FormatDate).c_str()));
}
inline ostring Date::ToString(const ostring& format) const
{
if (!IsNull())
{
size_t size = OCI_SIZE_BUFFER;
ManagedBuffer<otext> buffer(size + 1);
Check(OCI_DateToText(*this, format.c_str(), static_cast<int>(size), buffer));
return MakeString(static_cast<const otext *>(buffer));
}
return OCI_STRING_NULL;
}
inline ostring Date::ToString() const
{
return ToString(Environment::GetFormat(FormatDate));
}
inline Date& Date::operator ++ ()
{
return *this += 1;
}
inline Date Date::operator ++ (int)
{
Date result = Clone();
*this += 1;
return result;
}
inline Date& Date::operator -- ()
{
return *this -= 1;
}
inline Date Date::operator -- (int)
{
Date result = Clone();
*this -= 1;
return result;
}
inline Date Date::operator + (int value) const
{
Date result = Clone();
return result += value;
}
inline Date Date::operator - (int value) const
{
Date result = Clone();
return result -= value;
}
inline Date& Date::operator += (int value)
{
AddDays(value);
return *this;
}
inline Date& Date::operator -= (int value)
{
AddDays(-value);
return *this;
}
inline bool Date::operator == (const Date& other) const
{
return Compare(other) == 0;
}
inline bool Date::operator != (const Date& other) const
{
return !(*this == other);
}
inline bool Date::operator > (const Date& other) const
{
return Compare(other) > 0;
}
inline bool Date::operator < (const Date& other) const
{
return Compare(other) < 0;
}
inline bool Date::operator >= (const Date& other) const
{
int res = Compare(other);
return res == 0 || res < 0;
}
inline bool Date::operator <= (const Date& other) const
{
int res = Compare(other);
return res == 0 || res > 0;
}
/* --------------------------------------------------------------------------------------------- *
* Interval
* --------------------------------------------------------------------------------------------- */
inline Interval::Interval()
{
}
inline Interval::Interval(IntervalType type)
{
Acquire(Check(OCI_IntervalCreate(nullptr, type)), reinterpret_cast<HandleFreeFunc>(OCI_IntervalFree), nullptr, nullptr);
}
inline Interval::Interval(IntervalType type, const ostring& data)
{
Acquire(Check(OCI_IntervalCreate(nullptr, type)), reinterpret_cast<HandleFreeFunc>(OCI_IntervalFree), nullptr, nullptr);
FromString(data);
}
inline Interval::Interval(OCI_Interval *pInterval, Handle *parent)
{
Acquire(pInterval, nullptr, nullptr, parent);
}
inline Interval Interval::Clone() const
{
Interval result(GetType());
Check(OCI_IntervalAssign(result, *this));
return result;
}
inline int Interval::Compare(const Interval& other) const
{
return Check(OCI_IntervalCompare(*this, other));
}
inline Interval::IntervalType Interval::GetType() const
{
return IntervalType(static_cast<IntervalType::Type>(Check(OCI_IntervalGetType(*this))));
}
inline bool Interval::IsValid() const
{
return (Check(OCI_IntervalCheck(*this)) == 0);
}
inline int Interval::GetYear() const
{
int year = 0, month = 0;
GetYearMonth(year, month);
return year;
}
inline void Interval::SetYear(int value)
{
int year = 0, month = 0;
GetYearMonth(year, month);
SetYearMonth(value, month);
}
inline int Interval::GetMonth() const
{
int year = 0, month = 0;
GetYearMonth(year, month);
return month;
}
inline void Interval::SetMonth(int value)
{
int year = 0, month = 0;
GetYearMonth(year, month);
SetYearMonth(year, value);
}
inline int Interval::GetDay() const
{
int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
GetDaySecond(day, hour, minutes, seconds, milliseconds);
return day;
}
inline void Interval::SetDay(int value)
{
int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
GetDaySecond(day, hour, minutes, seconds, milliseconds);
SetDaySecond(value, hour, minutes, seconds, milliseconds);
}
inline int Interval::GetHours() const
{
int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
GetDaySecond(day, hour, minutes, seconds, milliseconds);
return hour;
}
inline void Interval::SetHours(int value)
{
int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
GetDaySecond(day, hour, minutes, seconds, milliseconds);
SetDaySecond(day, value, minutes, seconds, milliseconds);
}
inline int Interval::GetMinutes() const
{
int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
GetDaySecond(day, hour, minutes, seconds, milliseconds);
return minutes;
}
inline void Interval::SetMinutes(int value)
{
int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
GetDaySecond(day, hour, minutes, seconds, milliseconds);
SetDaySecond(day, hour, value, seconds, milliseconds);
}
inline int Interval::GetSeconds() const
{
int day, hour, minutes, seconds, milliseconds;
GetDaySecond(day, hour, minutes, seconds, milliseconds);
return seconds;
}
inline void Interval::SetSeconds(int value)
{
int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
GetDaySecond(day, hour, minutes, seconds, milliseconds);
SetDaySecond(day, hour, minutes, value, milliseconds);
}
inline int Interval::GetMilliSeconds() const
{
int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
GetDaySecond(day, hour, minutes, seconds, milliseconds);
return milliseconds;
}
inline void Interval::SetMilliSeconds(int value)
{
int day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
GetDaySecond(day, hour, minutes, seconds, milliseconds);
SetDaySecond(day, hour, minutes, seconds, value);
}
inline void Interval::GetDaySecond(int &day, int &hour, int &min, int &sec, int &fsec) const
{
Check(OCI_IntervalGetDaySecond(*this, &day, &hour, &min, &sec, &fsec));
}
inline void Interval::SetDaySecond(int day, int hour, int min, int sec, int fsec)
{
Check(OCI_IntervalSetDaySecond(*this, day, hour, min, sec, fsec));
}
inline void Interval::GetYearMonth(int &year, int &month) const
{
Check(OCI_IntervalGetYearMonth(*this, &year, &month));
}
inline void Interval::SetYearMonth(int year, int month)
{
Check(OCI_IntervalSetYearMonth(*this, year, month));
}
inline void Interval::UpdateTimeZone(const ostring& timeZone)
{
Check(OCI_IntervalFromTimeZone(*this, timeZone.c_str()));
}
inline void Interval::FromString(const ostring& data)
{
Check(OCI_IntervalFromText(*this, data.c_str()));
}
inline ostring Interval::ToString(int leadingPrecision, int fractionPrecision) const
{
if (!IsNull())
{
size_t size = OCI_SIZE_BUFFER;
ManagedBuffer<otext> buffer(size + 1);
Check(OCI_IntervalToText(*this, leadingPrecision, fractionPrecision, static_cast<int>(size), buffer));
return MakeString(static_cast<const otext *>(buffer));
}
return OCI_STRING_NULL;
}
inline ostring Interval::ToString() const
{
return ToString(OCI_STRING_DEFAULT_PREC, OCI_STRING_DEFAULT_PREC);
}
inline Interval Interval::operator + (const Interval& other) const
{
Interval result = Clone();
return result += other;
}
inline Interval Interval::operator - (const Interval& other) const
{
Interval result = Clone();
return result -= other;
}
inline Interval& Interval::operator += (const Interval& other)
{
Check(OCI_IntervalAdd(*this, other));
return *this;
}
inline Interval& Interval::operator -= (const Interval& other)
{
Check(OCI_IntervalSubtract(*this, other));
return *this;
}
inline bool Interval::operator == (const Interval& other) const
{
return Compare(other) == 0;
}
inline bool Interval::operator != (const Interval& other) const
{
return (!(*this == other));
}
inline bool Interval::operator > (const Interval& other) const
{
return (Compare(other) > 0);
}
inline bool Interval::operator < (const Interval& other) const
{
return (Compare(other) < 0);
}
inline bool Interval::operator >= (const Interval& other) const
{
int res = Compare(other);
return (res == 0 || res < 0);
}
inline bool Interval::operator <= (const Interval& other) const
{
int res = Compare(other);
return (res == 0 || res > 0);
}
/* --------------------------------------------------------------------------------------------- *
* Timestamp
* --------------------------------------------------------------------------------------------- */
inline Timestamp::Timestamp()
{
}
inline Timestamp::Timestamp(TimestampType type)
{
Acquire(Check(OCI_TimestampCreate(nullptr, type)), reinterpret_cast<HandleFreeFunc>(OCI_TimestampFree), nullptr, nullptr);
}
inline Timestamp::Timestamp(TimestampType type, const ostring& data, const ostring& format)
{
Acquire(Check(OCI_TimestampCreate(nullptr, type)), reinterpret_cast<HandleFreeFunc>(OCI_TimestampFree), nullptr, nullptr);
FromString(data, format);
}
inline Timestamp::Timestamp(OCI_Timestamp *pTimestamp, Handle *parent)
{
Acquire(pTimestamp, nullptr, nullptr, parent);
}
inline Timestamp Timestamp::Clone() const
{
Timestamp result(GetType());
Check(OCI_TimestampAssign(result, *this));
return result;
}
inline int Timestamp::Compare(const Timestamp& other) const
{
return Check(OCI_TimestampCompare(*this, other));
}
inline Timestamp::TimestampType Timestamp::GetType() const
{
return TimestampType(static_cast<TimestampType::Type>(Check(OCI_TimestampGetType(*this))));
}
inline void Timestamp::SetDateTime(int year, int month, int day, int hour, int min, int sec, int fsec, const ostring& timeZone)
{
Check(OCI_TimestampConstruct(*this, year, month, day, hour, min,sec, fsec, timeZone.c_str()));
}
inline void Timestamp::Convert(const Timestamp& other)
{
Check(OCI_TimestampConvert(*this, other));
}
inline bool Timestamp::IsValid() const
{
return (Check(OCI_TimestampCheck(*this)) == 0);
}
inline int Timestamp::GetYear() const
{
int year, month, day;
GetDate(year, month, day);
return year;
}
inline void Timestamp::SetYear(int value)
{
int year, month, day;
GetDate(year, month, day);
SetDate(value, month, day);
}
inline int Timestamp::GetMonth() const
{
int year, month, day;
GetDate(year, month, day);
return month;
}
inline void Timestamp::SetMonth(int value)
{
int year, month, day;
GetDate(year, month, day);
SetDate(year, value, day);
}
inline int Timestamp::GetDay() const
{
int year, month, day;
GetDate(year, month, day);
return day;
}
inline void Timestamp::SetDay(int value)
{
int year, month, day;
GetDate(year, month, day);
SetDate(year, month, value);
}
inline int Timestamp::GetHours() const
{
int hour, minutes, seconds, milliseconds;
GetTime(hour, minutes, seconds, milliseconds);
return hour;
}
inline void Timestamp::SetHours(int value)
{
int hour, minutes, seconds, milliseconds;
GetTime(hour, minutes, seconds, milliseconds);
SetTime(value, minutes, seconds, milliseconds);
}
inline int Timestamp::GetMinutes() const
{
int hour, minutes, seconds, milliseconds;
GetTime(hour, minutes, seconds, milliseconds);
return minutes;
}
inline void Timestamp::SetMinutes(int value)
{
int hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
GetTime(hour, minutes, seconds, milliseconds);
SetTime(hour, value, seconds, milliseconds);
}
inline int Timestamp::GetSeconds() const
{
int hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
GetTime(hour, minutes, seconds, milliseconds);
return seconds;
}
inline void Timestamp::SetSeconds(int value)
{
int hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
GetTime(hour, minutes, seconds, milliseconds);
SetTime(hour, minutes, value, milliseconds);
}
inline int Timestamp::GetMilliSeconds() const
{
int hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
GetTime(hour, minutes, seconds, milliseconds);
return milliseconds;
}
inline void Timestamp::SetMilliSeconds(int value)
{
int hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
GetTime(hour, minutes, seconds, milliseconds);
SetTime(hour, minutes, seconds, value);
}
inline void Timestamp::GetDate(int &year, int &month, int &day) const
{
Check(OCI_TimestampGetDate(*this, &year, &month, &day));
}
inline void Timestamp::GetTime(int &hour, int &min, int &sec, int &fsec) const
{
Check(OCI_TimestampGetTime(*this, &hour, &min, &sec, &fsec));
}
inline void Timestamp::GetDateTime(int &year, int &month, int &day, int &hour, int &min, int &sec, int &fsec) const
{
Check(OCI_TimestampGetDateTime(*this, &year, &month, &day, &hour, &min, &sec, &fsec));
}
inline void Timestamp::SetDate(int year, int month, int day)
{
int tmpYear = 0, tmpMonth = 0, tempDay = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
GetDateTime(tmpYear, tmpMonth, tempDay, hour, minutes, seconds, milliseconds);
SetDateTime(year, month, day, hour, minutes, seconds, milliseconds);
}
inline void Timestamp::SetTime(int hour, int min, int sec, int fsec)
{
int year = 0, month = 0, day = 0, tmpHour = 0, tmpMinutes = 0, tmpSeconds = 0, tmpMilliseconds = 0;
GetDateTime(year, month, day, tmpHour, tmpMinutes, tmpSeconds, tmpMilliseconds);
SetDateTime(year, month, day, hour, min, sec, fsec);
}
inline void Timestamp::SetTimeZone(const ostring& timeZone)
{
if (GetType() == WithTimeZone)
{
int year = 0, month = 0, day = 0, hour = 0, minutes = 0, seconds = 0, milliseconds = 0;
GetDateTime(year, month, day, hour, minutes, seconds, milliseconds);
SetDateTime(year, month, day, hour, minutes, seconds, milliseconds, timeZone);
}
}
inline ostring Timestamp::GetTimeZone() const
{
if (GetType() != NoTimeZone)
{
size_t size = OCI_SIZE_BUFFER;
ManagedBuffer<otext> buffer(size + 1);
Check(OCI_TimestampGetTimeZoneName(*this, static_cast<int>(size), buffer) == TRUE);
return MakeString(static_cast<const otext *>(buffer));
}
return ostring();
}
inline void Timestamp::GetTimeZoneOffset(int &hour, int &min) const
{
Check(OCI_TimestampGetTimeZoneOffset(*this, &hour, &min));
}
inline void Timestamp::Substract(const Timestamp &lsh, const Timestamp &rsh, Interval& result)
{
Check(OCI_TimestampSubtract(lsh, rsh, result));
}
inline Timestamp Timestamp::SysTimestamp(TimestampType type)
{
Timestamp result(type);
Check(OCI_TimestampSysTimestamp(result));
return result;
}
inline void Timestamp::FromString(const ostring& data, const ostring& format)
{
Check(OCI_TimestampFromText(*this, data.c_str(), format.size() > 0 ? format.c_str() : Environment::GetFormat(FormatTimestamp).c_str()));
}
inline ostring Timestamp::ToString(const ostring& format, int precision = OCI_STRING_DEFAULT_PREC) const
{
if (!IsNull())
{
size_t size = OCI_SIZE_BUFFER;
ManagedBuffer<otext> buffer(size + 1);
Check(OCI_TimestampToText(*this, format.c_str(), static_cast<int>(size), buffer, precision));
return MakeString(static_cast<const otext *>(buffer));
}
return OCI_STRING_NULL;
}
inline ostring Timestamp::ToString() const
{
return ToString(Environment::GetFormat(FormatTimestamp), OCI_STRING_DEFAULT_PREC);
}
inline Timestamp& Timestamp::operator ++ ()
{
return *this += 1;
}
inline Timestamp Timestamp::operator ++ (int)
{
Timestamp result = Clone();
*this += 1;
return result;
}
inline Timestamp& Timestamp::operator -- ()
{
return *this -= 1;
}
inline Timestamp Timestamp::operator -- (int)
{
Timestamp result = Clone();
*this -= 1;
return result;
}
inline Timestamp Timestamp::operator + (int value) const
{
Timestamp result = Clone();
Interval interval(Interval::DaySecond);
interval.SetDay(1);
return result += value;
}
inline Timestamp Timestamp::operator - (int value) const
{
Timestamp result = Clone();
Interval interval(Interval::DaySecond);
interval.SetDay(1);
return result -= value;
}
inline Interval Timestamp::operator - (const Timestamp& other)
{
Interval interval(Interval::DaySecond);
Check(OCI_TimestampSubtract(*this, other, interval));
return interval;
}
inline Timestamp Timestamp::operator + (const Interval& other) const
{
Timestamp result = Clone();
return result += other;
}
inline Timestamp Timestamp::operator - (const Interval& other) const
{
Timestamp result = Clone();
return result -= other;
}
inline Timestamp& Timestamp::operator += (const Interval& other)
{
Check(OCI_TimestampIntervalAdd(*this, other));
return *this;
}
inline Timestamp& Timestamp::operator -= (const Interval& other)
{
Check(OCI_TimestampIntervalSub(*this, other));
return *this;
}
inline Timestamp& Timestamp::operator += (int value)
{
Interval interval(Interval::DaySecond);
interval.SetDay(value);
return *this += interval;
}
inline Timestamp& Timestamp::operator -= (int value)
{
Interval interval(Interval::DaySecond);
interval.SetDay(value);
return *this -= interval;
}
inline bool Timestamp::operator == (const Timestamp& other) const
{
return Compare(other) == 0;
}
inline bool Timestamp::operator != (const Timestamp& other) const
{
return (!(*this == other));
}
inline bool Timestamp::operator > (const Timestamp& other) const
{
return (Compare(other) > 0);
}
inline bool Timestamp::operator < (const Timestamp& other) const
{
return (Compare(other) < 0);
}
inline bool Timestamp::operator >= (const Timestamp& other) const
{
int res = Compare(other);
return (res == 0 || res < 0);
}
inline bool Timestamp::operator <= (const Timestamp& other) const
{
int res = Compare(other);
return (res == 0 || res > 0);
}
/* --------------------------------------------------------------------------------------------- *
* Lob
* --------------------------------------------------------------------------------------------- */
template<class T, int U>
inline Lob<T, U>::Lob()
{
}
template<class T, int U>
Lob<T, U>::Lob(const Connection &connection)
{
Acquire(Check(OCI_LobCreate(connection, U)), reinterpret_cast<HandleFreeFunc>(OCI_LobFree), nullptr, connection.GetHandle());
}
template<class T, int U>
Lob<T, U>::Lob(OCI_Lob *pLob, Handle *parent)
{
Acquire(pLob, nullptr, nullptr, parent);
}
template<>
inline ostring Lob<ostring, LobCharacter>::Read(unsigned int length)
{
ManagedBuffer<otext> buffer(length + 1);
length = Check(OCI_LobRead(*this, static_cast<AnyPointer>(buffer), length));
return MakeString(static_cast<const otext *>(buffer), static_cast<int>(length));
}
template<>
inline ostring Lob<ostring, LobNationalCharacter>::Read(unsigned int length)
{
ManagedBuffer<otext> buffer(length + 1);
length = Check(OCI_LobRead(*this, static_cast<AnyPointer>(buffer), length));
return MakeString(static_cast<const otext *>(buffer), static_cast<int>(length));
}
template<>
inline Raw Lob<Raw, LobBinary>::Read(unsigned int length)
{
ManagedBuffer<unsigned char> buffer(length + 1);
length = Check(OCI_LobRead(*this, static_cast<AnyPointer>(buffer), length));
return MakeRaw(buffer, length);
}
template<class T, int U>
unsigned int Lob<T, U>::Write(const T& content)
{
unsigned int res = 0;
if (content.size() > 0)
{
res = Check(OCI_LobWrite(*this, static_cast<AnyPointer>(const_cast<typename T::value_type *>(&content[0])), static_cast<unsigned int>(content.size())));
}
return res;
}
template<class T, int U>
void Lob<T, U>::Append(const Lob& other)
{
Check(OCI_LobAppendLob(*this, other));
}
template<class T, int U>
unsigned int Lob<T, U>::Append(const T& content)
{
unsigned int res = 0;
if (content.size() > 0)
{
Check(OCI_LobAppend(*this, static_cast<AnyPointer>(const_cast<typename T::value_type *>(&content[0])), static_cast<unsigned int>(content.size())));
}
return res;
}
template<class T, int U>
bool Lob<T, U>::Seek(SeekMode seekMode, big_uint offset)
{
return (Check(OCI_LobSeek(*this, offset, seekMode)) == TRUE);
}
template<class T, int U>
Lob<T, U> Lob<T, U>::Clone() const
{
Lob result(GetConnection());
Check(OCI_LobAssign(result, *this));
return result;
}
template<class T, int U>
bool Lob<T, U>::Equals(const Lob &other) const
{
return (Check(OCI_LobIsEqual(*this, other)) == TRUE);
}
template<class T, int U>
LobType Lob<T, U>::GetType() const
{
return LobType(static_cast<LobType::Type>(Check(OCI_LobGetType(*this))));
}
template<class T, int U>
big_uint Lob<T, U>::GetOffset() const
{
return Check(OCI_LobGetOffset(*this));
}
template<class T, int U>
big_uint Lob<T, U>::GetLength() const
{
return Check(OCI_LobGetLength(*this));
}
template<class T, int U>
big_uint Lob<T, U>::GetMaxSize() const
{
return Check(OCI_LobGetMaxSize(*this));
}
template<class T, int U>
big_uint Lob<T, U>::GetChunkSize() const
{
return Check(OCI_LobGetChunkSize(*this));
}
template<class T, int U>
Connection Lob<T, U>::GetConnection() const
{
return Connection(Check(OCI_LobGetConnection(*this)), nullptr);
}
template<class T, int U>
void Lob<T, U>::Truncate(big_uint length)
{
Check(OCI_LobTruncate(*this, length));
}
template<class T, int U>
big_uint Lob<T, U>::Erase(big_uint offset, big_uint length)
{
return Check(OCI_LobErase(*this, offset, length));
}
template<class T, int U>
void Lob<T, U>::Copy(Lob &dest, big_uint offset, big_uint offsetDest, big_uint size) const
{
Check(OCI_LobCopy(dest, *this, offsetDest, offset, size));
}
template<class T, int U>
bool Lob<T, U>::IsTemporary() const
{
return (Check(OCI_LobIsTemporary(*this)) == TRUE);
}
template<class T, int U>
void Lob<T, U>::Open(OpenMode mode)
{
Check(OCI_LobOpen(*this, mode));
}
template<class T, int U>
void Lob<T, U>::Flush()
{
Check(OCI_LobFlush(*this));
}
template<class T, int U>
void Lob<T, U>::Close()
{
Check(OCI_LobClose(*this));
}
template<class T, int U>
void Lob<T, U>::EnableBuffering(bool value)
{
Check(OCI_LobEnableBuffering(*this, value));
}
template<class T, int U>
Lob<T, U>& Lob<T, U>::operator += (const Lob<T, U>& other)
{
Append(other);
return *this;
}
template<class T, int U>
bool Lob<T, U>::operator == (const Lob<T, U>& other) const
{
return Equals(other);
}
template<class T, int U>
bool Lob<T, U>::operator != (const Lob<T, U>& other) const
{
return !(*this == other);
}
/* --------------------------------------------------------------------------------------------- *
* File
* --------------------------------------------------------------------------------------------- */
inline File::File()
{
}
inline File::File(const Connection &connection)
{
Acquire(Check(OCI_FileCreate(connection, OCI_BFILE)), reinterpret_cast<HandleFreeFunc>(OCI_FileFree), nullptr, connection.GetHandle());
}
inline File::File(const Connection &connection, const ostring& directory, const ostring& name)
{
Acquire(Check(OCI_FileCreate(connection, OCI_BFILE)), reinterpret_cast<HandleFreeFunc>(OCI_FileFree), nullptr, connection.GetHandle());
SetInfos(directory, name);
}
inline File::File(OCI_File *pFile, Handle *parent)
{
Acquire(pFile, nullptr, nullptr, parent);
}
inline Raw File::Read(unsigned int size)
{
ManagedBuffer<unsigned char> buffer(size + 1);
size = Check(OCI_FileRead(*this, static_cast<AnyPointer>(buffer), size));
return MakeRaw(buffer, size);
}
inline bool File::Seek(SeekMode seekMode, big_uint offset)
{
return (Check(OCI_FileSeek(*this, offset, seekMode)) == TRUE);
}
inline File File::Clone() const
{
File result(GetConnection());
Check(OCI_FileAssign(result, *this));
return result;
}
inline bool File::Equals(const File &other) const
{
return (Check(OCI_FileIsEqual(*this, other)) == TRUE);
}
inline big_uint File::GetOffset() const
{
return Check(OCI_FileGetOffset(*this));
}
inline big_uint File::GetLength() const
{
return Check(OCI_FileGetSize(*this));
}
inline Connection File::GetConnection() const
{
return Connection(Check(OCI_FileGetConnection(*this)), nullptr);
}
inline bool File::Exists() const
{
return (Check(OCI_FileExists(*this)) == TRUE);
}
inline void File::SetInfos(const ostring& directory, const ostring& name)
{
Check(OCI_FileSetName(*this, directory.c_str(), name.c_str()));
}
inline ostring File::GetName() const
{
return MakeString(Check(OCI_FileGetName(*this)));
}
inline ostring File::GetDirectory() const
{
return MakeString(Check(OCI_FileGetDirectory(*this)));
}
inline void File::Open()
{
Check(OCI_FileOpen(*this));
}
inline bool File::IsOpened() const
{
return (Check(OCI_FileIsOpen(*this)) == TRUE);
}
inline void File::Close()
{
Check(OCI_FileClose(*this));
}
inline bool File::operator == (const File& other) const
{
return Equals(other);
}
inline bool File::operator != (const File& other) const
{
return (!(*this == other));
}
/* --------------------------------------------------------------------------------------------- *
* TypeInfo
* --------------------------------------------------------------------------------------------- */
inline TypeInfo::TypeInfo(const Connection &connection, const ostring& name, TypeInfoType type)
{
Acquire(Check(OCI_TypeInfoGet(connection, name.c_str(), type)), static_cast<HandleFreeFunc>(nullptr), nullptr, connection.GetHandle());
}
inline TypeInfo::TypeInfo(OCI_TypeInfo *pTypeInfo)
{
Acquire(pTypeInfo, nullptr, nullptr, nullptr);
}
inline TypeInfo::TypeInfoType TypeInfo::GetType() const
{
return TypeInfoType(static_cast<TypeInfoType::Type>(Check(OCI_TypeInfoGetType(*this))));
}
inline ostring TypeInfo::GetName() const
{
return Check(OCI_TypeInfoGetName(*this));
}
inline Connection TypeInfo::GetConnection() const
{
return Connection(Check(OCI_TypeInfoGetConnection(*this)), nullptr);
}
inline unsigned int TypeInfo::GetColumnCount() const
{
return Check(OCI_TypeInfoGetColumnCount(*this));
}
inline Column TypeInfo::GetColumn(unsigned int index) const
{
return Column(Check(OCI_TypeInfoGetColumn(*this, index)), GetHandle());
}
/* --------------------------------------------------------------------------------------------- *
* Object
* --------------------------------------------------------------------------------------------- */
inline Object::Object()
{
}
inline Object::Object(const TypeInfo &typeInfo)
{
Connection connection = typeInfo.GetConnection();
Acquire(Check(OCI_ObjectCreate(connection, typeInfo)), reinterpret_cast<HandleFreeFunc>(OCI_ObjectFree), nullptr, connection.GetHandle());
}
inline Object::Object(OCI_Object *pObject, Handle *parent)
{
Acquire(pObject, nullptr, nullptr, parent);
}
inline Object Object::Clone() const
{
Object result(GetTypeInfo());
Check(OCI_ObjectAssign(result, *this));
return result;
}
inline bool Object::IsAttributeNull(const ostring& name) const
{
return (Check(OCI_ObjectIsNull(*this, name.c_str())) == TRUE);
}
inline void Object::SetAttributeNull(const ostring& name)
{
Check(OCI_ObjectSetNull(*this, name.c_str()));
}
inline TypeInfo Object::GetTypeInfo() const
{
return TypeInfo(Check(OCI_ObjectGetTypeInfo(*this)));
}
inline Reference Object::GetReference() const
{
TypeInfo typeInfo = GetTypeInfo();
Connection connection = typeInfo.GetConnection();
OCI_Ref *pRef = OCI_RefCreate(connection, typeInfo);
Check(OCI_ObjectGetSelfRef(*this, pRef));
return Reference(pRef, GetHandle());
}
inline Object::ObjectType Object::GetType() const
{
return ObjectType(static_cast<ObjectType::Type>(Check(OCI_ObjectGetType(*this))));
}
template<>
inline bool Object::Get<bool>(const ostring& name) const
{
return (Check(OCI_ObjectGetBoolean(*this, name.c_str())) == TRUE);
}
template<>
inline short Object::Get<short>(const ostring& name) const
{
return Check(OCI_ObjectGetShort(*this, name.c_str()));
}
template<>
inline unsigned short Object::Get<unsigned short>(const ostring& name) const
{
return Check(OCI_ObjectGetUnsignedShort(*this, name.c_str()));
}
template<>
inline int Object::Get<int>(const ostring& name) const
{
return Check(OCI_ObjectGetInt(*this, name.c_str()));
}
template<>
inline unsigned int Object::Get<unsigned int>(const ostring& name) const
{
return Check(OCI_ObjectGetUnsignedInt(*this, name.c_str()));
}
template<>
inline big_int Object::Get<big_int>(const ostring& name) const
{
return Check(OCI_ObjectGetBigInt(*this, name.c_str()));
}
template<>
inline big_uint Object::Get<big_uint>(const ostring& name) const
{
return Check(OCI_ObjectGetUnsignedBigInt(*this, name.c_str()));
}
template<>
inline float Object::Get<float>(const ostring& name) const
{
return Check(OCI_ObjectGetFloat(*this, name.c_str()));
}
template<>
inline double Object::Get<double>(const ostring& name) const
{
return Check(OCI_ObjectGetDouble(*this, name.c_str()));
}
template<>
inline Number Object::Get<Number>(const ostring& name) const
{
return Number(Check(OCI_ObjectGetNumber(*this, name.c_str())), GetHandle());
}
template<>
inline ostring Object::Get<ostring>(const ostring& name) const
{
return MakeString(Check(OCI_ObjectGetString(*this,name.c_str())));
}
template<>
inline Date Object::Get<Date>(const ostring& name) const
{
return Date(Check(OCI_ObjectGetDate(*this,name.c_str())), GetHandle());
}
template<>
inline Timestamp Object::Get<Timestamp>(const ostring& name) const
{
return Timestamp(Check(OCI_ObjectGetTimestamp(*this,name.c_str())), GetHandle());
}
template<>
inline Interval Object::Get<Interval>(const ostring& name) const
{
return Interval(Check(OCI_ObjectGetInterval(*this,name.c_str())), GetHandle());
}
template<>
inline Object Object::Get<Object>(const ostring& name) const
{
return Object(Check(OCI_ObjectGetObject(*this,name.c_str())), GetHandle());
}
template<>
inline Reference Object::Get<Reference>(const ostring& name) const
{
return Reference(Check(OCI_ObjectGetRef(*this,name.c_str())), GetHandle());
}
template<>
inline Clob Object::Get<Clob>(const ostring& name) const
{
return Clob(Check(OCI_ObjectGetLob(*this,name.c_str())), GetHandle());
}
template<>
inline NClob Object::Get<NClob>(const ostring& name) const
{
return NClob(Check(OCI_ObjectGetLob(*this, name.c_str())), GetHandle());
}
template<>
inline Blob Object::Get<Blob>(const ostring& name) const
{
return Blob(Check(OCI_ObjectGetLob(*this,name.c_str())), GetHandle());
}
template<>
inline File Object::Get<File>(const ostring& name) const
{
return File(Check(OCI_ObjectGetFile(*this,name.c_str())), GetHandle());
}
template<>
inline Raw Object::Get<Raw>(const ostring& name) const
{
unsigned int size = Check(OCI_ObjectGetRawSize(*this, name.c_str()));
ManagedBuffer<unsigned char> buffer(size + 1);
size = static_cast<unsigned int>(Check(OCI_ObjectGetRaw(*this, name.c_str(), static_cast< AnyPointer >(buffer), size)));
return MakeRaw(buffer, size);
}
template<class T>
T Object::Get(const ostring& name) const
{
return T(Check(OCI_ObjectGetColl(*this, name.c_str())), GetHandle());
}
template<>
inline void Object::Set<bool>(const ostring& name, const bool &value)
{
Check(OCI_ObjectSetBoolean(*this, name.c_str(), static_cast<boolean>(value)));
}
template<>
inline void Object::Set<short>(const ostring& name, const short &value)
{
Check(OCI_ObjectSetShort(*this, name.c_str(), value));
}
template<>
inline void Object::Set<unsigned short>(const ostring& name, const unsigned short &value)
{
Check(OCI_ObjectSetUnsignedShort(*this, name.c_str(), value));
}
template<>
inline void Object::Set<int>(const ostring& name, const int &value)
{
Check(OCI_ObjectSetInt(*this, name.c_str(), value));
}
template<>
inline void Object::Set<unsigned int>(const ostring& name, const unsigned int &value)
{
Check(OCI_ObjectSetUnsignedInt(*this, name.c_str(), value));
}
template<>
inline void Object::Set<big_int>(const ostring& name, const big_int &value)
{
Check(OCI_ObjectSetBigInt(*this, name.c_str(), value));
}
template<>
inline void Object::Set<big_uint>(const ostring& name, const big_uint &value)
{
Check(OCI_ObjectSetUnsignedBigInt(*this, name.c_str(), value));
}
template<>
inline void Object::Set<float>(const ostring& name, const float &value)
{
Check(OCI_ObjectSetFloat(*this, name.c_str(), value));
}
template<>
inline void Object::Set<double>(const ostring& name, const double &value)
{
Check(OCI_ObjectSetDouble(*this, name.c_str(), value));
}
template<>
inline void Object::Set<Number>(const ostring& name, const Number &value)
{
Check(OCI_ObjectSetNumber(*this, name.c_str(), value));
}
template<>
inline void Object::Set<ostring>(const ostring& name, const ostring &value)
{
Check(OCI_ObjectSetString(*this, name.c_str(), value.c_str()));
}
template<>
inline void Object::Set<Date>(const ostring& name, const Date &value)
{
Check(OCI_ObjectSetDate(*this, name.c_str(), value));
}
template<>
inline void Object::Set<Timestamp>(const ostring& name, const Timestamp &value)
{
Check(OCI_ObjectSetTimestamp(*this, name.c_str(), value));
}
template<>
inline void Object::Set<Interval>(const ostring& name, const Interval &value)
{
Check(OCI_ObjectSetInterval(*this, name.c_str(), value));
}
template<>
inline void Object::Set<Object>(const ostring& name, const Object &value)
{
Check(OCI_ObjectSetObject(*this, name.c_str(), value));
}
template<>
inline void Object::Set<Reference>(const ostring& name, const Reference &value)
{
Check(OCI_ObjectSetRef(*this, name.c_str(), value));
}
template<>
inline void Object::Set<Clob>(const ostring& name, const Clob &value)
{
Check(OCI_ObjectSetLob(*this, name.c_str(), value));
}
template<>
inline void Object::Set<NClob>(const ostring& name, const NClob &value)
{
Check(OCI_ObjectSetLob(*this, name.c_str(), value));
}
template<>
inline void Object::Set<Blob>(const ostring& name, const Blob &value)
{
Check(OCI_ObjectSetLob(*this, name.c_str(), value));
}
template<>
inline void Object::Set<File>(const ostring& name, const File &value)
{
Check(OCI_ObjectSetFile(*this, name.c_str(), value));
}
template<>
inline void Object::Set<Raw>(const ostring& name, const Raw &value)
{
if (value.size() > 0)
{
Check(OCI_ObjectSetRaw(*this, name.c_str(), static_cast< AnyPointer >(const_cast<Raw::value_type *>(&value[0])), static_cast<unsigned int>(value.size())));
}
else
{
Check(OCI_ObjectSetRaw(*this, name.c_str(), nullptr, 0));
}
}
template<class T>
void Object::Set(const ostring& name, const T &value)
{
Check(OCI_ObjectSetColl(*this, name.c_str(), value));
}
inline ostring Object::ToString() const
{
if (!IsNull())
{
unsigned int len = 0;
Check(OCI_ObjectToText(*this, &len, nullptr));
ManagedBuffer<otext> buffer(len + 1);
Check(OCI_ObjectToText(*this, &len, buffer));
return MakeString(static_cast<const otext *>(buffer), static_cast<int>(len));
}
return OCI_STRING_NULL;
}
/* --------------------------------------------------------------------------------------------- *
* Reference
* --------------------------------------------------------------------------------------------- */
inline Reference::Reference()
{
}
inline Reference::Reference(const TypeInfo &typeInfo)
{
Connection connection = typeInfo.GetConnection();
Acquire(Check(OCI_RefCreate(connection, typeInfo)), reinterpret_cast<HandleFreeFunc>(OCI_RefFree), nullptr, connection.GetHandle());
}
inline Reference::Reference(OCI_Ref *pRef, Handle *parent)
{
Acquire(pRef, nullptr, nullptr, parent);
}
inline TypeInfo Reference::GetTypeInfo() const
{
return TypeInfo(Check(OCI_RefGetTypeInfo(*this)));
}
inline Object Reference::GetObject() const
{
return Object(Check(OCI_RefGetObject(*this)), GetHandle());
}
inline Reference Reference::Clone() const
{
Reference result(GetTypeInfo());
Check(OCI_RefAssign(result, *this));
return result;
}
inline bool Reference::IsReferenceNull() const
{
return (Check(OCI_RefIsNull(*this)) == TRUE);
}
inline void Reference::SetReferenceNull()
{
Check(OCI_RefSetNull(*this));
}
inline ostring Reference::ToString() const
{
if (!IsNull())
{
unsigned int size = Check(OCI_RefGetHexSize(*this));
ManagedBuffer<otext> buffer(size + 1);
Check(OCI_RefToText(*this, size, buffer));
return MakeString(static_cast<const otext *>(buffer), static_cast<int>(size));
}
return OCI_STRING_NULL;
}
/* --------------------------------------------------------------------------------------------- *
* Collection
* --------------------------------------------------------------------------------------------- */
template<class T>
Collection<T>::Collection()
{
}
template<class T>
Collection<T>::Collection(const TypeInfo &typeInfo)
{
Acquire(Check(OCI_CollCreate(typeInfo)), reinterpret_cast<HandleFreeFunc>(OCI_CollFree), nullptr, typeInfo.GetConnection().GetHandle());
}
template<class T>
Collection<T>::Collection(OCI_Coll *pColl, Handle *parent)
{
Acquire(pColl, nullptr, nullptr, parent);
}
template<class T>
Collection<T> Collection<T>::Clone() const
{
Collection<T> result(GetTypeInfo());
Check(OCI_CollAssign(result, *this));
return result;
}
template<class T>
TypeInfo Collection<T>::GetTypeInfo() const
{
return TypeInfo(Check(OCI_CollGetTypeInfo(*this)));
}
template<class T>
typename Collection<T>::CollectionType Collection<T>::GetType() const
{
return CollectionType(Check(OCI_CollGetType(*this)));
}
template<class T>
unsigned int Collection<T>::GetMax() const
{
return Check(OCI_CollGetMax(*this));
}
template<class T>
unsigned int Collection<T>::GetSize() const
{
return Check(OCI_CollGetSize(*this));
}
template<class T>
unsigned int Collection<T>::GetCount() const
{
return Check(OCI_CollGetCount(*this));
}
template<class T>
void Collection<T>::Truncate(unsigned int size)
{
Check(OCI_CollTrim(*this, size));
}
template<class T>
void Collection<T>::Clear()
{
Check(OCI_CollClear(*this));
}
template<class T>
bool Collection<T>::IsElementNull(unsigned int index) const
{
return (Check(OCI_ElemIsNull(Check(OCI_CollGetElem(*this, index)))) == TRUE);
}
template<class T>
void Collection<T>::SetElementNull(unsigned int index)
{
Check(OCI_ElemSetNull(Check(OCI_CollGetElem(*this, index))));
}
template<class T>
bool Collection<T>::Delete(unsigned int index) const
{
return (Check(OCI_CollDeleteElem(*this, index)) == TRUE);
}
template<class T>
typename Collection<T>::iterator Collection<T>::begin()
{
return iterator(this, 1);
}
template<class T>
typename Collection<T>::const_iterator Collection<T>::begin() const
{
return const_iterator(const_cast<Collection*>(this), 1);
}
template<class T>
typename Collection<T>::iterator Collection<T>::end()
{
return iterator(const_cast<Collection*>(this), GetCount() + 1);
}
template<class T>
typename Collection<T>::const_iterator Collection<T>::end() const
{
return const_iterator(const_cast<Collection*>(this), GetCount() + 1);
}
template<class T>
T Collection<T>::Get(unsigned int index) const
{
return GetElem(Check(OCI_CollGetElem(*this, index)), GetHandle());
}
template<class T>
void Collection<T>::Set(unsigned int index, const T &data)
{
OCI_Elem * elem = Check(OCI_CollGetElem(*this, index));
SetElem(elem, data);
Check(OCI_CollSetElem(*this, index, elem));
}
template<class T>
void Collection<T>::Append(const T &value)
{
OCI_Elem * elem = Check(OCI_ElemCreate(OCI_CollGetTypeInfo(*this)));
SetElem(elem, value);
Check(OCI_CollAppend(*this, elem));
Check(OCI_ElemFree(elem));
}
template<>
inline bool Collection<bool>::GetElem(OCI_Elem *elem, Handle *parent)
{
ARG_NOT_USED(parent);
return (Check(OCI_ElemGetBoolean(elem)) == TRUE);
}
template<>
inline short Collection<short>::GetElem(OCI_Elem *elem, Handle *parent)
{
ARG_NOT_USED(parent);
return Check(OCI_ElemGetShort(elem));
}
template<>
inline unsigned short Collection<unsigned short>::GetElem(OCI_Elem *elem, Handle *parent)
{
ARG_NOT_USED(parent);
return Check(OCI_ElemGetUnsignedShort(elem));
}
template<>
inline int Collection<int>::GetElem(OCI_Elem *elem, Handle *parent)
{
ARG_NOT_USED(parent);
return Check(OCI_ElemGetInt(elem));
}
template<>
inline unsigned int Collection<unsigned int>::GetElem(OCI_Elem *elem, Handle *parent)
{
ARG_NOT_USED(parent);
return Check(OCI_ElemGetUnsignedInt(elem));
}
template<>
inline big_int Collection<big_int>::GetElem(OCI_Elem *elem, Handle *parent)
{
ARG_NOT_USED(parent);
return Check(OCI_ElemGetBigInt(elem));
}
template<>
inline big_uint Collection<big_uint>::GetElem(OCI_Elem *elem, Handle *parent)
{
ARG_NOT_USED(parent);
return Check(OCI_ElemGetUnsignedBigInt(elem));
}
template<>
inline float Collection<float>::GetElem(OCI_Elem *elem, Handle *parent)
{
ARG_NOT_USED(parent);
return Check(OCI_ElemGetFloat(elem));
}
template<>
inline double Collection<double>::GetElem(OCI_Elem *elem, Handle *parent)
{
ARG_NOT_USED(parent);
return Check(OCI_ElemGetDouble(elem));
}
template<>
inline Number Collection<Number>::GetElem(OCI_Elem *elem, Handle *parent)
{
return Number(Check(OCI_ElemGetNumber(elem)), parent);
}
template<>
inline ostring Collection<ostring>::GetElem(OCI_Elem *elem, Handle *parent)
{
ARG_NOT_USED(parent);
return MakeString(Check(OCI_ElemGetString(elem)));
}
template<>
inline Raw Collection<Raw>::GetElem(OCI_Elem *elem, Handle *parent)
{
ARG_NOT_USED(parent);
unsigned int size = Check(OCI_ElemGetRawSize(elem));
ManagedBuffer<unsigned char> buffer(size + 1);
size = Check(OCI_ElemGetRaw(elem, static_cast<AnyPointer>(buffer), size));
return MakeRaw(buffer, size);
}
template<>
inline Date Collection<Date>::GetElem(OCI_Elem *elem, Handle *parent)
{
return Date(Check(OCI_ElemGetDate(elem)), parent);
}
template<>
inline Timestamp Collection<Timestamp>::GetElem(OCI_Elem *elem, Handle *parent)
{
return Timestamp(Check(OCI_ElemGetTimestamp(elem)), parent);
}
template<>
inline Interval Collection<Interval>::GetElem(OCI_Elem *elem, Handle *parent)
{
return Interval(Check(OCI_ElemGetInterval(elem)), parent);
}
template<>
inline Object Collection<Object>::GetElem(OCI_Elem *elem, Handle *parent)
{
return Object(Check(OCI_ElemGetObject(elem)), parent);
}
template<>
inline Reference Collection<Reference>::GetElem(OCI_Elem *elem, Handle *parent)
{
return Reference(Check(OCI_ElemGetRef(elem)), parent);
}
template<>
inline Clob Collection<Clob>::GetElem(OCI_Elem *elem, Handle *parent)
{
return Clob(Check(OCI_ElemGetLob(elem)), parent);
}
template<>
inline NClob Collection<NClob>::GetElem(OCI_Elem *elem, Handle *parent)
{
return NClob(Check(OCI_ElemGetLob(elem)), parent);
}
template<>
inline Blob Collection<Blob>::GetElem(OCI_Elem *elem, Handle *parent)
{
return Blob(Check(OCI_ElemGetLob(elem)), parent);
}
template<>
inline File Collection<File>::GetElem(OCI_Elem *elem, Handle *parent)
{
return File(Check(OCI_ElemGetFile(elem)), parent);
}
template<class T>
T Collection<T>::GetElem(OCI_Elem *elem, Handle *parent)
{
return T(Check(OCI_ElemGetColl(elem)), parent);
}
template<>
inline void Collection<bool>::SetElem(OCI_Elem *elem, const bool &value)
{
Check(OCI_ElemSetBoolean(elem, static_cast<boolean>(value)));
}
template<>
inline void Collection<short>::SetElem(OCI_Elem *elem, const short &value)
{
Check(OCI_ElemSetShort(elem, value));
}
template<>
inline void Collection<unsigned short>::SetElem(OCI_Elem *elem, const unsigned short &value)
{
Check(OCI_ElemSetUnsignedShort(elem, value));
}
template<>
inline void Collection<int>::SetElem(OCI_Elem *elem, const int &value)
{
Check(OCI_ElemSetInt(elem, value));
}
template<>
inline void Collection<unsigned int>::SetElem(OCI_Elem *elem, const unsigned int &value)
{
Check(OCI_ElemSetUnsignedInt(elem, value));
}
template<>
inline void Collection<big_int>::SetElem(OCI_Elem *elem, const big_int &value)
{
Check(OCI_ElemSetBigInt(elem, value));
}
template<>
inline void Collection<big_uint>::SetElem(OCI_Elem *elem, const big_uint &value)
{
Check(OCI_ElemSetUnsignedBigInt(elem, value));
}
template<>
inline void Collection<float>::SetElem(OCI_Elem *elem, const float &value)
{
Check(OCI_ElemSetFloat(elem, value));
}
template<>
inline void Collection<double>::SetElem(OCI_Elem *elem, const double &value)
{
Check(OCI_ElemSetDouble(elem, value));
}
template<>
inline void Collection<Number>::SetElem(OCI_Elem *elem, const Number &value)
{
Check(OCI_ElemSetNumber(elem, value));
}
template<>
inline void Collection<ostring>::SetElem(OCI_Elem *elem, const ostring& value)
{
Check(OCI_ElemSetString(elem, value.c_str()));
}
template<>
inline void Collection<Raw>::SetElem(OCI_Elem *elem, const Raw &value)
{
if (value.size() > 0)
{
Check(OCI_ElemSetRaw(elem, static_cast<AnyPointer>(const_cast<Raw::value_type *>(&value[0])), static_cast<unsigned int>(value.size())));
}
else
{
Check(OCI_ElemSetRaw(elem, nullptr, 0));
}
}
template<>
inline void Collection<Date>::SetElem(OCI_Elem *elem, const Date &value)
{
Check(OCI_ElemSetDate(elem, value));
}
template<>
inline void Collection<Timestamp>::SetElem(OCI_Elem *elem, const Timestamp &value)
{
Check(OCI_ElemSetTimestamp(elem, value));
}
template<>
inline void Collection<Interval>::SetElem(OCI_Elem *elem, const Interval &value)
{
Check(OCI_ElemSetInterval(elem, value));
}
template<>
inline void Collection<Object>::SetElem(OCI_Elem *elem, const Object &value)
{
Check(OCI_ElemSetObject(elem, value));
}
template<>
inline void Collection<Reference>::SetElem(OCI_Elem *elem, const Reference &value)
{
Check(OCI_ElemSetRef(elem, value));
}
template<>
inline void Collection<Clob>::SetElem(OCI_Elem *elem, const Clob &value)
{
Check(OCI_ElemSetLob(elem, value));
}
template<>
inline void Collection<NClob>::SetElem(OCI_Elem *elem, const NClob &value)
{
Check(OCI_ElemSetLob(elem, value));
}
template<>
inline void Collection<Blob>::SetElem(OCI_Elem *elem, const Blob &value)
{
Check(OCI_ElemSetLob(elem, value));
}
template<>
inline void Collection<File>::SetElem(OCI_Elem *elem, const File &value)
{
Check(OCI_ElemSetFile(elem, value));
}
template<class T>
void Collection<T>::SetElem(OCI_Elem *elem, const T &value)
{
Check(OCI_ElemSetColl(elem, value));
}
template<class T>
ostring Collection<T>::ToString() const
{
if (!IsNull())
{
unsigned int len = 0;
Check(OCI_CollToText(*this, &len, nullptr));
ManagedBuffer<otext> buffer(len + 1);
Check(OCI_CollToText(*this, &len, buffer));
return MakeString(static_cast<const otext *>(buffer), static_cast<int>(len));
}
return OCI_STRING_NULL;
}
template<class T>
CollectionElement<T> Collection<T>::operator [] (unsigned int index)
{
return CollectionElement<T>(this, index);
}
template<class T>
const CollectionElement<T> Collection<T>::operator [] (unsigned int index) const
{
return CollectionElement<T>(this, index);
}
template<class T>
CollectionIterator<T>::CollectionIterator() : _elem()
{
}
template<class T>
CollectionIterator<T>::CollectionIterator(CollectionType *collection, unsigned int pos) : _elem(collection, pos)
{
}
template<class T>
CollectionIterator<T>::CollectionIterator(const CollectionIterator& other) : _elem(other._elem)
{
}
template<class T>
CollectionIterator<T>& CollectionIterator<T>::operator = (const CollectionIterator& other)
{
_elem._pos = other._elem._pos;
_elem._coll = other._elem._coll;
return *this;
}
template<class T>
CollectionIterator<T>& CollectionIterator<T>::operator += (difference_type value)
{
_elem._pos += static_cast<unsigned int>(value);
return *this;
}
template<class T>
CollectionIterator<T>& CollectionIterator<T>::operator -= (difference_type value)
{
_elem._pos -= static_cast<unsigned int>(value);
return *this;
}
template<class T>
T& CollectionIterator<T>::operator*()
{
return _elem;
}
template<class T>
T* CollectionIterator<T>::operator->()
{
return &_elem;
}
template<class T>
CollectionIterator<T>& CollectionIterator<T>::operator--()
{
--_elem._pos;
return *this;
}
template<class T>
CollectionIterator<T>& CollectionIterator<T>::operator++()
{
++*(const_cast<unsigned int*>(&_elem._pos));
return *this;
}
template<class T>
CollectionIterator<T> CollectionIterator<T>::operator++(int)
{
CollectionIterator res(_elem._coll, _elem._pos);
++(*this);
return res;
}
template<class T>
CollectionIterator<T> CollectionIterator<T>::operator--(int)
{
CollectionIterator res(_elem);
--(*this);
return res;
}
template<class T>
CollectionIterator<T> CollectionIterator<T>::operator + (difference_type value)
{
return CollectionIterator(_elem._coll, _elem._pos + static_cast<unsigned int>(value));
}
template<class T>
CollectionIterator<T> CollectionIterator<T>::operator - (difference_type value)
{
return CollectionIterator(_elem._coll, _elem._pos - static_cast<unsigned int>(value));
}
template<class T>
typename CollectionIterator<T>::difference_type CollectionIterator<T>::operator - (const CollectionIterator &value)
{
return static_cast<difference_type>(_elem._pos - value._elem._pos);
}
template<class T>
bool CollectionIterator<T>::operator == (const CollectionIterator& other)
{
return _elem._pos == other._elem._pos && (static_cast< OCI_Coll *>(*_elem._coll)) == (static_cast< OCI_Coll *>(*other._elem._coll));
}
template<class T>
bool CollectionIterator<T>::operator != (const CollectionIterator& other)
{
return !(*this == other);
}
template<class T>
bool CollectionIterator<T>::operator > (const CollectionIterator& other)
{
return _elem._pos > other._elem._pos;
}
template<class T>
bool CollectionIterator<T>::operator < (const CollectionIterator& other)
{
return _elem._pos < other._elem._pos;
}
template<class T>
bool CollectionIterator<T>::operator >= (const CollectionIterator& other)
{
return _elem._pos >= other._elem._pos;
}
template<class T>
bool CollectionIterator<T>::operator <= (const CollectionIterator& other)
{
return _elem._pos <= other._elem._pos;
}
template<class T>
CollectionElement<T>::CollectionElement() : _coll(nullptr), _pos(0)
{
}
template<class T>
CollectionElement<T>::CollectionElement(CollectionType *coll, unsigned int pos) : _coll(coll), _pos(pos)
{
}
template<class T>
CollectionElement<T>::operator T() const
{
return _coll->Get(_pos);
}
template<class T>
CollectionElement<T>& CollectionElement<T>::operator = (const ValueType& value)
{
_coll->Set(_pos, value);
return *this;
}
template<class T>
CollectionElement<T>& CollectionElement<T>::operator = (const CollectionElement &other)
{
_coll->Set(_pos, static_cast<T>(other));
return *this;
}
template<class T>
bool CollectionElement<T>::IsNull() const
{
return _coll->IsElementNull(_pos);
}
template<class T>
void CollectionElement<T>::SetNull()
{
_coll->SetElementNull(_pos);
}
/* --------------------------------------------------------------------------------------------- *
* Long
* --------------------------------------------------------------------------------------------- */
template<class T, int U>
Long<T, U>::Long()
{
}
template<class T, int U>
Long<T, U>::Long(const Statement &statement)
{
Acquire(Check(OCI_LongCreate(statement, U)), reinterpret_cast<HandleFreeFunc>(OCI_LongFree), nullptr, statement.GetHandle());
}
template<class T, int U>
Long<T, U>::Long(OCI_Long *pLong, Handle* parent)
{
Acquire(pLong, nullptr, nullptr, parent);
}
template<class T, int U>
unsigned int Long<T, U>::Write(const T& content)
{
unsigned int res = 0;
if (content.size() > 0)
{
res = Check(OCI_LongWrite(*this, static_cast<AnyPointer>(const_cast<typename T::value_type *>(&content[0])), static_cast<unsigned int>(content.size())));
}
return res;
}
template<class T, int U>
unsigned int Long<T, U>::GetLength() const
{
return Check(OCI_LongGetSize(*this));
}
template<>
inline ostring Long<ostring, LongCharacter>::GetContent() const
{
return MakeString(static_cast<const otext *>(Check(OCI_LongGetBuffer(*this))));
}
template<>
inline Raw Long<Raw, LongBinary>::GetContent() const
{
return MakeRaw(Check(OCI_LongGetBuffer(*this)), GetLength());
}
/* --------------------------------------------------------------------------------------------- *
* BindObject
* --------------------------------------------------------------------------------------------- */
inline BindObject::BindObject(const Statement &statement, const ostring& name, unsigned int mode) : _pStatement(statement), _name(name), _mode(mode)
{
}
inline BindObject::~BindObject()
{
}
inline ostring BindObject::GetName() const
{
return _name;
}
inline Statement BindObject::GetStatement() const
{
return Statement(_pStatement);
}
inline unsigned int BindObject::GetMode() const
{
return _mode;
}
/* --------------------------------------------------------------------------------------------- *
* BindArray
* --------------------------------------------------------------------------------------------- */
inline BindArray::BindArray(const Statement &statement, const ostring& name, unsigned int mode) : BindObject(statement, name, mode), _object(nullptr)
{
}
template<class T>
void BindArray::SetVector(std::vector<T> & vector, unsigned int elemSize)
{
_object = new BindArrayObject<T>(GetStatement(), GetName(), vector, GetMode(), elemSize);
}
inline BindArray::~BindArray()
{
delete _object;
}
template<class T>
typename BindResolver<T>::OutputType * BindArray::GetData() const
{
return static_cast<typename BindResolver<T>::OutputType *>(*(dynamic_cast< BindArrayObject<T> * > (_object)));
}
inline void BindArray::SetInData()
{
if (GetMode() & OCI_BDM_IN)
{
_object->SetInData();
}
}
inline void BindArray::SetOutData()
{
if (GetMode() & OCI_BDM_OUT)
{
_object->SetOutData();
}
}
template<class T>
BindArray::BindArrayObject<T>::BindArrayObject(const Statement &statement, const ostring& name, ObjectVector &vector, unsigned int mode, unsigned int elemSize)
: _pStatement(statement), _name(name), _vector(vector), _data(nullptr), _mode(mode), _elemCount(statement.GetBindArraySize()), _elemSize(elemSize)
{
AllocData();
}
template<class T>
BindArray::BindArrayObject<T>::~BindArrayObject()
{
FreeData();
}
template<class T>
void BindArray::BindArrayObject<T>::AllocData()
{
_data = new NativeType[_elemCount];
memset(_data, 0, sizeof(NativeType) * _elemCount);
}
template<>
inline void BindArray::BindArrayObject<ostring>::AllocData()
{
_data = new otext[_elemSize * _elemCount];
memset(_data, 0, _elemSize * _elemCount * sizeof(otext));
}
template<>
inline void BindArray::BindArrayObject<Raw> ::AllocData()
{
_data = new unsigned char[_elemSize * _elemCount];
memset(_data, 0, _elemSize * _elemCount * sizeof(unsigned char));
}
template<class T>
void BindArray::BindArrayObject<T>::FreeData() const
{
delete [] _data ;
}
template<class T>
void BindArray::BindArrayObject<T>::SetInData()
{
typename ObjectVector::iterator it, it_end;
unsigned int index = 0;
unsigned int currElemCount = Check(OCI_BindArrayGetSize(_pStatement));
for (it = _vector.begin(), it_end = _vector.end(); it != it_end && index < _elemCount && index < currElemCount; ++it, ++index)
{
_data[index] = static_cast<NativeType>(*it);
}
}
template<>
inline void BindArray::BindArrayObject<ostring>::SetInData()
{
std::vector<ostring>::iterator it, it_end;
unsigned int index = 0;
unsigned int currElemCount = Check(OCI_BindArrayGetSize(_pStatement));
for (it = _vector.begin(), it_end = _vector.end(); it != it_end && index < _elemCount && index < currElemCount; ++it, ++index)
{
const ostring & value = *it;
memcpy( _data + (_elemSize * index), value.c_str(), (value.size() + 1) * sizeof(otext));
}
}
template<>
inline void BindArray::BindArrayObject<Raw>::SetInData()
{
std::vector<Raw>::iterator it, it_end;
unsigned int index = 0;
unsigned int currElemCount = Check(OCI_BindArrayGetSize(_pStatement));
for (it = _vector.begin(), it_end = _vector.end(); it != it_end && index < _elemCount && index < currElemCount; ++it, ++index)
{
Raw & value = *it;
if (value.size() > 0)
{
memcpy(_data + (_elemSize * index), &value[0], value.size());
}
OCI_BindSetDataSizeAtPos(OCI_GetBind2(_pStatement, GetName().c_str()), index + 1, static_cast<unsigned int>(value.size()));
}
}
template<class T>
void BindArray::BindArrayObject<T>::SetOutData()
{
typename ObjectVector::iterator it, it_end;
unsigned int index = 0;
unsigned int currElemCount = Check(OCI_BindArrayGetSize(_pStatement));
for (it = _vector.begin(), it_end = _vector.end(); it != it_end && index < _elemCount && index < currElemCount; ++it, ++index)
{
T& object = *it;
object = static_cast<NativeType>(_data[index]);
}
}
template<>
inline void BindArray::BindArrayObject<Raw>::SetOutData()
{
std::vector<Raw>::iterator it, it_end;
OCI_Bind *pBind = Check(OCI_GetBind2(_pStatement, GetName().c_str()));
unsigned int index = 0;
unsigned int currElemCount = Check(OCI_BindArrayGetSize(_pStatement));
for (it = _vector.begin(), it_end = _vector.end(); it != it_end && index < _elemCount && index < currElemCount; ++it, ++index)
{
unsigned char *currData = _data + (_elemSize * index);
(*it).assign(currData, currData + Check(OCI_BindGetDataSizeAtPos(pBind, index + 1)));
}
}
template<class T>
ostring BindArray::BindArrayObject<T>::GetName()
{
return _name;
}
template<class T>
BindArray::BindArrayObject<T>::operator ObjectVector & () const
{
return _vector;
}
template<class T>
BindArray::BindArrayObject<T>::operator NativeType * () const
{
return _data;
}
/* --------------------------------------------------------------------------------------------- *
* BindObjectAdaptor
* --------------------------------------------------------------------------------------------- */
template<class T>
void BindObjectAdaptor<T>::SetInData()
{
if (GetMode() & OCI_BDM_IN)
{
size_t size = _object.size();
if (size > _size)
{
size = _size;
}
if (size > 0)
{
memcpy(_data, &_object[0], size * sizeof(NativeType));
}
_data[size] = 0;
}
}
template<class T>
void BindObjectAdaptor<T>::SetOutData()
{
if (GetMode() & OCI_BDM_OUT)
{
size_t size = Check(OCI_BindGetDataSize(Check(OCI_GetBind2(_pStatement, _name.c_str()))));
_object.assign(_data, _data + size);
}
}
template<class T>
BindObjectAdaptor<T>::BindObjectAdaptor(const Statement &statement, const ostring& name, unsigned int mode, ObjectType &object, unsigned int size) :
BindObject(statement, name, mode),
_object(object),
_data(new NativeType[size]),
_size(size)
{
memset(_data, 0, _size * sizeof(NativeType));
}
template<class T>
BindObjectAdaptor<T>::~BindObjectAdaptor()
{
delete [] _data;
}
template<class T>
BindObjectAdaptor<T>::operator NativeType *() const
{
return _data;
}
/* --------------------------------------------------------------------------------------------- *
* BindTypeAdaptor
* --------------------------------------------------------------------------------------------- */
template<class T>
void BindTypeAdaptor<T>::SetInData()
{
if (GetMode() & OCI_BDM_IN)
{
*_data = static_cast<NativeType>(_object);
}
}
template<class T>
void BindTypeAdaptor<T>::SetOutData()
{
if (GetMode() & OCI_BDM_OUT)
{
_object = static_cast<T>(*_data);
}
}
template<class T>
BindTypeAdaptor<T>::BindTypeAdaptor(const Statement &statement, const ostring& name, unsigned int mode, ObjectType &object) :
BindObject(statement, name, mode),
_object(object),
_data(new NativeType)
{
}
template<class T>
BindTypeAdaptor<T>::~BindTypeAdaptor()
{
delete _data;
}
template<class T>
BindTypeAdaptor<T>::operator NativeType *() const
{
return _data;
}
template<>
inline void BindTypeAdaptor<bool>::SetInData()
{
if (GetMode() & OCI_BDM_IN)
{
*_data = (_object == true);
}
}
template<>
inline void BindTypeAdaptor<bool>::SetOutData()
{
if (GetMode() & OCI_BDM_OUT)
{
_object = (*_data == TRUE);
}
}
/* --------------------------------------------------------------------------------------------- *
* BindsHolder
* --------------------------------------------------------------------------------------------- */
inline BindsHolder::BindsHolder(const Statement &statement) : _bindObjects(), _pStatement(statement)
{
}
inline BindsHolder::~BindsHolder()
{
Clear();
}
inline void BindsHolder::Clear()
{
std::vector<BindObject *>::iterator it, it_end;
for(it = _bindObjects.begin(), it_end = _bindObjects.end(); it != it_end; ++it)
{
delete (*it);
}
_bindObjects.clear();
}
inline void BindsHolder::AddBindObject(BindObject *bindObject)
{
if (Check(OCI_IsRebindingAllowed(_pStatement)))
{
std::vector<BindObject *>::iterator it, it_end;
for(it = _bindObjects.begin(), it_end = _bindObjects.end(); it != it_end; ++it)
{
if ((*it)->GetName() == bindObject->GetName())
{
_bindObjects.erase(it);
break;
}
}
}
_bindObjects.push_back(bindObject);
}
inline void BindsHolder::SetOutData()
{
std::vector<BindObject *>::iterator it, it_end;
for(it = _bindObjects.begin(), it_end = _bindObjects.end(); it != it_end; ++it)
{
(*it)->SetOutData();
}
}
inline void BindsHolder::SetInData()
{
std::vector<BindObject *>::iterator it, it_end;
for(it = _bindObjects.begin(), it_end = _bindObjects.end(); it != it_end; ++it)
{
(*it)->SetInData();
}
}
/* --------------------------------------------------------------------------------------------- *
* Bind
* --------------------------------------------------------------------------------------------- */
inline BindInfo::BindInfo(OCI_Bind *pBind, Handle *parent)
{
Acquire(pBind, nullptr, nullptr, parent);
}
inline ostring BindInfo::GetName() const
{
return MakeString(Check(OCI_BindGetName(*this)));
}
inline DataType BindInfo::GetType() const
{
return DataType(static_cast<DataType::Type>(Check(OCI_BindGetType(*this))));
}
inline unsigned int BindInfo::GetSubType() const
{
return Check(OCI_BindGetSubtype(*this));
}
inline unsigned int BindInfo::GetDataCount() const
{
return Check(OCI_BindGetDataCount(*this));
}
inline Statement BindInfo::GetStatement() const
{
return Statement(Check(OCI_BindGetStatement(*this)));
}
inline void BindInfo::SetDataNull(bool value, unsigned int index)
{
if (value)
{
Check(OCI_BindSetNullAtPos(*this, index));
}
else
{
Check(OCI_BindSetNotNullAtPos(*this, index));
}
}
inline bool BindInfo::IsDataNull(unsigned int index) const
{
return (Check(OCI_BindIsNullAtPos(*this, index)) == TRUE);
}
inline void BindInfo::SetCharsetForm(CharsetForm value)
{
Check(OCI_BindSetCharsetForm(*this, value));
}
inline BindInfo::BindDirection BindInfo::GetDirection() const
{
return BindDirection(static_cast<BindDirection::Type>(Check(OCI_BindGetDirection(*this))));
}
/* --------------------------------------------------------------------------------------------- *
* Statement
* --------------------------------------------------------------------------------------------- */
inline Statement::Statement()
{
}
inline Statement::Statement(const Connection &connection)
{
Acquire(Check(OCI_StatementCreate(connection)), reinterpret_cast<HandleFreeFunc>(OCI_StatementFree), OnFreeSmartHandle, connection.GetHandle());
}
inline Statement::Statement(OCI_Statement *stmt, Handle *parent)
{
Acquire(stmt, reinterpret_cast<HandleFreeFunc>(parent ? OCI_StatementFree : nullptr), OnFreeSmartHandle, parent);
}
inline Connection Statement::GetConnection() const
{
return Connection(Check(OCI_StatementGetConnection(*this)), nullptr);
}
inline void Statement::Describe(const ostring& sql)
{
ClearBinds();
ReleaseResultsets();
Check(OCI_Describe(*this, sql.c_str()));
}
inline void Statement::Parse(const ostring& sql)
{
ClearBinds();
ReleaseResultsets();
Check(OCI_Parse(*this, sql.c_str()));
}
inline void Statement::Prepare(const ostring& sql)
{
ClearBinds();
ReleaseResultsets();
Check(OCI_Prepare(*this, sql.c_str()));
}
inline void Statement::ExecutePrepared()
{
ReleaseResultsets();
SetInData();
Check(OCI_Execute(*this));
SetOutData();
}
template<class T>
unsigned int Statement::ExecutePrepared(T callback)
{
ExecutePrepared();
return Fetch(callback);
}
template<class T, class U>
unsigned int Statement::ExecutePrepared(T callback, U adapter)
{
ExecutePrepared();
return Fetch(callback, adapter);
}
inline void Statement::Execute(const ostring& sql)
{
ClearBinds();
ReleaseResultsets();
Check(OCI_ExecuteStmt(*this, sql.c_str()));
}
template<class T>
unsigned int Statement::Execute(const ostring& sql, T callback)
{
Execute(sql);
return Fetch(callback);
}
template<class T, class U>
unsigned int Statement::Execute(const ostring& sql, T callback, U adapter)
{
Execute(sql);
return Fetch(callback, adapter);
}
template<typename T>
unsigned int Statement::Fetch(T callback)
{
unsigned int res = 0;
Resultset rs = GetResultset();
while (rs)
{
res += rs.ForEach(callback);
rs = GetNextResultset();
}
return res;
}
template<class T, class U>
unsigned int Statement::Fetch(T callback, U adapter)
{
unsigned int res = 0;
Resultset rs = GetResultset();
while (rs)
{
res += rs.ForEach(callback, adapter);
rs = GetNextResultset();
}
return res;
}
inline unsigned int Statement::GetAffectedRows() const
{
return Check(OCI_GetAffectedRows(*this));
}
inline ostring Statement::GetSql() const
{
return MakeString(Check(OCI_GetSql(*this)));
}
inline Resultset Statement::GetResultset()
{
return Resultset(Check(OCI_GetResultset(*this)), GetHandle());
}
inline Resultset Statement::GetNextResultset()
{
return Resultset(Check(OCI_GetNextResultset(*this)), GetHandle());
}
inline void Statement::SetBindArraySize(unsigned int size)
{
Check(OCI_BindArraySetSize(*this, size));
}
inline unsigned int Statement::GetBindArraySize() const
{
return Check(OCI_BindArrayGetSize(*this));
}
inline void Statement::AllowRebinding(bool value)
{
Check(OCI_AllowRebinding(*this, value));
}
inline bool Statement::IsRebindingAllowed() const
{
return (Check(OCI_IsRebindingAllowed(*this)) == TRUE);
}
inline unsigned int Statement::GetBindIndex(const ostring& name) const
{
return Check(OCI_GetBindIndex(*this, name.c_str()));
}
inline unsigned int Statement::GetBindCount() const
{
return Check(OCI_GetBindCount(*this));
}
inline BindInfo Statement::GetBind(unsigned int index) const
{
return BindInfo(Check(OCI_GetBind(*this, index)), GetHandle());
}
inline BindInfo Statement::GetBind(const ostring& name) const
{
return BindInfo(Check(OCI_GetBind2(*this, name.c_str())), GetHandle());
}
template<typename M, class T>
void Statement::Bind1(M &method, const ostring& name, T& value, BindInfo::BindDirection mode)
{
Check(method(*this, name.c_str(), &value));
SetLastBindMode(mode);
}
template<typename M, class T>
void Statement::Bind2(M &method, const ostring& name, T& value, BindInfo::BindDirection mode)
{
Check(method(*this, name.c_str(), static_cast<typename BindResolver<T>::OutputType >(value)));
SetLastBindMode(mode);
}
template<typename M, class T>
void Statement::BindVector1(M &method, const ostring& name, std::vector<T> &values, BindInfo::BindDirection mode)
{
BindArray * bnd = new BindArray(*this, name, mode);
bnd->SetVector<T>(values, sizeof(typename BindResolver<T>::OutputType));
boolean res = method(*this, name.c_str(), bnd->GetData<T>(), 0);
if (res)
{
BindsHolder *bindsHolder = GetBindsHolder(true);
bindsHolder->AddBindObject(bnd);
SetLastBindMode(mode);
}
else
{
delete bnd;
}
Check(res);
}
template<typename M, class T, class U>
void Statement::BindVector2(M &method, const ostring& name, std::vector<T> &values, BindInfo::BindDirection mode, U type)
{
BindArray * bnd = new BindArray(*this, name, mode);
bnd->SetVector<T>(values, sizeof(typename BindResolver<T>::OutputType));
boolean res = method(*this, name.c_str(), bnd->GetData<T>(), type, 0);
if (res)
{
BindsHolder *bindsHolder = GetBindsHolder(true);
bindsHolder->AddBindObject(bnd);
SetLastBindMode(mode);
}
else
{
delete bnd;
}
Check(res);
}
template<>
inline void Statement::Bind<bool>(const ostring& name, bool &value, BindInfo::BindDirection mode)
{
BindTypeAdaptor<bool> * bnd = new BindTypeAdaptor<bool>(*this, name, mode, value);
boolean res = OCI_BindBoolean(*this, name.c_str(), static_cast<boolean *>(*bnd));
if (res)
{
BindsHolder *bindsHolder = GetBindsHolder(true);
bindsHolder->AddBindObject(bnd);
SetLastBindMode(mode);
}
else
{
delete bnd;
}
Check(res);
}
template<>
inline void Statement::Bind<short>(const ostring& name, short &value, BindInfo::BindDirection mode)
{
Bind1(OCI_BindShort, name, value, mode);
}
template<>
inline void Statement::Bind<unsigned short>(const ostring& name, unsigned short &value, BindInfo::BindDirection mode)
{
Bind1(OCI_BindUnsignedShort, name, value, mode);
}
template<>
inline void Statement::Bind<int>(const ostring& name, int &value, BindInfo::BindDirection mode)
{
Bind1(OCI_BindInt, name, value, mode);
}
template<>
inline void Statement::Bind<unsigned int>(const ostring& name, unsigned int &value, BindInfo::BindDirection mode)
{
Bind1(OCI_BindUnsignedInt, name, value, mode);
}
template<>
inline void Statement::Bind<big_int>(const ostring& name, big_int &value, BindInfo::BindDirection mode)
{
Bind1(OCI_BindBigInt, name, value, mode);
}
template<>
inline void Statement::Bind<big_uint>(const ostring& name, big_uint &value, BindInfo::BindDirection mode)
{
Bind1(OCI_BindUnsignedBigInt, name, value, mode);
}
template<>
inline void Statement::Bind<float>(const ostring& name, float &value, BindInfo::BindDirection mode)
{
Bind1(OCI_BindFloat, name, value, mode);
}
template<>
inline void Statement::Bind<double>(const ostring& name, double &value, BindInfo::BindDirection mode)
{
Bind1(OCI_BindDouble, name, value, mode);
}
template<>
inline void Statement::Bind<Number>(const ostring& name, Number &value, BindInfo::BindDirection mode)
{
Bind2(OCI_BindNumber, name, value, mode);
}
template<>
inline void Statement::Bind<Date>(const ostring& name, Date &value, BindInfo::BindDirection mode)
{
Bind2(OCI_BindDate, name, value, mode);
}
template<>
inline void Statement::Bind<Timestamp>(const ostring& name, Timestamp &value, BindInfo::BindDirection mode)
{
Bind2(OCI_BindTimestamp, name, value, mode);
}
template<>
inline void Statement::Bind<Interval>(const ostring& name, Interval &value, BindInfo::BindDirection mode)
{
Bind2(OCI_BindInterval, name, value, mode);
}
template<>
inline void Statement::Bind<Clob>(const ostring& name, Clob &value, BindInfo::BindDirection mode)
{
Bind2(OCI_BindLob, name, value, mode);
}
template<>
inline void Statement::Bind<NClob>(const ostring& name, NClob &value, BindInfo::BindDirection mode)
{
Bind2(OCI_BindLob, name, value, mode);
}
template<>
inline void Statement::Bind<Blob>(const ostring& name, Blob &value, BindInfo::BindDirection mode)
{
Bind2(OCI_BindLob, name, value, mode);
}
template<>
inline void Statement::Bind<File>(const ostring& name, File &value, BindInfo::BindDirection mode)
{
Bind2(OCI_BindFile, name, value, mode);
}
template<>
inline void Statement::Bind<Object>(const ostring& name, Object &value, BindInfo::BindDirection mode)
{
Bind2(OCI_BindObject, name, value, mode);
}
template<>
inline void Statement::Bind<Reference>(const ostring& name, Reference &value, BindInfo::BindDirection mode)
{
Bind2(OCI_BindRef, name, value, mode);
}
template<>
inline void Statement::Bind<Statement>(const ostring& name, Statement &value, BindInfo::BindDirection mode)
{
Bind2(OCI_BindStatement, name, value, mode);
}
template<>
inline void Statement::Bind<Clong, unsigned int>(const ostring& name, Clong &value, unsigned int maxSize, BindInfo::BindDirection mode)
{
Check(OCI_BindLong(*this, name.c_str(), value, maxSize));
SetLastBindMode(mode);
}
template<>
inline void Statement::Bind<Clong, int>(const ostring& name, Clong &value, int maxSize, BindInfo::BindDirection mode)
{
Bind<Clong, unsigned int>(name, value, static_cast<unsigned int>(maxSize), mode);
}
template<>
inline void Statement::Bind<Blong, unsigned int>(const ostring& name, Blong &value, unsigned int maxSize, BindInfo::BindDirection mode)
{
Check(OCI_BindLong(*this, name.c_str(), value, maxSize));
SetLastBindMode(mode);
}
template<>
inline void Statement::Bind<Blong, int>(const ostring& name, Blong &value, int maxSize, BindInfo::BindDirection mode)
{
Bind<Blong, unsigned int>(name, value, static_cast<unsigned int>(maxSize), mode);
}
template<>
inline void Statement::Bind<ostring, unsigned int>(const ostring& name, ostring &value, unsigned int maxSize, BindInfo::BindDirection mode)
{
if (maxSize == 0)
{
maxSize = static_cast<unsigned int>(value.size());
}
value.reserve(maxSize);
BindObjectAdaptor<ostring> * bnd = new BindObjectAdaptor<ostring>(*this, name, mode, value, maxSize + 1);
boolean res = OCI_BindString(*this, name.c_str(), static_cast<otext *>(*bnd), maxSize);
if (res)
{
BindsHolder *bindsHolder = GetBindsHolder(true);
bindsHolder->AddBindObject(bnd);
SetLastBindMode(mode);
}
else
{
delete bnd;
}
Check(res);
}
template<>
inline void Statement::Bind<ostring, int>(const ostring& name, ostring &value, int maxSize, BindInfo::BindDirection mode)
{
Bind<ostring, unsigned int>(name, value, static_cast<unsigned int>(maxSize), mode);
}
template<>
inline void Statement::Bind<Raw, unsigned int>(const ostring& name, Raw &value, unsigned int maxSize, BindInfo::BindDirection mode)
{
if (maxSize == 0)
{
maxSize = static_cast<unsigned int>(value.size());
}
value.reserve(maxSize);
BindObjectAdaptor<Raw> * bnd = new BindObjectAdaptor<Raw>(*this, name, mode, value, maxSize);
boolean res = OCI_BindRaw(*this, name.c_str(), static_cast<unsigned char *>(*bnd), maxSize);
if (res)
{
BindsHolder *bindsHolder = GetBindsHolder(true);
bindsHolder->AddBindObject(bnd);
SetLastBindMode(mode);
}
else
{
delete bnd;
}
Check(res);
}
template<>
inline void Statement::Bind<Raw, int>(const ostring& name, Raw &value, int maxSize, BindInfo::BindDirection mode)
{
Bind<Raw, unsigned int>(name, value, static_cast<unsigned int>(maxSize), mode);
}
template<>
inline void Statement::Bind<short>(const ostring& name, std::vector<short> &values, BindInfo::BindDirection mode)
{
BindVector1(OCI_BindArrayOfShorts, name, values, mode);
}
template<>
inline void Statement::Bind<unsigned short>(const ostring& name, std::vector<unsigned short> &values, BindInfo::BindDirection mode)
{
BindVector1(OCI_BindArrayOfUnsignedShorts, name, values, mode);
}
template<>
inline void Statement::Bind<int>(const ostring& name, std::vector<int> &values, BindInfo::BindDirection mode)
{
BindVector1(OCI_BindArrayOfInts, name, values, mode);
}
template<>
inline void Statement::Bind<unsigned int>(const ostring& name, std::vector<unsigned int> &values, BindInfo::BindDirection mode)
{
BindVector1(OCI_BindArrayOfUnsignedInts, name, values, mode);
}
template<>
inline void Statement::Bind<big_int>(const ostring& name, std::vector<big_int> &values, BindInfo::BindDirection mode)
{
BindVector1(OCI_BindArrayOfBigInts, name, values, mode);
}
template<>
inline void Statement::Bind<big_uint>(const ostring& name, std::vector<big_uint> &values, BindInfo::BindDirection mode)
{
BindVector1(OCI_BindArrayOfUnsignedBigInts, name, values, mode);
}
template<>
inline void Statement::Bind<float>(const ostring& name, std::vector<float> &values, BindInfo::BindDirection mode)
{
BindVector1(OCI_BindArrayOfFloats, name, values, mode);
}
template<>
inline void Statement::Bind<double>(const ostring& name, std::vector<double> &values, BindInfo::BindDirection mode)
{
BindVector1(OCI_BindArrayOfDoubles, name, values, mode);
}
template<>
inline void Statement::Bind<Date>(const ostring& name, std::vector<Date> &values, BindInfo::BindDirection mode)
{
BindVector1(OCI_BindArrayOfDates, name, values, mode);
}
template<>
inline void Statement::Bind<Number>(const ostring& name, std::vector<Number> &values, BindInfo::BindDirection mode)
{
BindVector1(OCI_BindArrayOfNumbers, name, values, mode);
}
template<class T>
void Statement::Bind(const ostring& name, Collection<T> &value, BindInfo::BindDirection mode)
{
Check(OCI_BindColl(*this, name.c_str(), value));
SetLastBindMode(mode);
}
template<>
inline void Statement::Bind<Timestamp, Timestamp::TimestampTypeValues>(const ostring& name, std::vector<Timestamp> &values, Timestamp::TimestampTypeValues type, BindInfo::BindDirection mode)
{
BindVector2(OCI_BindArrayOfTimestamps, name, values, mode, type);
}
template<>
inline void Statement::Bind<Timestamp, Timestamp::TimestampType>(const ostring& name, std::vector<Timestamp> &values, Timestamp::TimestampType type, BindInfo::BindDirection mode)
{
Bind<Timestamp, Timestamp::TimestampTypeValues>(name, values, type.GetValue(), mode);
}
template<>
inline void Statement::Bind<Interval, Interval::IntervalTypeValues>(const ostring& name, std::vector<Interval> &values, Interval::IntervalTypeValues type, BindInfo::BindDirection mode)
{
BindVector2(OCI_BindArrayOfIntervals, name, values, mode, type);
}
template<>
inline void Statement::Bind<Interval, Interval::IntervalType>(const ostring& name, std::vector<Interval> &values, Interval::IntervalType type, BindInfo::BindDirection mode)
{
Bind<Interval, Interval::IntervalTypeValues>(name, values, type.GetValue(), mode);
}
template<>
inline void Statement::Bind<Clob>(const ostring& name, std::vector<Clob> &values, BindInfo::BindDirection mode)
{
BindVector2(OCI_BindArrayOfLobs, name, values, mode, static_cast<unsigned int>(OCI_CLOB));
}
template<>
inline void Statement::Bind<NClob>(const ostring& name, std::vector<NClob> &values, BindInfo::BindDirection mode)
{
BindVector2(OCI_BindArrayOfLobs, name, values, mode, static_cast<unsigned int>(OCI_NCLOB));
}
template<>
inline void Statement::Bind<Blob>(const ostring& name, std::vector<Blob> &values, BindInfo::BindDirection mode)
{
BindVector2(OCI_BindArrayOfLobs, name, values, mode, static_cast<unsigned int>(OCI_BLOB));
}
template<>
inline void Statement::Bind<File>(const ostring& name, std::vector<File> &values, BindInfo::BindDirection mode)
{
BindVector2(OCI_BindArrayOfFiles, name, values, mode, static_cast<unsigned int>(OCI_BFILE));
}
template<>
inline void Statement::Bind<Object>(const ostring& name, std::vector<Object> &values, TypeInfo &typeInfo, BindInfo::BindDirection mode)
{
BindVector2(OCI_BindArrayOfObjects, name, values, mode, static_cast<OCI_TypeInfo *>(typeInfo));
}
template<>
inline void Statement::Bind<Reference>(const ostring& name, std::vector<Reference> &values, TypeInfo &typeInfo, BindInfo::BindDirection mode)
{
BindVector2(OCI_BindArrayOfRefs, name, values, mode, static_cast<OCI_TypeInfo *>(typeInfo));
}
template<class T>
void Statement::Bind(const ostring& name, std::vector<Collection<T> > &values, TypeInfo &typeInfo, BindInfo::BindDirection mode)
{
BindVector2(OCI_BindArrayOfColls, name, values, mode, static_cast<OCI_TypeInfo *>(typeInfo));
}
template<>
inline void Statement::Bind<ostring, unsigned int>(const ostring& name, std::vector<ostring> &values, unsigned int maxSize, BindInfo::BindDirection mode)
{
BindArray * bnd = new BindArray(*this, name, mode);
bnd->SetVector<ostring>(values, maxSize+1);
boolean res = OCI_BindArrayOfStrings(*this, name.c_str(), bnd->GetData<ostring>(), maxSize, 0);
if (res)
{
BindsHolder *bindsHolder = GetBindsHolder(true);
bindsHolder->AddBindObject(bnd);
SetLastBindMode(mode);
}
else
{
delete bnd;
}
Check(res);
}
template<>
inline void Statement::Bind<ostring, int>(const ostring& name, std::vector<ostring> &values, int maxSize, BindInfo::BindDirection mode)
{
Bind<ostring, unsigned int>(name, values, static_cast<unsigned int>(maxSize), mode);
}
template<>
inline void Statement::Bind<Raw, unsigned int>(const ostring& name, std::vector<Raw> &values, unsigned int maxSize, BindInfo::BindDirection mode)
{
BindArray * bnd = new BindArray(*this, name, mode);
bnd->SetVector<Raw>(values, maxSize);
boolean res = OCI_BindArrayOfRaws(*this, name.c_str(), bnd->GetData<Raw>(), maxSize, 0);
if (res)
{
BindsHolder *bindsHolder = GetBindsHolder(true);
bindsHolder->AddBindObject(bnd);
SetLastBindMode(mode);
}
else
{
delete bnd;
}
Check(res);
}
template<class T>
void Statement::Bind(const ostring& name, std::vector<T> &values, TypeInfo &typeInfo, BindInfo::BindDirection mode)
{
BindVector2(OCI_BindArrayOfColls, name, values, mode, static_cast<OCI_TypeInfo *>(typeInfo));
}
template<>
inline void Statement::Register<unsigned short>(const ostring& name)
{
Check(OCI_RegisterUnsignedShort(*this, name.c_str()));
}
template<>
inline void Statement::Register<short>(const ostring& name)
{
Check(OCI_RegisterShort(*this, name.c_str()));
}
template<>
inline void Statement::Register<unsigned int>(const ostring& name)
{
Check(OCI_RegisterUnsignedInt(*this, name.c_str()));
}
template<>
inline void Statement::Register<int>(const ostring& name)
{
Check(OCI_RegisterInt(*this, name.c_str()));
}
template<>
inline void Statement::Register<big_uint>(const ostring& name)
{
Check(OCI_RegisterUnsignedBigInt(*this, name.c_str()));
}
template<>
inline void Statement::Register<big_int>(const ostring& name)
{
Check(OCI_RegisterBigInt(*this, name.c_str()));
}
template<>
inline void Statement::Register<float>(const ostring& name)
{
Check(OCI_RegisterFloat(*this, name.c_str()));
}
template<>
inline void Statement::Register<double>(const ostring& name)
{
Check(OCI_RegisterDouble(*this, name.c_str()));
}
template<>
inline void Statement::Register<Number>(const ostring& name)
{
Check(OCI_RegisterNumber(*this, name.c_str()));
}
template<>
inline void Statement::Register<Date>(const ostring& name)
{
Check(OCI_RegisterDate(*this, name.c_str()));
}
template<>
inline void Statement::Register<Timestamp, Timestamp::TimestampTypeValues>(const ostring& name, Timestamp::TimestampTypeValues type)
{
Check(OCI_RegisterTimestamp(*this, name.c_str(), type));
}
template<>
inline void Statement::Register<Timestamp, Timestamp::TimestampType>(const ostring& name, Timestamp::TimestampType type)
{
Register<Timestamp, Timestamp::TimestampTypeValues>(name, type.GetValue());
}
template<>
inline void Statement::Register<Interval, Interval::IntervalTypeValues>(const ostring& name, Interval::IntervalTypeValues type)
{
Check(OCI_RegisterInterval(*this, name.c_str(), type));
}
template<>
inline void Statement::Register<Interval, Interval::IntervalType>(const ostring& name, Interval::IntervalType type)
{
Register<Interval, Interval::IntervalTypeValues>(name, type.GetValue());
}
template<>
inline void Statement::Register<Clob>(const ostring& name)
{
Check(OCI_RegisterLob(*this, name.c_str(), OCI_CLOB));
}
template<>
inline void Statement::Register<NClob>(const ostring& name)
{
Check(OCI_RegisterLob(*this, name.c_str(), OCI_NCLOB));
}
template<>
inline void Statement::Register<Blob>(const ostring& name)
{
Check(OCI_RegisterLob(*this, name.c_str(), OCI_BLOB));
}
template<>
inline void Statement::Register<File>(const ostring& name)
{
Check(OCI_RegisterFile(*this, name.c_str(), OCI_BFILE));
}
template<>
inline void Statement::Register<Object, TypeInfo>(const ostring& name, TypeInfo& typeInfo)
{
Check(OCI_RegisterObject(*this, name.c_str(), typeInfo));
}
template<>
inline void Statement::Register<Reference, TypeInfo>(const ostring& name, TypeInfo& typeInfo)
{
Check(OCI_RegisterRef(*this, name.c_str(), typeInfo));
}
template<>
inline void Statement::Register<ostring, unsigned int>(const ostring& name, unsigned int len)
{
Check(OCI_RegisterString(*this, name.c_str(), len));
}
template<>
inline void Statement::Register<ostring, int>(const ostring& name, int len)
{
Register<ostring, unsigned int>(name, static_cast<unsigned int>(len));
}
template<>
inline void Statement::Register<Raw, unsigned int>(const ostring& name, unsigned int len)
{
Check(OCI_RegisterRaw(*this, name.c_str(), len));
}
template<>
inline void Statement::Register<Raw, int>(const ostring& name, int len)
{
Register<Raw, unsigned int>(name, static_cast<unsigned int>(len));
}
inline Statement::StatementType Statement::GetStatementType() const
{
return StatementType(static_cast<StatementType::Type>(Check(OCI_GetStatementType(*this))));
}
inline unsigned int Statement::GetSqlErrorPos() const
{
return Check(OCI_GetSqlErrorPos(*this));
}
inline void Statement::SetFetchMode(FetchMode value)
{
Check(OCI_SetFetchMode(*this, value));
}
inline Statement::FetchMode Statement::GetFetchMode() const
{
return FetchMode(static_cast<FetchMode::Type>(Check(OCI_GetFetchMode(*this))));
}
inline void Statement::SetBindMode(BindMode value)
{
Check(OCI_SetBindMode(*this, value));
}
inline Statement::BindMode Statement::GetBindMode() const
{
return BindMode(static_cast<BindMode::Type>(Check(OCI_GetBindMode(*this))));
}
inline void Statement::SetFetchSize(unsigned int value)
{
Check(OCI_SetFetchSize(*this, value));
}
inline unsigned int Statement::GetFetchSize() const
{
return Check(OCI_GetFetchSize(*this));
}
inline void Statement::SetPrefetchSize(unsigned int value)
{
Check(OCI_SetPrefetchSize(*this, value));
}
inline unsigned int Statement::GetPrefetchSize() const
{
return Check(OCI_GetPrefetchSize(*this));
}
inline void Statement::SetPrefetchMemory(unsigned int value)
{
Check(OCI_SetPrefetchMemory(*this, value));
}
inline unsigned int Statement::GetPrefetchMemory() const
{
return Check(OCI_GetPrefetchMemory(*this));
}
inline void Statement::SetLongMaxSize(unsigned int value)
{
Check(OCI_SetLongMaxSize(*this, value));
}
inline unsigned int Statement::GetLongMaxSize() const
{
return Check(OCI_GetLongMaxSize(*this));
}
inline void Statement::SetLongMode(LongMode value)
{
Check(OCI_SetLongMode(*this, value));
}
inline Statement::LongMode Statement::GetLongMode() const
{
return LongMode(static_cast<LongMode::Type>(Check(OCI_GetLongMode(*this))));
}
inline unsigned int Statement::GetSQLCommand() const
{
return Check(OCI_GetSQLCommand(*this));
}
inline ostring Statement::GetSQLVerb() const
{
return MakeString(Check(OCI_GetSQLVerb(*this)));
}
inline void Statement::GetBatchErrors(std::vector<Exception> &exceptions)
{
exceptions.clear();
OCI_Error *err = Check(OCI_GetBatchError(*this));
while (err)
{
exceptions.push_back(Exception(err));
err = Check(OCI_GetBatchError(*this));
}
}
inline void Statement::ClearBinds() const
{
BindsHolder *bindsHolder = GetBindsHolder(false);
if (bindsHolder)
{
bindsHolder->Clear();
}
}
inline void Statement::SetOutData() const
{
BindsHolder *bindsHolder = GetBindsHolder(false);
if (bindsHolder)
{
bindsHolder->SetOutData();
}
}
inline void Statement::SetInData() const
{
BindsHolder *bindsHolder = GetBindsHolder(false);
if (bindsHolder)
{
bindsHolder->SetInData();
}
}
inline void Statement::ReleaseResultsets() const
{
if (_smartHandle)
{
Handle *handle = nullptr;
while (_smartHandle->GetChildren().FindIf(IsResultsetHandle, handle))
{
if (handle)
{
handle->DetachFromHolders();
delete handle;
handle = nullptr;
}
}
}
}
inline bool Statement::IsResultsetHandle(Handle *handle)
{
Resultset::SmartHandle *smartHandle = dynamic_cast<Resultset::SmartHandle *>(handle);
return smartHandle != nullptr;
}
inline void Statement::OnFreeSmartHandle(SmartHandle *smartHandle)
{
if (smartHandle)
{
BindsHolder *bindsHolder = static_cast<BindsHolder *>(smartHandle->GetExtraInfos());
smartHandle->SetExtraInfos(nullptr);
delete bindsHolder;
}
}
inline void Statement::SetLastBindMode(BindInfo::BindDirection mode)
{
Check(OCI_BindSetDirection(Check(OCI_GetBind(*this, Check(OCI_GetBindCount(*this)))), mode));
}
inline BindsHolder * Statement::GetBindsHolder(bool create) const
{
BindsHolder * bindsHolder = static_cast<BindsHolder *>(_smartHandle->GetExtraInfos());
if (bindsHolder == nullptr && create)
{
bindsHolder = new BindsHolder(*this);
_smartHandle->SetExtraInfos(bindsHolder);
}
return bindsHolder;
}
/* --------------------------------------------------------------------------------------------- *
* Resultset
* --------------------------------------------------------------------------------------------- */
inline Resultset::Resultset(OCI_Resultset *resultset, Handle *parent)
{
Acquire(resultset, nullptr, nullptr, parent);
}
inline bool Resultset::Next()
{
return (Check(OCI_FetchNext(*this)) == TRUE);
}
inline bool Resultset::Prev()
{
return (Check(OCI_FetchPrev(*this)) == TRUE);
}
inline bool Resultset::First()
{
return (Check(OCI_FetchFirst(*this)) == TRUE);
}
inline bool Resultset::Last()
{
return (Check(OCI_FetchLast(*this)) == TRUE);
}
inline bool Resultset::Seek(SeekMode mode, int offset)
{
return (Check(OCI_FetchSeek(*this, mode, offset)) == TRUE);
}
inline unsigned int Resultset::GetCount() const
{
return Check(OCI_GetRowCount(*this));
}
inline unsigned int Resultset::GetCurrentRow() const
{
return Check(OCI_GetCurrentRow(*this));
}
inline unsigned int Resultset::GetColumnIndex(const ostring& name) const
{
return Check(OCI_GetColumnIndex(*this, name.c_str()));
}
inline unsigned int Resultset::GetColumnCount() const
{
return Check(OCI_GetColumnCount(*this));
}
inline Column Resultset::GetColumn(unsigned int index) const
{
return Column(Check(OCI_GetColumn(*this, index)), GetHandle());
}
inline Column Resultset::GetColumn(const ostring& name) const
{
return Column(Check(OCI_GetColumn2(*this, name.c_str())), GetHandle());
}
inline bool Resultset::IsColumnNull(unsigned int index) const
{
return (Check(OCI_IsNull(*this, index)) == TRUE);
}
inline bool Resultset::IsColumnNull(const ostring& name) const
{
return (Check(OCI_IsNull2(*this, name.c_str())) == TRUE);
}
inline Statement Resultset::GetStatement() const
{
return Statement( Check(OCI_ResultsetGetStatement(*this)), nullptr);
}
inline bool Resultset::operator ++ (int)
{
return Next();
}
inline bool Resultset::operator -- (int)
{
return Prev();
}
inline bool Resultset::operator += (int offset)
{
return Seek(SeekRelative, offset);
}
inline bool Resultset::operator -= (int offset)
{
return Seek(SeekRelative, -offset);
}
template<class T>
void Resultset::Get(unsigned int index, T& value) const
{
value = Get<T>(index);
}
template<class T>
void Resultset::Get(const ostring &name, T& value) const
{
value = Get<T>(name);
}
template<class T, class TAdapter>
bool Resultset::Get(T& value, TAdapter adapter) const
{
return adapter(static_cast<const Resultset&>(*this), value);
}
template<class TCallback>
unsigned int Resultset::ForEach(TCallback callback)
{
while (Next())
{
if (!callback(static_cast<const Resultset&>(*this)))
{
break;
}
}
return GetCurrentRow();
}
template<class T, class U>
unsigned int Resultset::ForEach(T callback, U adapter)
{
while (Next())
{
if (!callback(adapter(static_cast<const Resultset&>(*this))))
{
break;
}
}
return GetCurrentRow();
}
template<>
inline short Resultset::Get<short>(unsigned int index) const
{
return Check(OCI_GetShort(*this, index));
}
template<>
inline short Resultset::Get<short>(const ostring& name) const
{
return Check(OCI_GetShort2(*this, name.c_str()));
}
template<>
inline unsigned short Resultset::Get<unsigned short>(unsigned int index) const
{
return Check(OCI_GetUnsignedShort(*this, index));
}
template<>
inline unsigned short Resultset::Get<unsigned short>(const ostring& name) const
{
return Check(OCI_GetUnsignedShort2(*this, name.c_str()));
}
template<>
inline int Resultset::Get<int>(unsigned int index) const
{
return Check(OCI_GetInt(*this, index));
}
template<>
inline int Resultset::Get<int>(const ostring& name) const
{
return Check(OCI_GetInt2(*this, name.c_str()));
}
template<>
inline unsigned int Resultset::Get<unsigned int>(unsigned int index) const
{
return Check(OCI_GetUnsignedInt(*this, index));
}
template<>
inline unsigned int Resultset::Get<unsigned int>(const ostring& name) const
{
return Check(OCI_GetUnsignedInt2(*this, name.c_str()));
}
template<>
inline big_int Resultset::Get<big_int>(unsigned int index) const
{
return Check(OCI_GetBigInt(*this, index));
}
template<>
inline big_int Resultset::Get<big_int>(const ostring& name) const
{
return Check(OCI_GetBigInt2(*this, name.c_str()));
}
template<>
inline big_uint Resultset::Get<big_uint>(unsigned int index) const
{
return Check(OCI_GetUnsignedBigInt(*this, index));
}
template<>
inline big_uint Resultset::Get<big_uint>(const ostring& name) const
{
return Check(OCI_GetUnsignedBigInt2(*this, name.c_str()));
}
template<>
inline float Resultset::Get<float>(unsigned int index) const
{
return Check(OCI_GetFloat(*this, index));
}
template<>
inline float Resultset::Get<float>(const ostring& name) const
{
return Check(OCI_GetFloat2(*this, name.c_str()));
}
template<>
inline double Resultset::Get<double>(unsigned int index) const
{
return Check(OCI_GetDouble(*this, index));
}
template<>
inline double Resultset::Get<double>(const ostring& name) const
{
return Check(OCI_GetDouble2(*this, name.c_str()));
}
template<>
inline Number Resultset::Get<Number>(unsigned int index) const
{
return Number(Check(OCI_GetNumber(*this, index)), GetHandle());
}
template<>
inline Number Resultset::Get<Number>(const ostring& name) const
{
return Number(Check(OCI_GetNumber2(*this, name.c_str())), GetHandle());
}
template<>
inline ostring Resultset::Get<ostring>(unsigned int index) const
{
return MakeString(Check(OCI_GetString(*this, index)));
}
template<>
inline ostring Resultset::Get<ostring>(const ostring& name) const
{
return MakeString(Check(OCI_GetString2(*this,name.c_str())));
}
template<>
inline Raw Resultset::Get<Raw>(unsigned int index) const
{
unsigned int size = Check(OCI_GetDataLength(*this,index));
ManagedBuffer<unsigned char> buffer(size + 1);
size = Check(OCI_GetRaw(*this, index, static_cast<AnyPointer>(buffer), size));
return MakeRaw(buffer, size);
}
template<>
inline Raw Resultset::Get<Raw>(const ostring& name) const
{
unsigned int size = Check(OCI_GetDataLength(*this, Check(OCI_GetColumnIndex(*this, name.c_str()))));
ManagedBuffer<unsigned char> buffer(size + 1);
size = Check(OCI_GetRaw2(*this, name.c_str(), static_cast< AnyPointer >(buffer), size));
return MakeRaw(buffer, size);
}
template<>
inline Date Resultset::Get<Date>(unsigned int index) const
{
return Date(Check(OCI_GetDate(*this, index)), GetHandle());
}
template<>
inline Date Resultset::Get<Date>(const ostring& name) const
{
return Date(Check(OCI_GetDate2(*this,name.c_str())), GetHandle());
}
template<>
inline Timestamp Resultset::Get<Timestamp>(unsigned int index) const
{
return Timestamp(Check(OCI_GetTimestamp(*this, index)), GetHandle());
}
template<>
inline Timestamp Resultset::Get<Timestamp>(const ostring& name) const
{
return Timestamp(Check(OCI_GetTimestamp2(*this,name.c_str())), GetHandle());
}
template<>
inline Interval Resultset::Get<Interval>(unsigned int index) const
{
return Interval(Check(OCI_GetInterval(*this, index)), GetHandle());
}
template<>
inline Interval Resultset::Get<Interval>(const ostring& name) const
{
return Interval(Check(OCI_GetInterval2(*this,name.c_str())), GetHandle());
}
template<>
inline Object Resultset::Get<Object>(unsigned int index) const
{
return Object(Check(OCI_GetObject(*this, index)), GetHandle());
}
template<>
inline Object Resultset::Get<Object>(const ostring& name) const
{
return Object(Check(OCI_GetObject2(*this,name.c_str())), GetHandle());
}
template<>
inline Reference Resultset::Get<Reference>(unsigned int index) const
{
return Reference(Check(OCI_GetRef(*this, index)), GetHandle());
}
template<>
inline Reference Resultset::Get<Reference>(const ostring& name) const
{
return Reference(Check(OCI_GetRef2(*this,name.c_str())), GetHandle());
}
template<>
inline Statement Resultset::Get<Statement>(unsigned int index) const
{
return Statement(Check(OCI_GetStatement(*this, index)), GetHandle());
}
template<>
inline Statement Resultset::Get<Statement>(const ostring& name) const
{
return Statement(Check(OCI_GetStatement2(*this,name.c_str())), GetHandle());
}
template<>
inline Clob Resultset::Get<Clob>(unsigned int index) const
{
return Clob(Check(OCI_GetLob(*this, index)), GetHandle());
}
template<>
inline Clob Resultset::Get<Clob>(const ostring& name) const
{
return Clob(Check(OCI_GetLob2(*this,name.c_str())), GetHandle());
}
template<>
inline NClob Resultset::Get<NClob>(unsigned int index) const
{
return NClob(Check(OCI_GetLob(*this, index)), GetHandle());
}
template<>
inline NClob Resultset::Get<NClob>(const ostring& name) const
{
return NClob(Check(OCI_GetLob2(*this, name.c_str())), GetHandle());
}
template<>
inline Blob Resultset::Get<Blob>(unsigned int index) const
{
return Blob(Check(OCI_GetLob(*this, index)), GetHandle());
}
template<>
inline Blob Resultset::Get<Blob>(const ostring& name) const
{
return Blob(Check(OCI_GetLob2(*this,name.c_str())), GetHandle());
}
template<>
inline File Resultset::Get<File>(unsigned int index) const
{
return File(Check(OCI_GetFile(*this, index)), GetHandle());
}
template<>
inline File Resultset::Get<File>(const ostring& name) const
{
return File(Check(OCI_GetFile2(*this,name.c_str())), GetHandle());
}
template<>
inline Clong Resultset::Get<Clong>(unsigned int index) const
{
return Clong(Check(OCI_GetLong(*this, index)), GetHandle());
}
template<>
inline Clong Resultset::Get<Clong>(const ostring& name) const
{
return Clong(Check(OCI_GetLong2(*this,name.c_str())), GetHandle());
}
template<>
inline Blong Resultset::Get<Blong>(unsigned int index) const
{
return Blong(Check(OCI_GetLong(*this, index)), GetHandle());
}
template<>
inline Blong Resultset::Get<Blong>(const ostring& name) const
{
return Blong(Check(OCI_GetLong2(*this,name.c_str())), GetHandle());
}
template<class T>
T Resultset::Get(unsigned int index) const
{
return T(Check(OCI_GetColl(*this, index)), GetHandle());
}
template<class T>
T Resultset::Get(const ostring& name) const
{
return T(Check(OCI_GetColl2(*this, name.c_str())), GetHandle());
}
/* --------------------------------------------------------------------------------------------- *
* Column
* --------------------------------------------------------------------------------------------- */
inline Column::Column(OCI_Column *pColumn, Handle *parent)
{
Acquire(pColumn, nullptr, nullptr, parent);
}
inline ostring Column::GetName() const
{
return MakeString(Check(OCI_ColumnGetName(*this)));
}
inline ostring Column::GetSQLType() const
{
return MakeString(Check(OCI_ColumnGetSQLType(*this)));
}
inline ostring Column::GetFullSQLType() const
{
unsigned int size = OCI_SIZE_BUFFER;
ManagedBuffer<otext> buffer(size + 1);
Check(OCI_ColumnGetFullSQLType(*this, buffer, size));
return MakeString(static_cast<const otext *>(buffer));
}
inline DataType Column::GetType() const
{
return DataType(static_cast<DataType::Type>(Check(OCI_ColumnGetType(*this))));
}
inline unsigned int Column::GetSubType() const
{
return Check(OCI_ColumnGetSubType(*this));
}
inline CharsetForm Column::GetCharsetForm() const
{
return CharsetForm(static_cast<CharsetForm::Type>(Check(OCI_ColumnGetCharsetForm(*this))));
}
inline unsigned int Column::GetSize() const
{
return Check(OCI_ColumnGetSize(*this));
}
inline int Column::GetScale() const
{
return Check(OCI_ColumnGetScale(*this));
}
inline int Column::GetPrecision() const
{
return Check(OCI_ColumnGetPrecision(*this));
}
inline int Column::GetFractionalPrecision() const
{
return Check(OCI_ColumnGetFractionalPrecision(*this));
}
inline int Column::GetLeadingPrecision() const
{
return Check(OCI_ColumnGetLeadingPrecision(*this));
}
inline Column::PropertyFlags Column::GetPropertyFlags() const
{
return PropertyFlags(static_cast<PropertyFlags::Type>(Check(OCI_ColumnGetPropertyFlags(*this))));
}
inline bool Column::IsNullable() const
{
return (Check(OCI_ColumnGetNullable(*this)) == TRUE);
}
inline bool Column::IsCharSemanticUsed() const
{
return (Check(OCI_ColumnGetCharUsed(*this)) == TRUE);
}
inline TypeInfo Column::GetTypeInfo() const
{
return TypeInfo(Check(OCI_ColumnGetTypeInfo(*this)));
}
/* --------------------------------------------------------------------------------------------- *
* Subscription
* --------------------------------------------------------------------------------------------- */
inline Subscription::Subscription()
{
}
inline Subscription::Subscription(OCI_Subscription *pSubcription)
{
Acquire(pSubcription, nullptr, nullptr, nullptr);
}
inline void Subscription::Register(const Connection &connection, const ostring& name, ChangeTypes changeTypes, NotifyHandlerProc handler, unsigned int port, unsigned int timeout)
{
Acquire(Check(OCI_SubscriptionRegister(connection, name.c_str(), changeTypes.GetValues(),
static_cast< POCI_NOTIFY > (handler != nullptr ? Environment::NotifyHandler : nullptr), port, timeout)),
reinterpret_cast<HandleFreeFunc>(OCI_SubscriptionUnregister), nullptr, nullptr);
Environment::SetUserCallback<Subscription::NotifyHandlerProc>(static_cast< OCI_Subscription*>(*this), handler);
}
inline void Subscription::Unregister()
{
Environment::SetUserCallback<Subscription::NotifyHandlerProc>(static_cast< OCI_Subscription*>(*this), nullptr);
Release();
}
inline void Subscription::Watch(const ostring& sql)
{
Statement st(GetConnection());
st.Execute(sql);
Check(OCI_SubscriptionAddStatement(*this, st));
}
inline ostring Subscription::GetName() const
{
return MakeString(Check(OCI_SubscriptionGetName(*this)));
}
inline unsigned int Subscription::GetTimeout() const
{
return Check(OCI_SubscriptionGetTimeout(*this));
}
inline unsigned int Subscription::GetPort() const
{
return Check(OCI_SubscriptionGetPort(*this));
}
inline Connection Subscription::GetConnection() const
{
return Connection(Check(OCI_SubscriptionGetConnection(*this)), nullptr);
}
/* --------------------------------------------------------------------------------------------- *
* Event
* --------------------------------------------------------------------------------------------- */
inline Event::Event(OCI_Event *pEvent)
{
Acquire(pEvent, nullptr, nullptr, nullptr);
}
inline Event::EventType Event::GetType() const
{
return EventType(static_cast<EventType::Type>(Check(OCI_EventGetType(*this))));
}
inline Event::ObjectEvent Event::GetObjectEvent() const
{
return ObjectEvent(static_cast<ObjectEvent::Type>(Check(OCI_EventGetOperation(*this))));
}
inline ostring Event::GetDatabaseName() const
{
return MakeString(Check(OCI_EventGetDatabase(*this)));
}
inline ostring Event::GetObjectName() const
{
return MakeString(Check(OCI_EventGetObject(*this)));
}
inline ostring Event::GetRowID() const
{
return MakeString(Check(OCI_EventGetRowid(*this)));
}
inline Subscription Event::GetSubscription() const
{
return Subscription(Check(OCI_EventGetSubscription(*this)));
}
/* --------------------------------------------------------------------------------------------- *
* Agent
* --------------------------------------------------------------------------------------------- */
inline Agent::Agent(const Connection &connection, const ostring& name, const ostring& address)
{
Acquire(Check(OCI_AgentCreate(connection, name.c_str(), address.c_str())), reinterpret_cast<HandleFreeFunc>(OCI_AgentFree), nullptr, nullptr);
}
inline Agent::Agent(OCI_Agent *pAgent, Handle *parent)
{
Acquire(pAgent, nullptr, nullptr, parent);
}
inline ostring Agent::GetName() const
{
return MakeString(Check(OCI_AgentGetName(*this)));
}
inline void Agent::SetName(const ostring& value)
{
Check(OCI_AgentSetName(*this, value.c_str()));
}
inline ostring Agent::GetAddress() const
{
return MakeString(Check(OCI_AgentGetAddress(*this)));
}
inline void Agent::SetAddress(const ostring& value)
{
Check(OCI_AgentSetAddress(*this, value.c_str()));
}
/* --------------------------------------------------------------------------------------------- *
* Message
* --------------------------------------------------------------------------------------------- */
inline Message::Message(const TypeInfo &typeInfo)
{
Acquire(Check(OCI_MsgCreate(typeInfo)), reinterpret_cast<HandleFreeFunc>(OCI_MsgFree), nullptr, nullptr);
}
inline Message::Message(OCI_Msg *pMessage, Handle *parent)
{
Acquire(pMessage, nullptr, nullptr, parent);
}
inline void Message::Reset()
{
Check(OCI_MsgReset(*this));
}
template<>
inline Object Message::GetPayload<Object>()
{
return Object(Check(OCI_MsgGetObject(*this)), nullptr);
}
template<>
inline void Message::SetPayload<Object>(const Object &value)
{
Check(OCI_MsgSetObject(*this, value));
}
template<>
inline Raw Message::GetPayload<Raw>()
{
unsigned int size = 0;
ManagedBuffer<unsigned char> buffer(size + 1);
Check(OCI_MsgGetRaw(*this, static_cast<AnyPointer>(buffer), &size));
return MakeRaw(buffer, size);
}
template<>
inline void Message::SetPayload<Raw>(const Raw &value)
{
if (value.size() > 0)
{
Check(OCI_MsgSetRaw(*this, static_cast<AnyPointer>(const_cast<Raw::value_type *>(&value[0])), static_cast<unsigned int>(value.size())));
}
else
{
Check(OCI_MsgSetRaw(*this, nullptr, 0));
}
}
inline Date Message::GetEnqueueTime() const
{
return Date(Check(OCI_MsgGetEnqueueTime(*this)), nullptr);
}
inline int Message::GetAttemptCount() const
{
return Check(OCI_MsgGetAttemptCount(*this));
}
inline Message::MessageState Message::GetState() const
{
return MessageState(static_cast<MessageState::Type>(Check(OCI_MsgGetState(*this))));
}
inline Raw Message::GetID() const
{
unsigned int size = OCI_SIZE_BUFFER;
ManagedBuffer<unsigned char> buffer(size + 1);
Check(OCI_MsgGetID(*this, static_cast<AnyPointer>(buffer), &size));
return MakeRaw(buffer, size);
}
inline int Message::GetExpiration() const
{
return Check(OCI_MsgGetExpiration(*this));
}
inline void Message::SetExpiration(int value)
{
Check(OCI_MsgSetExpiration(*this, value));
}
inline int Message::GetEnqueueDelay() const
{
return Check(OCI_MsgGetEnqueueDelay(*this));
}
inline void Message::SetEnqueueDelay(int value)
{
Check(OCI_MsgSetEnqueueDelay(*this, value));
}
inline int Message::GetPriority() const
{
return Check(OCI_MsgGetPriority(*this));
}
inline void Message::SetPriority(int value)
{
Check(OCI_MsgSetPriority(*this, value));
}
inline Raw Message::GetOriginalID() const
{
unsigned int size = OCI_SIZE_BUFFER;
ManagedBuffer<unsigned char> buffer(size + 1);
Check(OCI_MsgGetOriginalID(*this, static_cast<AnyPointer>(buffer), &size));
return MakeRaw(buffer, size);
}
inline void Message::SetOriginalID(const Raw &value)
{
if (value.size() > 0)
{
Check(OCI_MsgSetOriginalID(*this, static_cast<AnyPointer>(const_cast<Raw::value_type *>(&value[0])), static_cast<unsigned int>(value.size())));
}
else
{
Check(OCI_MsgSetOriginalID(*this, nullptr, 0));
}
}
inline ostring Message::GetCorrelation() const
{
return MakeString(Check(OCI_MsgGetCorrelation(*this)));
}
inline void Message::SetCorrelation(const ostring& value)
{
Check(OCI_MsgSetCorrelation(*this, value.c_str()));
}
inline ostring Message::GetExceptionQueue() const
{
return MakeString(Check(OCI_MsgGetExceptionQueue(*this)));
}
inline void Message::SetExceptionQueue(const ostring& value)
{
Check(OCI_MsgSetExceptionQueue(*this, value.c_str()));
}
inline Agent Message::GetSender() const
{
return Agent(Check(OCI_MsgGetSender(*this)), nullptr);
}
inline void Message::SetSender(const Agent &agent)
{
Check(OCI_MsgSetSender(*this, agent));
}
inline void Message::SetConsumers(std::vector<Agent> &agents)
{
size_t size = agents.size();
ManagedBuffer<OCI_Agent*> buffer(size);
OCI_Agent ** pAgents = static_cast< OCI_Agent **>(buffer);
for (size_t i = 0; i < size; ++i)
{
pAgents[i] = static_cast<const Agent &>(agents[i]);
}
Check(OCI_MsgSetConsumers(*this, pAgents, static_cast<unsigned int>(size)));
}
/* --------------------------------------------------------------------------------------------- *
* Enqueue
* --------------------------------------------------------------------------------------------- */
inline Enqueue::Enqueue(const TypeInfo &typeInfo, const ostring& queueName)
{
Acquire(Check(OCI_EnqueueCreate(typeInfo, queueName.c_str())), reinterpret_cast<HandleFreeFunc>(OCI_EnqueueFree), nullptr, nullptr);
}
inline void Enqueue::Put(const Message &message)
{
Check(OCI_EnqueuePut(*this, message));
}
inline Enqueue::EnqueueVisibility Enqueue::GetVisibility() const
{
return EnqueueVisibility(static_cast<EnqueueVisibility::Type>(Check(OCI_EnqueueGetVisibility(*this))));
}
inline void Enqueue::SetVisibility(EnqueueVisibility value)
{
Check(OCI_EnqueueSetVisibility(*this, value));
}
inline Enqueue::EnqueueMode Enqueue::GetMode() const
{
return EnqueueMode(static_cast<EnqueueMode::Type>(Check(OCI_EnqueueGetSequenceDeviation(*this))));
}
inline void Enqueue::SetMode(EnqueueMode value)
{
Check(OCI_EnqueueSetSequenceDeviation(*this, value));
}
inline Raw Enqueue::GetRelativeMsgID() const
{
unsigned int size = OCI_SIZE_BUFFER;
ManagedBuffer<unsigned char> buffer(size + 1);
Check(OCI_EnqueueGetRelativeMsgID(*this, static_cast<AnyPointer>(buffer), &size));
return MakeRaw(buffer, size);
}
inline void Enqueue::SetRelativeMsgID(const Raw &value)
{
if (value.size() > 0)
{
Check(OCI_EnqueueSetRelativeMsgID(*this, static_cast<AnyPointer>(const_cast<Raw::value_type *>(&value[0])), static_cast<unsigned int>(value.size())));
}
else
{
Check(OCI_EnqueueSetRelativeMsgID(*this, nullptr, 0));
}
}
/* --------------------------------------------------------------------------------------------- *
* Dequeue
* --------------------------------------------------------------------------------------------- */
inline Dequeue::Dequeue(const TypeInfo &typeInfo, const ostring& queueName)
{
Acquire(Check(OCI_DequeueCreate(typeInfo, queueName.c_str())), reinterpret_cast<HandleFreeFunc>(OCI_DequeueFree), nullptr, nullptr);
}
inline Dequeue::Dequeue(OCI_Dequeue *pDequeue)
{
Acquire(pDequeue, nullptr, nullptr, nullptr);
}
inline Message Dequeue::Get()
{
return Message(Check(OCI_DequeueGet(*this)), nullptr);
}
inline Agent Dequeue::Listen(int timeout)
{
return Agent(Check(OCI_DequeueListen(*this, timeout)), nullptr);
}
inline ostring Dequeue::GetConsumer() const
{
return MakeString(Check(OCI_DequeueGetConsumer(*this)));
}
inline void Dequeue::SetConsumer(const ostring& value)
{
Check(OCI_DequeueSetConsumer(*this, value.c_str()));
}
inline ostring Dequeue::GetCorrelation() const
{
return MakeString(Check(OCI_DequeueGetCorrelation(*this)));
}
inline void Dequeue::SetCorrelation(const ostring& value)
{
Check(OCI_DequeueSetCorrelation(*this, value.c_str()));
}
inline Raw Dequeue::GetRelativeMsgID() const
{
unsigned int size = OCI_SIZE_BUFFER;
ManagedBuffer<unsigned char> buffer(size + 1);
Check(OCI_DequeueGetRelativeMsgID(*this, static_cast<AnyPointer>(buffer), &size));
return MakeRaw(buffer, size);
}
inline void Dequeue::SetRelativeMsgID(const Raw &value)
{
if (value.size() > 0)
{
Check(OCI_DequeueSetRelativeMsgID(*this, static_cast<AnyPointer>(const_cast<Raw::value_type *>(&value[0])), static_cast<unsigned int>(value.size())));
}
else
{
Check(OCI_DequeueSetRelativeMsgID(*this, nullptr, 0));
}
}
inline Dequeue::DequeueVisibility Dequeue::GetVisibility() const
{
return DequeueVisibility(static_cast<DequeueVisibility::Type>(Check(OCI_DequeueGetVisibility(*this))));
}
inline void Dequeue::SetVisibility(DequeueVisibility value)
{
Check(OCI_DequeueSetVisibility(*this, value));
}
inline Dequeue::DequeueMode Dequeue::GetMode() const
{
return DequeueMode(static_cast<DequeueMode::Type>(Check(OCI_DequeueGetMode(*this))));
}
inline void Dequeue::SetMode(DequeueMode value)
{
Check(OCI_DequeueSetMode(*this, value));
}
inline Dequeue::NavigationMode Dequeue::GetNavigation() const
{
return NavigationMode(static_cast<NavigationMode::Type>(Check(OCI_DequeueGetNavigation(*this))));
}
inline void Dequeue::SetNavigation(NavigationMode value)
{
Check(OCI_DequeueSetNavigation(*this, value));
}
inline int Dequeue::GetWaitTime() const
{
return Check(OCI_DequeueGetWaitTime(*this));
}
inline void Dequeue::SetWaitTime(int value)
{
Check(OCI_DequeueSetWaitTime(*this, value));
}
inline void Dequeue::SetAgents(std::vector<Agent> &agents)
{
size_t size = agents.size();
ManagedBuffer<OCI_Agent*> buffer(size);
OCI_Agent ** pAgents = static_cast< OCI_Agent **>(buffer);
for (size_t i = 0; i < size; ++i)
{
pAgents[i] = static_cast<const Agent &>(agents[i]);
}
Check(OCI_DequeueSetAgentList(*this, pAgents, static_cast<unsigned int>(size)));
}
inline void Dequeue::Subscribe(unsigned int port, unsigned int timeout, NotifyAQHandlerProc handler)
{
Check(OCI_DequeueSubscribe(*this, port, timeout, static_cast<POCI_NOTIFY_AQ>(handler != nullptr ? Environment::NotifyHandlerAQ : nullptr)));
Environment::SetUserCallback<NotifyAQHandlerProc>(static_cast< OCI_Dequeue*>(*this), handler);
}
inline void Dequeue::Unsubscribe()
{
Check(OCI_DequeueUnsubscribe(*this));
}
/* --------------------------------------------------------------------------------------------- *
* DirectPath
* --------------------------------------------------------------------------------------------- */
inline DirectPath::DirectPath(const TypeInfo &typeInfo, unsigned int nbCols, unsigned int nbRows, const ostring& partition)
{
Acquire(Check(OCI_DirPathCreate(typeInfo, partition.c_str(), nbCols, nbRows)), reinterpret_cast<HandleFreeFunc>(OCI_DirPathFree), nullptr, nullptr);
}
inline void DirectPath::SetColumn(unsigned int colIndex, const ostring& name, unsigned int maxSize, const ostring& format)
{
Check(OCI_DirPathSetColumn(*this, colIndex, name.c_str(), maxSize, format.c_str()));
}
template<class T>
inline void DirectPath::SetEntry(unsigned int rowIndex, unsigned int colIndex, const T &value, bool complete)
{
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));
}
inline void DirectPath::Reset()
{
Check(OCI_DirPathReset(*this));
}
inline void DirectPath::Prepare()
{
Check(OCI_DirPathPrepare(*this));
}
inline DirectPath::Result DirectPath::Convert()
{
return Result(static_cast<Result::Type>(Check(OCI_DirPathConvert(*this))));
}
inline DirectPath::Result DirectPath::Load()
{
return Result(static_cast<Result::Type>(Check(OCI_DirPathLoad(*this))));
}
inline void DirectPath::Finish()
{
Check(OCI_DirPathFinish(*this));
}
inline void DirectPath::Abort()
{
Check(OCI_DirPathAbort(*this));
}
inline void DirectPath::Save()
{
Check(OCI_DirPathSave(*this));
}
inline void DirectPath::FlushRow()
{
Check(OCI_DirPathFlushRow(*this));
}
inline void DirectPath::SetCurrentRows(unsigned int value)
{
Check(OCI_DirPathSetCurrentRows(*this, value));
}
inline unsigned int DirectPath::GetCurrentRows() const
{
return Check(OCI_DirPathGetCurrentRows(*this));
}
inline unsigned int DirectPath::GetMaxRows() const
{
return Check(OCI_DirPathGetMaxRows(*this));
}
inline unsigned int DirectPath::GetRowCount() const
{
return Check(OCI_DirPathGetRowCount(*this));
}
inline unsigned int DirectPath::GetAffectedRows() const
{
return Check(OCI_DirPathGetAffectedRows(*this));
}
inline void DirectPath::SetDateFormat(const ostring& format)
{
Check(OCI_DirPathSetDateFormat(*this, format.c_str()));
}
inline void DirectPath::SetParallel(bool value)
{
Check(OCI_DirPathSetParallel(*this, value));
}
inline void DirectPath::SetNoLog(bool value)
{
Check(OCI_DirPathSetNoLog(*this, value));
}
inline void DirectPath::SetCacheSize(unsigned int value)
{
Check(OCI_DirPathSetCacheSize(*this, value));
}
inline void DirectPath::SetBufferSize(unsigned int value)
{
Check(OCI_DirPathSetBufferSize(*this, value));
}
inline void DirectPath::SetConversionMode(ConversionMode value)
{
Check(OCI_DirPathSetConvertMode(*this, value));
}
inline unsigned int DirectPath::GetErrorColumn()
{
return Check(OCI_DirPathGetErrorColumn(*this));
}
inline unsigned int DirectPath::GetErrorRow()
{
return Check(OCI_DirPathGetErrorRow(*this));
}
/* --------------------------------------------------------------------------------------------- *
* Queue
* --------------------------------------------------------------------------------------------- */
inline void Queue::Create(const Connection &connection, const ostring& queue, const ostring& table, QueueType queueType, unsigned int maxRetries,
unsigned int retryDelay, unsigned int retentionTime, bool dependencyTracking, const ostring& comment)
{
Check(OCI_QueueCreate(connection, queue.c_str(), table.c_str(), queueType, maxRetries, retryDelay, retentionTime, dependencyTracking, comment.c_str()));
}
inline void Queue::Alter(const Connection &connection, const ostring& queue, unsigned int maxRetries, unsigned int retryDelay, unsigned int retentionTime, const ostring& comment)
{
Check(OCI_QueueAlter(connection, queue.c_str(), maxRetries, retryDelay, retentionTime, comment.c_str()));
}
inline void Queue::Drop(const Connection &connection, const ostring& queue)
{
Check(OCI_QueueDrop(connection, queue.c_str()));
}
inline void Queue::Start(const Connection &connection, const ostring& queue, bool enableEnqueue, bool enableDequeue)
{
Check(OCI_QueueStart(connection, queue.c_str(), enableEnqueue, enableDequeue));
}
inline void Queue::Stop(const Connection &connection, const ostring& queue, bool stopEnqueue, bool stopDequeue, bool wait)
{
Check(OCI_QueueStop(connection, queue.c_str(), stopEnqueue, stopDequeue, wait));
}
/* --------------------------------------------------------------------------------------------- *
* QueueTable
* --------------------------------------------------------------------------------------------- */
inline void QueueTable::Create(const Connection &connection, const ostring& table, const ostring& payloadType, bool multipleConsumers, const ostring& storageClause, const ostring& sortList,
GroupingMode groupingMode, const ostring& comment, unsigned int primaryInstance, unsigned int secondaryInstance, const ostring& compatible)
{
Check(OCI_QueueTableCreate(connection, table.c_str(), payloadType.c_str(), storageClause.c_str(), sortList.c_str(), multipleConsumers,
groupingMode, comment.c_str(), primaryInstance, secondaryInstance, compatible.c_str()));
}
inline void QueueTable::Alter(const Connection &connection, const ostring& table, const ostring& comment, unsigned int primaryInstance, unsigned int secondaryInstance)
{
Check(OCI_QueueTableAlter(connection, table.c_str(), comment.c_str(), primaryInstance, secondaryInstance));
}
inline void QueueTable::Drop(const Connection &connection, const ostring& table, bool force)
{
Check(OCI_QueueTableDrop(connection, table.c_str(), force));
}
inline void QueueTable::Purge(const Connection &connection, const ostring& table, PurgeMode mode, const ostring& condition, bool block)
{
Check(OCI_QueueTablePurge(connection, table.c_str(), condition.c_str(), block, static_cast<unsigned int>(mode)));
}
inline void QueueTable::Migrate(const Connection &connection, const ostring& table, const ostring& compatible)
{
Check(OCI_QueueTableMigrate(connection, table.c_str(), compatible.c_str()));
}
}
OCI_EventGetSubscription
OCI_EXPORT OCI_Subscription *OCI_API OCI_EventGetSubscription(OCI_Event *event)
Return the subscription handle that generated this event.
ocilib::Object::Object
Object()
Create an empty null Object instance.
Definition: ocilib_impl.hpp:3354
ocilib::Timestamp::GetType
TimestampType GetType() const
Return the type of the given timestamp object.
Definition: ocilib_impl.hpp:2625
OCI_ObjectSetFile
OCI_EXPORT boolean OCI_API OCI_ObjectSetFile(OCI_Object *obj, const otext *attr, OCI_File *value)
Set an object attribute of type File.
ocilib::Statement::GetAffectedRows
unsigned int GetAffectedRows() const
Return the number of rows affected by the SQL statement.
Definition: ocilib_impl.hpp:5058
OCI_BindUnsignedBigInt
OCI_EXPORT boolean OCI_API OCI_BindUnsignedBigInt(OCI_Statement *stmt, const otext *name, big_uint *data)
Bind an unsigned big integer variable.
OCI_Agent
struct OCI_Agent OCI_Agent
OCILIB encapsulation of A/Q Agent.
Definition: ocilib.h:759
OCI_GetLongMode
OCI_EXPORT unsigned int OCI_API OCI_GetLongMode(OCI_Statement *stmt)
Return the long data type handling mode of a SQL statement.
OCI_EnqueueGetVisibility
OCI_EXPORT unsigned int OCI_API OCI_EnqueueGetVisibility(OCI_Enqueue *enqueue)
Get the enqueuing/locking behavior.
OCI_GetColumn
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.
ocilib::Timestamp::operator>
bool operator>(const Timestamp &other) const
Indicates if the current Timestamp value is superior to the given Timestamp value.
Definition: ocilib_impl.hpp:2966
ocilib::Interval::operator-
Interval operator-(const Interval &other) const
Return a new Interval holding the difference of the current Interval value and the given Interval val...
Definition: ocilib_impl.hpp:2535
ocilib::Statement::GetLongMaxSize
unsigned int GetLongMaxSize() const
Return the LONG data type piece buffer size.
Definition: ocilib_impl.hpp:5803
ocilib::Column
Encapsulate a Resultset column or object member properties.
Definition: ocilib.hpp:6771
ocilib::BindInfo::GetDirection
BindDirection GetDirection() const
Get the direction mode.
Definition: ocilib_impl.hpp:4930
OCI_ErrorGetInternalCode
OCI_EXPORT int OCI_API OCI_ErrorGetInternalCode(OCI_Error *err)
Retrieve Internal Error code from error handle.
OCI_ElemGetBigInt
OCI_EXPORT big_int OCI_API OCI_ElemGetBigInt(OCI_Elem *elem)
Return the big int value of the given collection element.
ocilib::Interval::SetHours
void SetHours(int value)
Set the interval hours value.
Definition: ocilib_impl.hpp:2420
OCI_GetVersionServer
OCI_EXPORT const otext *OCI_API OCI_GetVersionServer(OCI_Connection *con)
Return the connected database server version.
OCI_DateLastDay
OCI_EXPORT boolean OCI_API OCI_DateLastDay(OCI_Date *date)
Place the last day of month (from the given date) into the given date.
ocilib::BindInfo::GetSubType
unsigned int GetSubType() const
Return the OCILIB object subtype of a column.
Definition: ocilib_impl.hpp:4893
OCI_MsgGetID
OCI_EXPORT boolean OCI_API OCI_MsgGetID(OCI_Msg *msg, void *id, unsigned int *len)
Return the ID of the message.
ocilib::Dequeue::Listen
Agent Listen(int timeout)
Listen for messages that match any recipient of the associated Agent list.
Definition: ocilib_impl.hpp:6852
OCI_GetAllocatedBytes
OCI_EXPORT big_uint OCI_API OCI_GetAllocatedBytes(unsigned int mem_type)
Return the current number of bytes allocated internally in the library.
OCI_ConnectionFree
OCI_EXPORT boolean OCI_API OCI_ConnectionFree(OCI_Connection *con)
Close a physical connection to an Oracle database server.
ocilib::Resultset::GetColumnCount
unsigned int GetColumnCount() const
Return the number of columns in the resultset.
Definition: ocilib_impl.hpp:5978
ocilib::Blob
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.
Definition: ocilib.hpp:4324
OCI_QueueStart
OCI_EXPORT boolean OCI_API OCI_QueueStart(OCI_Connection *con, const otext *queue_name, boolean enqueue, boolean dequeue)
Start the given queue.
ocilib::Date::operator<
bool operator<(const Date &other) const
Indicates if the current date value is inferior to the given date value.
Definition: ocilib_impl.hpp:2292
ocilib::NumericUnsignedInt
Definition: ocilib.hpp:316
OCI_DequeueSubscribe
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_ServerGetOutput
OCI_EXPORT const otext *OCI_API OCI_ServerGetOutput(OCI_Connection *con)
Retrieve one line of the server buffer.
ocilib::Event::GetRowID
ostring GetRowID() const
Return the rowid of the altered database object row.
Definition: ocilib_impl.hpp:6552
OCI_ColumnGetCharUsed
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_SubscriptionUnregister
OCI_EXPORT boolean OCI_API OCI_SubscriptionUnregister(OCI_Subscription *sub)
Unregister a previously registered notification.
ocilib::CollectionIterator
STL compliant Collection Random iterator class.
Definition: ocilib.hpp:4931
OCI_LobGetType
OCI_EXPORT unsigned int OCI_API OCI_LobGetType(OCI_Lob *lob)
Return the type of the given Lob object.
ocilib::Pool::Open
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.
Definition: ocilib_impl.hpp:1323
ocilib::Environment::Initialize
static void Initialize(EnvironmentFlags mode=Environment::Default, const ostring &libpath=OTEXT(""))
Initialize the OCILIB environment.
Definition: ocilib_impl.hpp:976
OCI_CollClear
OCI_EXPORT boolean OCI_API OCI_CollClear(OCI_Coll *coll)
clear all items of the given collection
ocilib::Date::IsValid
bool IsValid() const
Check if the given date is valid.
Definition: ocilib_impl.hpp:2024
OCI_BindSetNullAtPos
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_ObjectCreate
OCI_EXPORT OCI_Object *OCI_API OCI_ObjectCreate(OCI_Connection *con, OCI_TypeInfo *typinf)
Create a local object instance.
ocilib::Timestamp::operator-=
Timestamp & operator-=(int value)
Decrement the Timestamp by the given number of days.
Definition: ocilib_impl.hpp:2949
OCI_MsgGetState
OCI_EXPORT unsigned int OCI_API OCI_MsgGetState(OCI_Msg *msg)
Return the state of the message at the time of the dequeue.
OCI_ElemSetNull
OCI_EXPORT boolean OCI_API OCI_ElemSetNull(OCI_Elem *elem)
Set a collection element value to null.
OCI_ObjectSetLob
OCI_EXPORT boolean OCI_API OCI_ObjectSetLob(OCI_Object *obj, const otext *attr, OCI_Lob *value)
Set an object attribute of type Lob.
ocilib::Resultset::GetCurrentRow
unsigned int GetCurrentRow() const
Retrieve the current row index.
Definition: ocilib_impl.hpp:5968
OCI_ExecuteStmt
OCI_EXPORT boolean OCI_API OCI_ExecuteStmt(OCI_Statement *stmt, const otext *sql)
Prepare and Execute a SQL statement or PL/SQL block.
OCI_ObjectSetNull
OCI_EXPORT boolean OCI_API OCI_ObjectSetNull(OCI_Object *obj, const otext *attr)
Set an object attribute to null.
OCI_GetColumn2
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.
ocilib::Timestamp::GetYear
int GetYear() const
Return the timestamp year value.
Definition: ocilib_impl.hpp:2645
OCI_DateAddDays
OCI_EXPORT boolean OCI_API OCI_DateAddDays(OCI_Date *date, int nb)
Add or subtract days to a date handle.
OCI_RegisterUnsignedShort
OCI_EXPORT boolean OCI_API OCI_RegisterUnsignedShort(OCI_Statement *stmt, const otext *name)
Register an unsigned short output bind placeholder.
ocilib::Interval::operator!=
bool operator!=(const Interval &other) const
Indicates if the current Interval value is not equal the given Interval value.
Definition: ocilib_impl.hpp:2558
ocilib::BindInfo::GetStatement
Statement GetStatement() const
Return the statement associated with the bind object.
Definition: ocilib_impl.hpp:4903
OCI_RegisterUnsignedBigInt
OCI_EXPORT boolean OCI_API OCI_RegisterUnsignedBigInt(OCI_Statement *stmt, const otext *name)
Register an unsigned big integer output bind placeholder.
ocilib::Lob::GetConnection
Connection GetConnection() const
Return the lob parent connection.
Definition: ocilib_impl.hpp:3126
ocilib::Dequeue::NotifyAQHandlerProc
void(* NotifyAQHandlerProc)(Dequeue &dequeue)
User callback for dequeue event notifications.
Definition: ocilib.hpp:7839
ocilib::DirectPath::GetErrorRow
unsigned int GetErrorRow()
Return the index of a row which caused an error during data conversion.
Definition: ocilib_impl.hpp:7087
ocilib::DirectPath::SetCacheSize
void SetCacheSize(unsigned int value)
Set number of elements in the date cache.
Definition: ocilib_impl.hpp:7067
OCI_EnqueueSetRelativeMsgID
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_RegisterFile
OCI_EXPORT boolean OCI_API OCI_RegisterFile(OCI_Statement *stmt, const otext *name, unsigned int type)
Register a file output bind placeholder.
ocilib::Connection::SetTAFHandler
void SetTAFHandler(TAFHandlerProc handler)
Set the Transparent Application Failover (TAF) user handler.
Definition: ocilib_impl.hpp:1637
OCI_GetPrefetchSize
OCI_EXPORT unsigned int OCI_API OCI_GetPrefetchSize(OCI_Statement *stmt)
Return the number of rows pre-fetched by OCI Client.
OCI_RegisterDate
OCI_EXPORT boolean OCI_API OCI_RegisterDate(OCI_Statement *stmt, const otext *name)
Register a date output bind placeholder.
ocilib::Lob::operator+=
Lob & operator+=(const Lob &other)
Appending the given lob content to the current lob content.
Definition: ocilib_impl.hpp:3180
ocilib::Timestamp::GetDateTime
void GetDateTime(int &year, int &month, int &day, int &hour, int &min, int &sec, int &fsec) const
Extract date and time parts.
Definition: ocilib_impl.hpp:2774
ocilib::Statement::SetFetchSize
void SetFetchSize(unsigned int value)
Set the number of rows fetched per internal server fetch call.
Definition: ocilib_impl.hpp:5768
ocilib::Collection::Delete
bool Delete(unsigned int index) const
Delete the element at the given position in the Nested Table Collection.
Definition: ocilib_impl.hpp:3857
ocilib::Environment::EnableWarnings
static void EnableWarnings(bool value)
Enable or disable Oracle warning notifications.
Definition: ocilib_impl.hpp:1051
ocilib::Interval::Interval
Interval()
Create an empty null Interval instance.
Definition: ocilib_impl.hpp:2315
ocilib::Connection::GetPassword
ostring GetPassword() const
Return the current logged user password.
Definition: ocilib_impl.hpp:1472
OCI_StatementCreate
OCI_EXPORT OCI_Statement *OCI_API OCI_StatementCreate(OCI_Connection *con)
Create a statement object and return its handle.
OCI_ServerDisableOutput
OCI_EXPORT boolean OCI_API OCI_ServerDisableOutput(OCI_Connection *con)
Disable the server output.
ocilib::Environment::GetCompileRevisionVersion
static unsigned int GetCompileRevisionVersion()
Return the revision version number of OCI used for compiling OCILIB.
Definition: ocilib_impl.hpp:1031
ocilib::Statement::SetFetchMode
void SetFetchMode(FetchMode value)
Set the fetch mode of a SQL statement.
Definition: ocilib_impl.hpp:5748
OCI_BindUnsignedInt
OCI_EXPORT boolean OCI_API OCI_BindUnsignedInt(OCI_Statement *stmt, const otext *name, unsigned int *data)
Bind an unsigned integer variable.
OCI_RefSetNull
OCI_EXPORT boolean OCI_API OCI_RefSetNull(OCI_Ref *ref)
Nullify the given Ref handle.
OCI_Connection
struct OCI_Connection OCI_Connection
Oracle physical connection.
Definition: ocilib.h:423
OCI_ObjectGetInt
OCI_EXPORT int OCI_API OCI_ObjectGetInt(OCI_Object *obj, const otext *attr)
Return the integer value of the given object attribute.
ocilib::Number::FromString
void FromString(const ostring &str, const ostring &format=OTEXT("")) const
Assign to the number object the value provided by the input number time string.
Definition: ocilib_impl.hpp:1739
ocilib::Interval::GetSeconds
int GetSeconds() const
Return the interval seconds value.
Definition: ocilib_impl.hpp:2445
OCI_ThreadRun
OCI_EXPORT boolean OCI_API OCI_ThreadRun(OCI_Thread *thread, POCI_THREAD proc, void *arg)
Execute the given routine within the given thread object.
ocilib::Exception
Exception class handling all OCILIB errors.
Definition: ocilib.hpp:485
OCI_GetLongMaxSize
OCI_EXPORT unsigned int OCI_API OCI_GetLongMaxSize(OCI_Statement *stmt)
Return the LONG data type piece buffer size.
ocilib::File::File
File()
Create an empty null File instance.
Definition: ocilib_impl.hpp:3202
ocilib::File::GetLength
big_uint GetLength() const
Returns the number of bytes contained in the file.
Definition: ocilib_impl.hpp:3256
ocilib::Date::SetMinutes
void SetMinutes(int value)
Set the date minutes value.
Definition: ocilib_impl.hpp:2106
OCI_BindSetNotNullAtPos
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_IntervalGetType
OCI_EXPORT unsigned int OCI_API OCI_IntervalGetType(OCI_Interval *itv)
Return the type of the given Interval object.
ocilib::Connection::GetServerRevisionVersion
unsigned int GetServerRevisionVersion() const
Return the revision version number of the connected database server.
Definition: ocilib_impl.hpp:1497
ocilib::Column::IsCharSemanticUsed
bool IsCharSemanticUsed() const
Return true if the length of the column is character-length or false if it is byte-length.
Definition: ocilib_impl.hpp:6454
ocilib::BindInfo
Provides SQL bind informations.
Definition: ocilib.hpp:5321
ocilib::Resultset::IsColumnNull
bool IsColumnNull(unsigned int index) const
Check if the current row value is null for the column at the given index.
Definition: ocilib_impl.hpp:5993
ocilib::Connection::GetServer
ostring GetServer() const
Return the Oracle server Hos name of the connected database/service name.
Definition: ocilib_impl.hpp:1592
OCI_DequeueFree
OCI_EXPORT boolean OCI_API OCI_DequeueFree(OCI_Dequeue *dequeue)
Free a Dequeue object.
OCI_ErrorGetConnection
OCI_EXPORT OCI_Connection *OCI_API OCI_ErrorGetConnection(OCI_Error *err)
Retrieve connection handle within the error occurred.
OCI_NumberGetValue
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.
ocilib::Date::operator+
Date operator+(int value) const
Return a new date holding the current date value incremented by the given number of days...
Definition: ocilib_impl.hpp:2253
ocilib::Connection::SetTrace
void SetTrace(SessionTrace trace, const ostring &value)
Set tracing information for the session.
Definition: ocilib_impl.hpp:1567
ocilib::Subscription::GetPort
unsigned int GetPort() const
Return the port used by the notification.
Definition: ocilib_impl.hpp:6513
OCI_FileAssign
OCI_EXPORT boolean OCI_API OCI_FileAssign(OCI_File *file, OCI_File *file_src)
Assign a file to another one.
ocilib::Collection::GetCount
unsigned int GetCount() const
Returns the current number of elements in the collection.
Definition: ocilib_impl.hpp:3826
ocilib::Statement::GetResultset
Resultset GetResultset()
Retrieve the resultset from an executed statement.
Definition: ocilib_impl.hpp:5068
OCI_DateFromText
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_GetUserName
OCI_EXPORT const otext *OCI_API OCI_GetUserName(OCI_Connection *con)
Return the current logged user name.
OCI_ColumnGetSQLType
OCI_EXPORT const otext *OCI_API OCI_ColumnGetSQLType(OCI_Column *col)
Return the Oracle SQL type name of the column data type.
OCI_PoolSetStatementCacheSize
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.
ocilib::BindInfo::SetCharsetForm
void SetCharsetForm(CharsetForm value)
Set the charset form of the given character based bind object.
Definition: ocilib_impl.hpp:4925
ocilib::Subscription::GetName
ostring GetName() const
Return the name of the given registered subscription.
Definition: ocilib_impl.hpp:6503
ocilib::Resultset::Next
bool Next()
Fetch the next row of the resultset.
Definition: ocilib_impl.hpp:5938
OCI_DequeueSetWaitTime
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 ...
ocilib::Statement::Describe
void Describe(const ostring &sql)
Describe the select list of a SQL select statement.
Definition: ocilib_impl.hpp:4958
ocilib::DirectPath::SetNoLog
void SetNoLog(bool value)
Set the logging mode for the loading operation.
Definition: ocilib_impl.hpp:7062
OCI_FetchPrev
OCI_EXPORT boolean OCI_API OCI_FetchPrev(OCI_Resultset *rs)
Fetch the previous row of the resultset.
ocilib::Timestamp::GetSeconds
int GetSeconds() const
Return the timestamp seconds value.
Definition: ocilib_impl.hpp:2730
OCI_DequeueSetNavigation
OCI_EXPORT boolean OCI_API OCI_DequeueSetNavigation(OCI_Dequeue *dequeue, unsigned int position)
Set the position of messages to be retrieved.
OCI_IsNull
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_ElemGetUnsignedInt
OCI_EXPORT unsigned int OCI_API OCI_ElemGetUnsignedInt(OCI_Elem *elem)
Return the unsigned int value of the given collection element.
OCI_SetUserPassword
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_ObjectSetRaw
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.
ocilib::Connection::GetUserName
ostring GetUserName() const
Return the current logged user name.
Definition: ocilib_impl.hpp:1467
OCI_ObjectGetString
OCI_EXPORT const otext *OCI_API OCI_ObjectGetString(OCI_Object *obj, const otext *attr)
Return the string value of the given object attribute.
OCI_LobGetOffset
OCI_EXPORT big_uint OCI_API OCI_LobGetOffset(OCI_Lob *lob)
Return the current position in the Lob content buffer.
ocilib
OCILIB ++ Namespace.
OCI_IntervalSubtract
OCI_EXPORT boolean OCI_API OCI_IntervalSubtract(OCI_Interval *itv, OCI_Interval *itv2)
Subtract an interval handle value from another.
OCI_ColumnGetFullSQLType
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.
ocilib::Connection::SetDefaultLobPrefetchSize
void SetDefaultLobPrefetchSize(unsigned int value)
Enable or disable prefetching for all LOBs fetched in the connection.
Definition: ocilib_impl.hpp:1622
ocilib::Connection::ChangePassword
void ChangePassword(const ostring &newPwd)
Change the password of the logged user.
Definition: ocilib_impl.hpp:1502
ocilib::FormatTimestamp
Definition: ocilib.hpp:459
OCI_ObjectGetDouble
OCI_EXPORT double OCI_API OCI_ObjectGetDouble(OCI_Object *obj, const otext *attr)
Return the double value of the given object attribute.
OCI_BindString
OCI_EXPORT boolean OCI_API OCI_BindString(OCI_Statement *stmt, const otext *name, otext *data, unsigned int len)
Bind a string variable.
ocilib::Collection::Set
void Set(unsigned int index, const T &value)
Set the collection element value at the given position.
Definition: ocilib_impl.hpp:3893
OCI_ObjectGetType
OCI_EXPORT unsigned int OCI_API OCI_ObjectGetType(OCI_Object *obj)
Return the type of an object instance.
ocilib::BindInfo::GetName
ostring GetName() const
Return the name of the bind object.
Definition: ocilib_impl.hpp:4883
ocilib::QueueTable::Purge
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.
Definition: ocilib_impl.hpp:7144
ocilib::Collection::GetTypeInfo
TypeInfo GetTypeInfo() const
Return the type information object associated to the collection.
Definition: ocilib_impl.hpp:3801
ocilib::Queue::Alter
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.
Definition: ocilib_impl.hpp:7102
ocilib::Timestamp::GetMonth
int GetMonth() const
Return the timestamp month value.
Definition: ocilib_impl.hpp:2662
ocilib::Collection::begin
iterator begin()
Returns an iterator pointing to the first element in the collection.
Definition: ocilib_impl.hpp:3863
OCI_EnqueueCreate
OCI_EXPORT OCI_Enqueue *OCI_API OCI_EnqueueCreate(OCI_TypeInfo *typinf, const otext *name)
Create a Enqueue object for the given queue.
ocilib::CharsetForm
Enum< CharsetFormValues > CharsetForm
Type of charsetForm.
Definition: ocilib.hpp:355
OCI_ElemCreate
OCI_EXPORT OCI_Elem *OCI_API OCI_ElemCreate(OCI_TypeInfo *typinf)
Create a local collection element instance based on a collection type descriptor. ...
OCI_ElemSetRaw
OCI_EXPORT boolean OCI_API OCI_ElemSetRaw(OCI_Elem *elem, void *value, unsigned int len)
Set a RAW value to a collection element.
OCI_ColumnGetName
OCI_EXPORT const otext *OCI_API OCI_ColumnGetName(OCI_Column *col)
Return the name of the given column.
ocilib::Date::FromString
void FromString(const ostring &str, const ostring &format=OTEXT(""))
Assign to the date object the value provided by the input date time string.
Definition: ocilib_impl.hpp:2199
OCI_BindArrayOfUnsignedShorts
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.
ocilib::Object::Clone
Object Clone() const
Clone the current instance to a new one performing deep copy.
Definition: ocilib_impl.hpp:3369
OCI_ObjectGetRaw
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_BindArraySetSize
OCI_EXPORT boolean OCI_API OCI_BindArraySetSize(OCI_Statement *stmt, unsigned int size)
Set the input array size for bulk operations.
OCI_ElemGetFile
OCI_EXPORT OCI_File *OCI_API OCI_ElemGetFile(OCI_Elem *elem)
Return the File value of the given collection element.
ocilib::Enqueue::Put
void Put(const Message &message)
Enqueue a message the on queue associated to the Enqueue object.
Definition: ocilib_impl.hpp:6785
OCI_PoolGetConnection
OCI_EXPORT OCI_Connection *OCI_API OCI_PoolGetConnection(OCI_Pool *pool, const otext *tag)
Get a connection from the pool.
ocilib::Connection::SetAutoCommit
void SetAutoCommit(bool enabled)
Enable or disable auto commit mode (implicit commits after every SQL execution)
Definition: ocilib_impl.hpp:1442
ocilib::Collection::operator[]
CollectionElement< T > operator[](unsigned int index)
Returns the element at a given position in the collection.
Definition: ocilib_impl.hpp:4231
OCI_IntervalFromTimeZone
OCI_EXPORT boolean OCI_API OCI_IntervalFromTimeZone(OCI_Interval *itv, const otext *str)
Correct an interval handle value with the given time zone.
OCI_GetImportMode
OCI_EXPORT unsigned int OCI_API OCI_GetImportMode(void)
Return the Oracle shared library import mode.
OCI_BindGetDirection
OCI_EXPORT unsigned int OCI_API OCI_BindGetDirection(OCI_Bind *bnd)
Get the direction mode of a bind handle.
ocilib::Blong
Long< Raw, LongBinary > Blong
Class handling LONG RAW oracle type.
Definition: ocilib_impl.hpp:60
OCI_FileGetConnection
OCI_EXPORT OCI_Connection *OCI_API OCI_FileGetConnection(OCI_File *file)
Retrieve connection handle from the file handle.
OCI_SetBindMode
OCI_EXPORT boolean OCI_API OCI_SetBindMode(OCI_Statement *stmt, unsigned int mode)
Set the binding mode of a SQL statement.
OCI_ObjectToText
OCI_EXPORT boolean OCI_API OCI_ObjectToText(OCI_Object *obj, unsigned int *size, otext *str)
Convert an object handle value to a string.
OCI_DequeueSetVisibility
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_GetStatement
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_FileExists
OCI_EXPORT boolean OCI_API OCI_FileExists(OCI_File *file)
Check if the given file exists on server.
OCI_FetchLast
OCI_EXPORT boolean OCI_API OCI_FetchLast(OCI_Resultset *rs)
Fetch the last row of the resultset.
ocilib::Exception::GetRow
unsigned int GetRow() const
Return the row index which caused an error during statement execution.
Definition: ocilib_impl.hpp:967
OCI_BindStatement
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_ObjectSetShort
OCI_EXPORT boolean OCI_API OCI_ObjectSetShort(OCI_Object *obj, const otext *attr, short value)
Set an object attribute of type short.
ocilib::Lob::IsTemporary
bool IsTemporary() const
Check if the given lob is a temporary lob.
Definition: ocilib_impl.hpp:3150
OCI_DateAddMonths
OCI_EXPORT boolean OCI_API OCI_DateAddMonths(OCI_Date *date, int nb)
Add or subtract months to a date handle.
ocilib::Interval::ToString
ostring ToString() const override
Convert the interval value to a string using the default precisions of 10.
Definition: ocilib_impl.hpp:2524
ocilib::Transaction::Forget
void Forget()
Cancel the prepared global transaction validation.
Definition: ocilib_impl.hpp:1688
ocilib::Resultset::Get
T Get(unsigned int index) const
Return the current value of the column at the given index in the resultset.
Definition: ocilib_impl.hpp:6363
ocilib::Date::ChangeTimeZone
void ChangeTimeZone(const ostring &tzSrc, const ostring &tzDst)
Convert the date from one zone to another zone.
Definition: ocilib_impl.hpp:2194
ocilib::Agent::GetAddress
ostring GetAddress() const
Get the given AQ agent address.
Definition: ocilib_impl.hpp:6586
OCI_MutexAcquire
OCI_EXPORT boolean OCI_API OCI_MutexAcquire(OCI_Mutex *mutex)
Acquire a mutex lock.
OCI_ElemSetString
OCI_EXPORT boolean OCI_API OCI_ElemSetString(OCI_Elem *elem, const otext *value)
Set a string value to a collection element.
ocilib::Resultset::operator++
bool operator++(int)
Convenient operator overloading that performs a call to Next()
Definition: ocilib_impl.hpp:6008
ocilib::Interval::GetMonth
int GetMonth() const
Return the interval month value.
Definition: ocilib_impl.hpp:2377
ocilib::Interval::SetDaySecond
void SetDaySecond(int day, int hour, int min, int sec, int fsec)
Set the Day / Second parts.
Definition: ocilib_impl.hpp:2484
ocilib::Event
Subscription Event.
Definition: ocilib.hpp:7093
OCI_Ping
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...
ocilib::Lob::GetChunkSize
big_uint GetChunkSize() const
Returns the current lob chunk size.
Definition: ocilib_impl.hpp:3120
ocilib::Statement::GetStatementType
StatementType GetStatementType() const
Return the type of a SQL statement.
Definition: ocilib_impl.hpp:5738
OCI_GetAffectedRows
OCI_EXPORT unsigned int OCI_API OCI_GetAffectedRows(OCI_Statement *stmt)
Return the number of rows affected by the SQL statement.
ocilib::Date::LastDay
Date LastDay() const
Return the last day of month from the current date object.
Definition: ocilib_impl.hpp:2185
OCI_LobRead
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
ocilib::File::Open
void Open()
Open a file for reading on the server.
Definition: ocilib_impl.hpp:3286
ocilib::Timestamp::SetHours
void SetHours(int value)
Set the timestamp hours value.
Definition: ocilib_impl.hpp:2705
ocilib::QueueTable::Alter
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.
Definition: ocilib_impl.hpp:7134
ocilib::Reference::Clone
Reference Clone() const
Clone the current instance to a new one performing deep copy.
Definition: ocilib_impl.hpp:3734
ocilib::Interval::GetDay
int GetDay() const
Return the interval day value.
Definition: ocilib_impl.hpp:2394
ocilib::Subscription::Subscription
Subscription()
Default constructor.
Definition: ocilib_impl.hpp:6468
OCI_GetUnsignedShort2
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_ElemSetInterval
OCI_EXPORT boolean OCI_API OCI_ElemSetInterval(OCI_Elem *elem, OCI_Interval *value)
Assign an Interval handle to a collection element.
ocilib::DirectPath::GetRowCount
unsigned int GetRowCount() const
Return the number of rows successfully loaded into the database so far.
Definition: ocilib_impl.hpp:7042
ocilib::Event::GetSubscription
Subscription GetSubscription() const
Return the subscription that generated this event.
Definition: ocilib_impl.hpp:6557
OCI_PoolGetStatementCacheSize
OCI_EXPORT unsigned int OCI_API OCI_PoolGetStatementCacheSize(OCI_Pool *pool)
Return the maximum number of statements to keep in the pool statement cache.
ocilib::Column::GetSubType
unsigned int GetSubType() const
Return the OCILIB object subtype of a column.
Definition: ocilib_impl.hpp:6409
OCI_BindDouble
OCI_EXPORT boolean OCI_API OCI_BindDouble(OCI_Statement *stmt, const otext *name, double *data)
Bind a double variable.
ocilib::FormatDate
Definition: ocilib.hpp:457
OCI_ObjectGetRef
OCI_EXPORT OCI_Ref *OCI_API OCI_ObjectGetRef(OCI_Object *obj, const otext *attr)
Return the Ref value of the given object attribute.
OCI_ObjectSetDouble
OCI_EXPORT boolean OCI_API OCI_ObjectSetDouble(OCI_Object *obj, const otext *attr, double value)
Set an object attribute of type double.
ocilib::Date::NextDay
Date NextDay(const ostring &day) const
Return the date of next day of the week, after the current date object.
Definition: ocilib_impl.hpp:2176
OCI_GetLob2
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.
ocilib::Date::Date
Date(bool create=false)
Create an empty null Date object.
Definition: ocilib_impl.hpp:1965
ocilib::LobType
Enum< LobTypeValues > LobType
Type of Lob.
Definition: ocilib.hpp:425
OCI_ColumnGetScale
OCI_EXPORT int OCI_API OCI_ColumnGetScale(OCI_Column *col)
Return the scale of the column for numeric columns.
ocilib::Mutex::Release
static void Release(MutexHandle handle)
Release a mutex lock.
Definition: ocilib_impl.hpp:1255
OCI_SetDefaultLobPrefetchSize
OCI_EXPORT boolean OCI_API OCI_SetDefaultLobPrefetchSize(OCI_Connection *con, unsigned int value)
Enable or disable prefetching for all LOBs fetched in the connection.
ocilib::Date::GetMinutes
int GetMinutes() const
Return the date minutes value.
Definition: ocilib_impl.hpp:2097
OCI_CollDeleteElem
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_TimestampFromText
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_DateCompare
OCI_EXPORT int OCI_API OCI_DateCompare(OCI_Date *date, OCI_Date *date2)
Compares two date handles.
ocilib::DataType
Enum< DataTypeValues > DataType
Column data type.
Definition: ocilib.hpp:298
ocilib::MutexHandle
OCI_Mutex * MutexHandle
Alias for an OCI_Mutex pointer.
Definition: ocilib.hpp:187
ocilib::Queue::Drop
static void Drop(const Connection &connection, const ostring &queue)
Drop the given queue.
Definition: ocilib_impl.hpp:7107
OCI_XID
struct OCI_XID OCI_XID
Global transaction identifier.
ocilib::Lob::Copy
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.
Definition: ocilib_impl.hpp:3144
ocilib::Exception::GetMessage
ostring GetMessage() const
Retrieve the error message.
Definition: ocilib_impl.hpp:925
OCI_MsgSetOriginalID
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. ...
ocilib::Timestamp::Clone
Timestamp Clone() const
Clone the current instance to a new one performing deep copy.
Definition: ocilib_impl.hpp:2611
OCI_GetInterval
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_ObjectSetRef
OCI_EXPORT boolean OCI_API OCI_ObjectSetRef(OCI_Object *obj, const otext *attr, OCI_Ref *value)
Set an object attribute of type Ref.
ocilib::Environment::GetFormat
static ostring GetFormat(FormatType formatType)
Return the format string for implicit string conversions of the given type.
Definition: ocilib_impl.hpp:1061
OCI_GetBind
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.
ocilib::Interval::GetHours
int GetHours() const
Return the interval hours value.
Definition: ocilib_impl.hpp:2411
OCI_ObjectGetLob
OCI_EXPORT OCI_Lob *OCI_API OCI_ObjectGetLob(OCI_Object *obj, const otext *attr)
Return the lob value of the given object attribute.
ocilib::Date::operator<=
bool operator<=(const Date &other) const
Indicates if the current date value is inferior or equal to the given date value. ...
Definition: ocilib_impl.hpp:2304
OCI_NumberAdd
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.
ocilib::Statement::GetBindIndex
unsigned int GetBindIndex(const ostring &name) const
Return the index of the bind from its name belonging to the statement.
Definition: ocilib_impl.hpp:5098
OCI_MsgGetOriginalID
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_ObjectSetNumber
OCI_EXPORT boolean OCI_API OCI_ObjectSetNumber(OCI_Object *obj, const otext *attr, OCI_Number *value)
Set an object attribute of type number.
ocilib::Environment::ShutdownDatabase
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.
Definition: ocilib_impl.hpp:1073
ocilib::Connection
A connection or session with a specific database.
Definition: ocilib.hpp:1665
ocilib::Column::GetFullSQLType
ostring GetFullSQLType() const
Return the Oracle SQL Full name including precision and size of the column data type.
Definition: ocilib_impl.hpp:6393
OCI_DirPathSetBufferSize
OCI_EXPORT boolean OCI_API OCI_DirPathSetBufferSize(OCI_DirPath *dp, unsigned int size)
Set the size of the internal stream transfer buffer.
ocilib::Lob::Lob
Lob()
Create an empty null Lob instance.
Definition: ocilib_impl.hpp:2995
OCI_Commit
OCI_EXPORT boolean OCI_API OCI_Commit(OCI_Connection *con)
Commit current pending changes.
OCI_NumberDivide
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_GetRef
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.
ocilib::Timestamp::Convert
void Convert(const Timestamp &other)
Convert the current timestamp to the type of the given timestamp.
Definition: ocilib_impl.hpp:2635
OCI_StatementFree
OCI_EXPORT boolean OCI_API OCI_StatementFree(OCI_Statement *stmt)
Free a statement and all resources associated to it (resultsets ...)
ocilib::Dequeue::GetVisibility
DequeueVisibility GetVisibility() const
Get the dequeuing/locking behavior.
Definition: ocilib_impl.hpp:6900
OCI_GetString
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.
ocilib::Pool::GetOpenedConnectionsCount
unsigned int GetOpenedConnectionsCount() const
Return the current number of opened connections/sessions.
Definition: ocilib_impl.hpp:1367
ocilib::Connection::Close
void Close()
Close the physical connection to the DB server.
Definition: ocilib_impl.hpp:1422
OCI_ElemSetBigInt
OCI_EXPORT boolean OCI_API OCI_ElemSetBigInt(OCI_Elem *elem, big_int value)
Set a big int value to a collection element.
OCI_ErrorGetType
OCI_EXPORT unsigned int OCI_API OCI_ErrorGetType(OCI_Error *err)
Retrieve the type of error from error handle.
OCI_DateCheck
OCI_EXPORT int OCI_API OCI_DateCheck(OCI_Date *date)
Check if the given date is valid.
ocilib::Object::GetTypeInfo
TypeInfo GetTypeInfo() const
Return the TypeInfo object describing the object.
Definition: ocilib_impl.hpp:3388
ocilib::Timestamp::operator+=
Timestamp & operator+=(int value)
Increment the Timestamp by the given number of days.
Definition: ocilib_impl.hpp:2942
ocilib::Date::DaysBetween
int DaysBetween(const Date &other) const
Return the number of days with the given date.
Definition: ocilib_impl.hpp:2131
ocilib::Interval::SetYear
void SetYear(int value)
Set the interval year value.
Definition: ocilib_impl.hpp:2369
OCI_BindBigInt
OCI_EXPORT boolean OCI_API OCI_BindBigInt(OCI_Statement *stmt, const otext *name, big_int *data)
Bind a big integer variable.
OCI_DirPathLoad
OCI_EXPORT unsigned int OCI_API OCI_DirPathLoad(OCI_DirPath *dp)
Loads the data converted to direct path stream format.
OCI_GetDate
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.
ocilib::Message::SetExceptionQueue
void SetExceptionQueue(const ostring &value)
Set the name of the queue to which the message is moved to if it cannot be processed successfully...
Definition: ocilib_impl.hpp:6746
OCI_Break
OCI_EXPORT boolean OCI_API OCI_Break(OCI_Connection *con)
Perform an immediate abort of any currently Oracle OCI call.
ocilib::File::GetOffset
big_uint GetOffset() const
Returns the current R/W offset within the file.
Definition: ocilib_impl.hpp:3251
ocilib::FormatNumeric
Definition: ocilib.hpp:461
ocilib::Dequeue::GetNavigation
NavigationMode GetNavigation() const
Return the navigation position of messages to retrieve from the queue.
Definition: ocilib_impl.hpp:6920
ocilib::Lob::Read
T Read(unsigned int length)
Read a portion of a lob.
OCI_SetTAFHandler
OCI_EXPORT boolean OCI_API OCI_SetTAFHandler(OCI_Connection *con, POCI_TAF_HANDLER handler)
Set the Transparent Application Failover (TAF) user handler.
OCI_DirPathFree
OCI_EXPORT boolean OCI_API OCI_DirPathFree(OCI_DirPath *dp)
Free an OCI_DirPath handle.
ocilib::Thread::Join
static void Join(ThreadHandle handle)
Join the given thread.
Definition: ocilib_impl.hpp:1279
OCI_BindArrayOfIntervals
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_FileRead
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.
ocilib::Statement::SetBindMode
void SetBindMode(BindMode value)
Set the binding mode of a SQL statement.
Definition: ocilib_impl.hpp:5758
OCI_Interval
struct OCI_Interval OCI_Interval
Oracle internal interval representation.
Definition: ocilib.h:598
ocilib::Long
Object identifying the SQL data type LONG.
Definition: ocilib.hpp:5259
OCI_DateFree
OCI_EXPORT boolean OCI_API OCI_DateFree(OCI_Date *date)
Free a date object.
OCI_MsgGetExceptionQueue
OCI_EXPORT const otext *OCI_API OCI_MsgGetExceptionQueue(OCI_Msg *msg)
Get the Exception queue name of the message.
ocilib::Timestamp::operator!=
bool operator!=(const Timestamp &other) const
Indicates if the current Timestamp value is not equal the given Timestamp value.
Definition: ocilib_impl.hpp:2961
ocilib::Environment::GetCompileMinorVersion
static unsigned int GetCompileMinorVersion()
Return the minor version number of OCI used for compiling OCILIB.
Definition: ocilib_impl.hpp:1026
ocilib::Interval::operator>
bool operator>(const Interval &other) const
Indicates if the current Interval value is superior to the given Interval value.
Definition: ocilib_impl.hpp:2563
OCI_Dequeue
struct OCI_Dequeue OCI_Dequeue
OCILIB encapsulation of A/Q dequeuing operations.
Definition: ocilib.h:769
ocilib::Exception::GetOracleErrorCode
int GetOracleErrorCode() const
Return the Oracle error code.
Definition: ocilib_impl.hpp:947
ocilib::Subscription::Register
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.
Definition: ocilib_impl.hpp:6478
ocilib::Transaction
Oracle Transaction object.
Definition: ocilib.hpp:2383
OCI_GetObject2
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_GetAutoCommit
OCI_EXPORT boolean OCI_API OCI_GetAutoCommit(OCI_Connection *con)
Get current auto commit mode status.
OCI_ElemGetUnsignedShort
OCI_EXPORT unsigned short OCI_API OCI_ElemGetUnsignedShort(OCI_Elem *elem)
Return the unsigned short value of the given collection element.
OCI_Statement
struct OCI_Statement OCI_Statement
Oracle SQL or PL/SQL statement.
Definition: ocilib.h:435
ocilib::Column::IsNullable
bool IsNullable() const
Return true if the column is nullable otherwise false.
Definition: ocilib_impl.hpp:6449
ocilib::Agent::Agent
Agent(const Connection &connection, const ostring &name=OTEXT(""), const ostring &address=OTEXT(""))
Create an AQ agent object.
Definition: ocilib_impl.hpp:6566
OCI_GetRef2
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_FileGetSize
OCI_EXPORT big_uint OCI_API OCI_FileGetSize(OCI_File *file)
Return the size in bytes of a file.
OCI_GetFile2
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.
ocilib::Interval::SetMinutes
void SetMinutes(int value)
Set the interval minutes value.
Definition: ocilib_impl.hpp:2437
ocilib::Timestamp::GetMinutes
int GetMinutes() const
Return the timestamp minutes value.
Definition: ocilib_impl.hpp:2713
ocilib::Environment::GetCompileMajorVersion
static unsigned int GetCompileMajorVersion()
Return the major version number of OCI used for compiling OCILIB.
Definition: ocilib_impl.hpp:1021
ocilib::MakeRaw
Raw MakeRaw(void *result, unsigned int size)
Internal usage. Constructs a C++ Raw object from the given OCILIB raw buffer.
Definition: ocilib_impl.hpp:141
OCI_BindInterval
OCI_EXPORT boolean OCI_API OCI_BindInterval(OCI_Statement *stmt, const otext *name, OCI_Interval *data)
Bind an interval variable.
OCI_FileSetName
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_ErrorGetOCICode
OCI_EXPORT int OCI_API OCI_ErrorGetOCICode(OCI_Error *err)
Retrieve Oracle Error code from error handle.
OCI_MsgGetCorrelation
OCI_EXPORT const otext *OCI_API OCI_MsgGetCorrelation(OCI_Msg *msg)
Get the correlation identifier of the message.
OCI_DateAssign
OCI_EXPORT int OCI_API OCI_DateAssign(OCI_Date *date, OCI_Date *date_src)
Assign the value of a date handle to another one.
ocilib::Statement::ExecutePrepared
void ExecutePrepared()
Execute a prepared SQL statement or PL/SQL block.
Definition: ocilib_impl.hpp:4979
OCI_Bind
struct OCI_Bind OCI_Bind
Internal bind representation.
Definition: ocilib.h:447
ocilib::Event::GetObjectName
ostring GetObjectName() const
Return the name of the object that generated the event.
Definition: ocilib_impl.hpp:6547
OCI_BindInt
OCI_EXPORT boolean OCI_API OCI_BindInt(OCI_Statement *stmt, const otext *name, int *data)
Bind an integer variable.
OCI_ThreadKeyCreate
OCI_EXPORT boolean OCI_API OCI_ThreadKeyCreate(const otext *name, POCI_THREADKEYDEST destfunc)
Create a thread key object.
OCI_BindArrayOfTimestamps
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_ObjectSetObject
OCI_EXPORT boolean OCI_API OCI_ObjectSetObject(OCI_Object *obj, const otext *attr, OCI_Object *value)
Set an object attribute of type Object.
ocilib::Date::GetHours
int GetHours() const
Return the date hours value.
Definition: ocilib_impl.hpp:2080
OCI_NumberToText
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_TimestampGetDateTime
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.
OCI_Subscription
struct OCI_Subscription OCI_Subscription
OCILIB encapsulation of Oracle DCN notification.
Definition: ocilib.h:729
ocilib::Environment::GetMode
static Environment::EnvironmentFlags GetMode()
Return the Environment mode flags.
Definition: ocilib_impl.hpp:986
ocilib::Lob::Close
void Close()
Close explicitly a Lob.
Definition: ocilib_impl.hpp:3168
ocilib::Date::GetDay
int GetDay() const
Return the date day value.
Definition: ocilib_impl.hpp:2063
ocilib::Timestamp::TimestampTypeValues
TimestampTypeValues
Interval types enumerated values.
Definition: ocilib.hpp:3530
ocilib::Statement::Parse
void Parse(const ostring &sql)
Parse a SQL statement or PL/SQL block.
Definition: ocilib_impl.hpp:4965
OCI_BindFile
OCI_EXPORT boolean OCI_API OCI_BindFile(OCI_Statement *stmt, const otext *name, OCI_File *data)
Bind a File variable.
ocilib::Collection::ToString
ostring ToString() const override
return a string representation of the current collection
Definition: ocilib_impl.hpp:4212
ocilib::Environment::StartFlagsValues
StartFlagsValues
Oracle instance start flags enumerated values.
Definition: ocilib.hpp:801
ocilib::Resultset::Last
bool Last()
Fetch the last row of the resultset.
Definition: ocilib_impl.hpp:5953
ocilib::Timestamp::operator<
bool operator<(const Timestamp &other) const
Indicates if the current Timestamp value is inferior to the given Timestamp value.
Definition: ocilib_impl.hpp:2971
ocilib::Agent
AQ identified agent for messages delivery.
Definition: ocilib.hpp:7220
OCI_BindArrayOfShorts
OCI_EXPORT boolean OCI_API OCI_BindArrayOfShorts(OCI_Statement *stmt, const otext *name, short *data, unsigned int nbelem)
Bind an array of shorts.
ocilib::OracleVersion
Enum< OracleVersionValues > OracleVersion
Oracle Version.
Definition: ocilib.hpp:252
ocilib::Column::GetTypeInfo
TypeInfo GetTypeInfo() const
Return the type information object associated to the column.
Definition: ocilib_impl.hpp:6459
OCI_BindArrayOfDoubles
OCI_EXPORT boolean OCI_API OCI_BindArrayOfDoubles(OCI_Statement *stmt, const otext *name, double *data, unsigned int nbelem)
Bind an array of doubles.
ocilib::Exception::~Exception
virtual ~Exception()
Virtual destructor required for deriving from std::exception.
Definition: ocilib_impl.hpp:898
ocilib::DirectPath::SetEntry
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.
Definition: ocilib_impl.hpp:6982
ocilib::Date::SetSeconds
void SetSeconds(int value)
Set the date seconds value.
Definition: ocilib_impl.hpp:2123
ocilib::TypeInfo::GetColumn
Column GetColumn(unsigned int index) const
Return the column from its index in the resultset.
Definition: ocilib_impl.hpp:3345
OCI_ResultsetGetStatement
OCI_EXPORT OCI_Statement *OCI_API OCI_ResultsetGetStatement(OCI_Resultset *rs)
Return the statement handle associated with a resultset handle.
OCI_ObjectGetShort
OCI_EXPORT short OCI_API OCI_ObjectGetShort(OCI_Object *obj, const otext *attr)
Return the short value of the given object attribute.
OCI_ObjectSetColl
OCI_EXPORT boolean OCI_API OCI_ObjectSetColl(OCI_Object *obj, const otext *attr, OCI_Coll *value)
Set an object attribute of type Collection.
OCI_TimestampCompare
OCI_EXPORT int OCI_API OCI_TimestampCompare(OCI_Timestamp *tmsp, OCI_Timestamp *tmsp2)
Compares two timestamp handles.
OCI_GetDouble2
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.
ocilib::Event::GetObjectEvent
ObjectEvent GetObjectEvent() const
Return the type of operation reported by a notification.
Definition: ocilib_impl.hpp:6537
ocilib::BindResolverScalarType
Simplified resolver for scalar types that do not need translation.
Definition: ocilib_impl.hpp:80
OCI_ElemSetBoolean
OCI_EXPORT boolean OCI_API OCI_ElemSetBoolean(OCI_Elem *elem, boolean value)
Set a boolean value to a collection element.
OCI_BindObject
OCI_EXPORT boolean OCI_API OCI_BindObject(OCI_Statement *stmt, const otext *name, OCI_Object *data)
Bind an object (named type) variable.
ocilib::Connection::GetTransaction
Transaction GetTransaction() const
Return the current transaction of the connection.
Definition: ocilib_impl.hpp:1517
OCI_SubscriptionGetName
OCI_EXPORT const otext *OCI_API OCI_SubscriptionGetName(OCI_Subscription *sub)
Return the name of the given registered subscription.
ocilib::Environment::GetImportMode
static Environment::ImportMode GetImportMode()
Return the Oracle shared library import mode.
Definition: ocilib_impl.hpp:991
OCI_PoolGetOpenedCount
OCI_EXPORT unsigned int OCI_API OCI_PoolGetOpenedCount(OCI_Pool *pool)
Return the current number of opened connections/sessions.
OCI_TypeInfoGetConnection
OCI_EXPORT OCI_Connection *OCI_API OCI_TypeInfoGetConnection(OCI_TypeInfo *typinf)
Retrieve connection handle from the type info handle.
OCI_ColumnGetSubType
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetSubType(OCI_Column *col)
Return the OCILIB object subtype of a column.
OCI_BindGetDataSize
OCI_EXPORT unsigned int OCI_API OCI_BindGetDataSize(OCI_Bind *bnd)
Return the actual size of the element held by the given bind handle.
ocilib::DirectPath::Reset
void Reset()
Reset internal arrays and streams to prepare another load.
Definition: ocilib_impl.hpp:6987
ocilib::Interval::GetYear
int GetYear() const
Return the interval year value.
Definition: ocilib_impl.hpp:2360
OCI_FileIsOpen
OCI_EXPORT boolean OCI_API OCI_FileIsOpen(OCI_File *file)
Check if the specified file is opened within the file handle.
OCI_GetInt2
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.
ocilib::Connection::GetDatabase
ostring GetDatabase() const
Return the Oracle server database name of the connected database/service name.
Definition: ocilib_impl.hpp:1577
OCI_PoolSetNoWait
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...
OCI_DateGetDateTime
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_GetLong
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_EventGetObject
OCI_EXPORT const otext *OCI_API OCI_EventGetObject(OCI_Event *event)
Return the name of the object that generated the event.
ocilib::Timestamp::operator>=
bool operator>=(const Timestamp &other) const
Indicates if the current Timestamp value is superior or equal to the given Timestamp value...
Definition: ocilib_impl.hpp:2976
OCI_ObjectGetUnsignedBigInt
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_GetUnsignedBigInt2
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_GetInstanceStartTime
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_GetDate2
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_PoolGetIncrement
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...
ocilib::Queue::Stop
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.
Definition: ocilib_impl.hpp:7117
OCI_DequeueSetConsumer
OCI_EXPORT boolean OCI_API OCI_DequeueSetConsumer(OCI_Dequeue *dequeue, const otext *consumer)
Set the current consumer name to retrieve message for.
OCI_GetSessionTag
OCI_EXPORT const otext *OCI_API OCI_GetSessionTag(OCI_Connection *con)
Return the tag associated the given connection.
OCI_ElemGetRawSize
OCI_EXPORT unsigned int OCI_API OCI_ElemGetRawSize(OCI_Elem *elem)
Return the raw attribute value size of the given element handle.
ocilib::Lob::operator==
bool operator==(const Lob &other) const
Indicates if the current lob value is equal to the given lob value.
Definition: ocilib_impl.hpp:3187
ocilib::Date::GetMonth
int GetMonth() const
Return the date month value.
Definition: ocilib_impl.hpp:2046
ocilib::Object::GetReference
Reference GetReference() const
Creates a reference on the current object.
Definition: ocilib_impl.hpp:3393
OCI_QueueTableAlter
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.
OCI_TypeInfoGetName
OCI_EXPORT const otext *OCI_API OCI_TypeInfoGetName(OCI_TypeInfo *typinf)
Return the name described by the type info object.
ocilib::Connection::GetTrace
ostring GetTrace(SessionTrace trace) const
Get the current trace for the trace type from the given connection.
Definition: ocilib_impl.hpp:1572
OCI_MsgReset
OCI_EXPORT boolean OCI_API OCI_MsgReset(OCI_Msg *msg)
Reset all attributes of a message object.
ocilib::Pool::SetStatementCacheSize
void SetStatementCacheSize(unsigned int value)
Set the maximum number of statements to keep in the pool&#39;s statement cache.
Definition: ocilib_impl.hpp:1392
OCI_Timestamp
struct OCI_Timestamp OCI_Timestamp
Oracle internal timestamp representation.
Definition: ocilib.h:588
ocilib::Message::GetPriority
int GetPriority() const
Return the priority of the message.
Definition: ocilib_impl.hpp:6698
OCI_AgentSetName
OCI_EXPORT boolean OCI_API OCI_AgentSetName(OCI_Agent *agent, const otext *name)
Set the given AQ agent name.
OCI_QueueTablePurge
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.
ocilib::DirectPath::SetBufferSize
void SetBufferSize(unsigned int value)
Set the size of the internal stream transfer buffer.
Definition: ocilib_impl.hpp:7072
OCI_PoolGetMax
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_LobIsEqual
OCI_EXPORT boolean OCI_API OCI_LobIsEqual(OCI_Lob *lob, OCI_Lob *lob2)
Compare two lob handles for equality.
ocilib::Reference::ToString
ostring ToString() const override
return a string representation of the current reference
Definition: ocilib_impl.hpp:3753
ocilib::Connection::GetFormat
ostring GetFormat(FormatType formatType)
Return the format string for implicit string conversions of the given type.
Definition: ocilib_impl.hpp:1532
ocilib::Statement::GetSql
ostring GetSql() const
Return the last SQL or PL/SQL statement prepared or executed by the statement.
Definition: ocilib_impl.hpp:5063
OCI_LobAssign
OCI_EXPORT boolean OCI_API OCI_LobAssign(OCI_Lob *lob, OCI_Lob *lob_src)
Assign a lob to another one.
OCI_LobErase
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_GetString2
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_CollGetTypeInfo
OCI_EXPORT OCI_TypeInfo *OCI_API OCI_CollGetTypeInfo(OCI_Coll *coll)
Return the type info object associated to the collection.
ocilib::Enum
Template Enumeration template class providing some type safety to some extends for manipulating enume...
Definition: ocilib_core.hpp:151
OCI_LobGetChunkSize
OCI_EXPORT unsigned int OCI_API OCI_LobGetChunkSize(OCI_Lob *lob)
Returns the chunk size of a LOB.
ocilib::Lob::Flush
void Flush()
Flush the lob content to the server (if applicable)
Definition: ocilib_impl.hpp:3162
OCI_RefToText
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_ThreadJoin
OCI_EXPORT boolean OCI_API OCI_ThreadJoin(OCI_Thread *thread)
Join the given thread.
OCI_GetCharset
OCI_EXPORT unsigned int OCI_API OCI_GetCharset(void)
Return the OCILIB charset type.
ocilib::Timestamp::operator++
Timestamp & operator++()
Increment the timestamp by 1 day.
Definition: ocilib_impl.hpp:2867
OCI_ElemGetFloat
OCI_EXPORT float OCI_API OCI_ElemGetFloat(OCI_Elem *elem)
Return the float value of the given collection element.
OCI_GetServerRevisionVersion
OCI_EXPORT unsigned int OCI_API OCI_GetServerRevisionVersion(OCI_Connection *con)
Return the revision version number of the connected database server.
ocilib::Timestamp::operator-
Timestamp operator-(int value) const
Return a new Timestamp holding the current Timestamp value decremented by the given number of days...
Definition: ocilib_impl.hpp:2903
OCI_ObjectAssign
OCI_EXPORT boolean OCI_API OCI_ObjectAssign(OCI_Object *obj, OCI_Object *obj_src)
Assign an object to another one.
ocilib::Date::SetDateTime
void SetDateTime(int year, int month, int day, int hour, int min, int sec)
Set the date and time part.
Definition: ocilib_impl.hpp:2146
ocilib::Long::Long
Long()
Create an empty null Long instance.
Definition: ocilib_impl.hpp:4428
ocilib::Message::Reset
void Reset()
Reset all attributes of the message.
Definition: ocilib_impl.hpp:6610
OCI_TypeInfoGet
OCI_EXPORT OCI_TypeInfo *OCI_API OCI_TypeInfoGet(OCI_Connection *con, const otext *name, unsigned int type)
Retrieve the available type info information.
ocilib::Connection::GetServerMinorVersion
unsigned int GetServerMinorVersion() const
Return the minor version number of the connected database server.
Definition: ocilib_impl.hpp:1492
ocilib::Resultset::GetStatement
Statement GetStatement() const
Return the statement associated with the resultset.
Definition: ocilib_impl.hpp:6003
OCI_BindRaw
OCI_EXPORT boolean OCI_API OCI_BindRaw(OCI_Statement *stmt, const otext *name, void *data, unsigned int len)
Bind a raw buffer.
ocilib::Check
static T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so, it raises a C++ exception using the retrieved error handle.
Definition: ocilib_impl.hpp:124
OCI_BindArrayOfLobs
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.
ocilib::Date::SetHours
void SetHours(int value)
Set the date hours value.
Definition: ocilib_impl.hpp:2089
ocilib::QueueTable::Create
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.
Definition: ocilib_impl.hpp:7126
ocilib::Interval::FromString
void FromString(const ostring &data)
Assign to the interval object the value provided by the input interval string.
Definition: ocilib_impl.hpp:2503
ocilib::Statement::GetConnection
Connection GetConnection() const
Return the connection associated with a statement.
Definition: ocilib_impl.hpp:4953
ocilib::Number::Clone
Number Clone() const
Clone the current instance to a new one performing deep copy.
Definition: ocilib_impl.hpp:1765
OCI_ElemGetBoolean
OCI_EXPORT boolean OCI_API OCI_ElemGetBoolean(OCI_Elem *elem)
Return the boolean value of the given collection element.
OCI_DirPathSetCacheSize
OCI_EXPORT boolean OCI_API OCI_DirPathSetCacheSize(OCI_DirPath *dp, unsigned int size)
Set number of elements in the date cache.
OCI_ElemGetDate
OCI_EXPORT OCI_Date *OCI_API OCI_ElemGetDate(OCI_Elem *elem)
Return the Date value of the given collection element.
ocilib::Environment::ChangeUserPassword
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.
Definition: ocilib_impl.hpp:1080
OCI_GetRowCount
OCI_EXPORT unsigned int OCI_API OCI_GetRowCount(OCI_Resultset *rs)
Retrieve the number of rows fetched so far.
OCI_LobWrite
OCI_EXPORT unsigned int OCI_API OCI_LobWrite(OCI_Lob *lob, void *buffer, unsigned int len)
[OBSOLETE] Write a buffer into a LOB
OCI_BindSetDataSizeAtPos
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_BindArrayGetSize
OCI_EXPORT unsigned int OCI_API OCI_BindArrayGetSize(OCI_Statement *stmt)
Return the current input array size for bulk operations.
OCI_EventGetType
OCI_EXPORT unsigned int OCI_API OCI_EventGetType(OCI_Event *event)
Return the type of event reported by a notification.
OCI_BindSetCharsetForm
boolean OCI_API OCI_BindSetCharsetForm(OCI_Bind *bnd, unsigned int csfrm)
Set the charset form of the given character based bind variable.
OCI_DatabaseShutdown
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_DateGetTime
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_GetPassword
OCI_EXPORT const otext *OCI_API OCI_GetPassword(OCI_Connection *con)
Return the current logged user password.
ocilib::Environment::ShutdownModeValues
ShutdownModeValues
Oracle instance shutdown modes enumerated values.
Definition: ocilib.hpp:825
ocilib::Interval::operator<=
bool operator<=(const Interval &other) const
Indicates if the current Interval value is inferior or equal to the given Interval value...
Definition: ocilib_impl.hpp:2580
OCI_TimestampGetTime
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.
ocilib::Statement::SetLongMaxSize
void SetLongMaxSize(unsigned int value)
Set the LONG data type piece buffer size.
Definition: ocilib_impl.hpp:5798
OCI_NumberFree
OCI_EXPORT boolean OCI_API OCI_NumberFree(OCI_Number *number)
Free a number object.
ocilib::Resultset::GetColumnIndex
unsigned int GetColumnIndex(const ostring &name) const
Return the index of the column in the result from its name.
Definition: ocilib_impl.hpp:5973
ocilib::NumericFloat
Definition: ocilib.hpp:322
ocilib::Resultset::GetColumn
Column GetColumn(unsigned int index) const
Return the column from its index in the resultset.
Definition: ocilib_impl.hpp:5983
ocilib::Pool::Close
void Close()
Destroy the current Oracle pool of connections or sessions.
Definition: ocilib_impl.hpp:1332
OCI_GetUnsignedInt2
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_ObjectGetTimestamp
OCI_EXPORT OCI_Timestamp *OCI_API OCI_ObjectGetTimestamp(OCI_Object *obj, const otext *attr)
Return the timestamp value of the given object attribute.
OCI_BindSetDirection
OCI_EXPORT boolean OCI_API OCI_BindSetDirection(OCI_Bind *bnd, unsigned int direction)
Set the direction mode of a bind handle.
OCI_EnqueueGetRelativeMsgID
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...
OCI_Msg
struct OCI_Msg OCI_Msg
OCILIB encapsulation of A/Q message.
Definition: ocilib.h:749
OCI_IsRebindingAllowed
OCI_EXPORT boolean OCI_API OCI_IsRebindingAllowed(OCI_Statement *stmt)
Indicate if rebinding is allowed on the given statement.
OCI_TimestampGetTimeZoneName
OCI_EXPORT boolean OCI_API OCI_TimestampGetTimeZoneName(OCI_Timestamp *tmsp, int size, otext *str)
Return the time zone name of a timestamp handle.
OCI_TransactionGetMode
OCI_EXPORT unsigned int OCI_API OCI_TransactionGetMode(OCI_Transaction *trans)
Return global transaction mode.
OCI_BindGetStatement
OCI_EXPORT OCI_Statement *OCI_API OCI_BindGetStatement(OCI_Bind *bnd)
Return the statement handle associated with a bind handle.
ocilib::NumericUnsignedShort
Definition: ocilib.hpp:314
OCI_IntervalGetDaySecond
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.
ocilib::Event::GetType
EventType GetType() const
Return the type of event reported by a notification.
Definition: ocilib_impl.hpp:6532
OCI_ElemSetRef
OCI_EXPORT boolean OCI_API OCI_ElemSetRef(OCI_Elem *elem, OCI_Ref *value)
Assign a Ref handle to a collection element.
ocilib::ThreadId
const void * ThreadId
Thread Unique ID.
Definition: ocilib.hpp:205
OCI_ObjectGetObject
OCI_EXPORT OCI_Object *OCI_API OCI_ObjectGetObject(OCI_Object *obj, const otext *attr)
Return the object value of the given object attribute.
OCI_EventGetOperation
OCI_EXPORT unsigned int OCI_API OCI_EventGetOperation(OCI_Event *event)
Return the type of operation reported by a notification.
ocilib::DirectPath::GetMaxRows
unsigned int GetMaxRows() const
Return the maximum number of rows allocated in the OCI and OCILIB internal arrays of rows...
Definition: ocilib_impl.hpp:7037
ocilib::Dequeue::SetConsumer
void SetConsumer(const ostring &value)
Set the current consumer name to retrieve message for.
Definition: ocilib_impl.hpp:6862
ocilib::Connection::SetUserData
void SetUserData(AnyPointer value)
Associate a pointer to user data to the given connection.
Definition: ocilib_impl.hpp:1649
OCI_ThreadKeySetValue
OCI_EXPORT boolean OCI_API OCI_ThreadKeySetValue(const otext *name, void *value)
Set a thread key value.
OCI_GetShort2
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_BindArrayOfUnsignedBigInts
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_TimestampIntervalSub
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.
ocilib::Date::SetDay
void SetDay(int value)
Set the date day value.
Definition: ocilib_impl.hpp:2072
OCI_MutexFree
OCI_EXPORT boolean OCI_API OCI_MutexFree(OCI_Mutex *mutex)
Destroy a mutex object.
ocilib::Resultset::operator--
bool operator--(int)
Convenient operator overloading that performs a call to Prev()
Definition: ocilib_impl.hpp:6013
ocilib::Timestamp::FromString
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.
Definition: ocilib_impl.hpp:2841
ocilib::Dequeue::GetConsumer
ostring GetConsumer() const
Get the current consumer name associated with the dequeuing process.
Definition: ocilib_impl.hpp:6857
ocilib::Long::GetContent
T GetContent() const
Return the string read from a fetch sequence.
ocilib::Date::SysDate
static Date SysDate()
Return the current system date time.
Definition: ocilib_impl.hpp:1997
ocilib::Message::GetExceptionQueue
ostring GetExceptionQueue() const
Get the Exception queue name of the message.
Definition: ocilib_impl.hpp:6741
OCI_TimestampFree
OCI_EXPORT boolean OCI_API OCI_TimestampFree(OCI_Timestamp *tmsp)
Free an OCI_Timestamp handle.
OCI_BindGetSubtype
OCI_EXPORT unsigned int OCI_API OCI_BindGetSubtype(OCI_Bind *bnd)
Return the OCILIB object subtype of the given bind.
OCI_SetUserData
OCI_EXPORT boolean OCI_API OCI_SetUserData(OCI_Connection *con, void *data)
Associate a pointer to user data to the given connection.
ocilib::Lob::Write
unsigned int Write(const T &content)
Write the given content at the current position within the lob.
Definition: ocilib_impl.hpp:3042
OCI_DateCreate
OCI_EXPORT OCI_Date *OCI_API OCI_DateCreate(OCI_Connection *con)
Create a local date object.
ocilib::Column::GetCharsetForm
CharsetForm GetCharsetForm() const
Return the charset form of the given column.
Definition: ocilib_impl.hpp:6414
OCI_RefCreate
OCI_EXPORT OCI_Ref *OCI_API OCI_RefCreate(OCI_Connection *con, OCI_TypeInfo *typinf)
Create a local Ref instance.
OCI_IntervalCreate
OCI_EXPORT OCI_Interval *OCI_API OCI_IntervalCreate(OCI_Connection *con, unsigned int type)
Create a local interval object.
OCI_LobGetConnection
OCI_EXPORT OCI_Connection *OCI_API OCI_LobGetConnection(OCI_Lob *lob)
Retrieve connection handle from the lob handle.
OCI_EnqueueSetSequenceDeviation
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_GetDBName
OCI_EXPORT const otext *OCI_API OCI_GetDBName(OCI_Connection *con)
Return the Oracle server database name of the connected database/service name.
ocilib::Timestamp::SetDateTime
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.
Definition: ocilib_impl.hpp:2630
OCI_ElemIsNull
OCI_EXPORT boolean OCI_API OCI_ElemIsNull(OCI_Elem *elem)
Check if the collection element value is null.
ocilib::Transaction::Stop
void Stop()
Stop current global transaction.
Definition: ocilib_impl.hpp:1678
ocilib::DirectPath::SetConversionMode
void SetConversionMode(ConversionMode value)
Set the direct path conversion mode.
Definition: ocilib_impl.hpp:7077
ocilib::Environment
Static class in charge of library initialization / cleanup.
Definition: ocilib.hpp:610
OCI_RegisterBigInt
OCI_EXPORT boolean OCI_API OCI_RegisterBigInt(OCI_Statement *stmt, const otext *name)
Register a big integer output bind placeholder.
OCI_BindArrayOfFloats
OCI_EXPORT boolean OCI_API OCI_BindArrayOfFloats(OCI_Statement *stmt, const otext *name, float *data, unsigned int nbelem)
Bind an array of floats.
OCI_FileGetOffset
OCI_EXPORT big_uint OCI_API OCI_FileGetOffset(OCI_File *file)
Return the current position in the file.
ocilib::Statement::SetPrefetchMemory
void SetPrefetchMemory(unsigned int value)
Set the amount of memory pre-fetched by OCI Client.
Definition: ocilib_impl.hpp:5788
OCI_SetLongMaxSize
OCI_EXPORT boolean OCI_API OCI_SetLongMaxSize(OCI_Statement *stmt, unsigned int size)
Set the LONG data type piece buffer size.
OCI_RefGetTypeInfo
OCI_EXPORT OCI_TypeInfo *OCI_API OCI_RefGetTypeInfo(OCI_Ref *ref)
Return the type info object associated to the Ref.
OCI_ElemSetLob
OCI_EXPORT boolean OCI_API OCI_ElemSetLob(OCI_Elem *elem, OCI_Lob *value)
Assign a Lob handle to a collection element.
OCI_FileCreate
OCI_EXPORT OCI_File *OCI_API OCI_FileCreate(OCI_Connection *con, unsigned int type)
Create a file object instance.
ocilib::Column::GetPropertyFlags
PropertyFlags GetPropertyFlags() const
Return the column property flags.
Definition: ocilib_impl.hpp:6444
OCI_BindArrayOfUnsignedInts
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.
ocilib::Timestamp::SetMinutes
void SetMinutes(int value)
Set the timestamp minutes value.
Definition: ocilib_impl.hpp:2722
OCI_TransactionCreate
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.
ocilib::Dequeue::SetCorrelation
void SetCorrelation(const ostring &value)
set the correlation identifier of the message to be dequeued
Definition: ocilib_impl.hpp:6872
ocilib::Dequeue::Get
Message Get()
Dequeue messages from the given queue.
Definition: ocilib_impl.hpp:6847
ocilib::Date::SetDate
void SetDate(int year, int month, int day)
Set the date part.
Definition: ocilib_impl.hpp:2136
ocilib::Reference::Reference
Reference()
Create an empty null Reference instance.
Definition: ocilib_impl.hpp:3709
ocilib::CollectionElement
Class used for handling transient collection value. it is used internally by the Collection<T> class:...
Definition: ocilib.hpp:4899
OCI_GetColl
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.
ocilib::Column::GetLeadingPrecision
int GetLeadingPrecision() const
Return the leading precision of the column for Interval columns.
Definition: ocilib_impl.hpp:6439
ocilib::Environment::AllocatedBytesValues
AllocatedBytesValues
Allocated Bytes enumerated values.
Definition: ocilib.hpp:888
ocilib::Collection::Append
void Append(const T &data)
Append the given element value at the end of the collection.
Definition: ocilib_impl.hpp:3903
OCI_ObjectGetUnsignedInt
OCI_EXPORT unsigned int OCI_API OCI_ObjectGetUnsignedInt(OCI_Object *obj, const otext *attr)
Return the unsigned integer value of the given object attribute.
ocilib::Queue::Create
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.
Definition: ocilib_impl.hpp:7096
OCI_ElemSetUnsignedShort
OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedShort(OCI_Elem *elem, unsigned short value)
Set a unsigned short value to a collection element.
ocilib::QueueTable::Migrate
static void Migrate(const Connection &connection, const ostring &table, const ostring &compatible=OTEXT(""))
Migrate a queue table from one version to another.
Definition: ocilib_impl.hpp:7149
ocilib::Interval::operator>=
bool operator>=(const Interval &other) const
Indicates if the current Interval value is superior or equal to the given Interval value...
Definition: ocilib_impl.hpp:2573
ocilib::DirectPath::GetCurrentRows
unsigned int GetCurrentRows() const
Return the current number of rows used in the OCILIB internal arrays of rows.
Definition: ocilib_impl.hpp:7032
OCI_SetPassword
OCI_EXPORT boolean OCI_API OCI_SetPassword(OCI_Connection *con, const otext *password)
Change the password of the logged user.
OCI_Ref
struct OCI_Ref OCI_Ref
Oracle REF type representation.
Definition: ocilib.h:655
ocilib::DirectPath::GetErrorColumn
unsigned int GetErrorColumn()
Return the index of a column which caused an error during data conversion.
Definition: ocilib_impl.hpp:7082
ocilib::Timestamp::GetDate
void GetDate(int &year, int &month, int &day) const
Extract the date parts.
Definition: ocilib_impl.hpp:2764
ocilib::Dequeue::SetRelativeMsgID
void SetRelativeMsgID(const Raw &value)
Set the message identifier of the message to be dequeued.
Definition: ocilib_impl.hpp:6888
ocilib::NumericNumber
Definition: ocilib.hpp:324
ocilib::Subscription::ChangeTypesValues
ChangeTypesValues
Subscription changes flags values.
Definition: ocilib.hpp:6979
ocilib::Dequeue::SetAgents
void SetAgents(std::vector< Agent > &agents)
Set the Agent list to listen to message for.
Definition: ocilib_impl.hpp:6940
OCI_TimestampCheck
OCI_EXPORT int OCI_API OCI_TimestampCheck(OCI_Timestamp *tmsp)
Check if the given timestamp is valid.
ocilib::Subscription::NotifyHandlerProc
void(* NotifyHandlerProc)(Event &evt)
User callback for subscriptions event notifications.
Definition: ocilib.hpp:6972
ocilib::Connection::SetTransaction
void SetTransaction(const Transaction &transaction)
Set a transaction to a connection.
Definition: ocilib_impl.hpp:1522
OCI_GetUnsignedBigInt
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...
ocilib::Column::GetPrecision
int GetPrecision() const
Return the precision of the column for numeric columns.
Definition: ocilib_impl.hpp:6429
OCI_TransactionForget
OCI_EXPORT boolean OCI_API OCI_TransactionForget(OCI_Transaction *trans)
Cancel the prepared global transaction validation.
OCI_GetRaw2
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. ...
ocilib::Long::GetLength
unsigned int GetLength() const
Return the buffer length.
Definition: ocilib_impl.hpp:4458
OCI_IntervalToText
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.
ocilib::Message::SetCorrelation
void SetCorrelation(const ostring &value)
Set the correlation identifier of the message.
Definition: ocilib_impl.hpp:6736
OCI_EnableWarnings
OCI_EXPORT boolean OCI_API OCI_EnableWarnings(boolean value)
Enable or disable Oracle warning notifications.
OCI_RegisterInt
OCI_EXPORT boolean OCI_API OCI_RegisterInt(OCI_Statement *stmt, const otext *name)
Register an integer output bind placeholder.
OCI_GetResultset
OCI_EXPORT OCI_Resultset *OCI_API OCI_GetResultset(OCI_Statement *stmt)
Retrieve the resultset handle from an executed statement.
ocilib::Resultset::ForEach
unsigned int ForEach(T callback)
Fetch all rows in the resultset and call the given callback for row.
ocilib::Collection::GetType
CollectionType GetType() const
Return the type of the collection.
Definition: ocilib_impl.hpp:3807
ocilib::AnyPointer
void * AnyPointer
Alias for the generic void pointer.
Definition: ocilib.hpp:169
OCI_GetBindIndex
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_TransactionFree
OCI_EXPORT boolean OCI_API OCI_TransactionFree(OCI_Transaction *trans)
Free current transaction.
ocilib::Exception::what
const char * what() const override
Override the std::exception::what() method.
Definition: ocilib_impl.hpp:920
ocilib::Exception::GetType
ExceptionType GetType() const
Return the Exception type.
Definition: ocilib_impl.hpp:942
OCI_ObjectSetUnsignedBigInt
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.
ocilib::DirectPath::GetAffectedRows
unsigned int GetAffectedRows() const
return the number of rows successfully processed during in the last conversion or loading call ...
Definition: ocilib_impl.hpp:7047
OCI_GetUserData
OCI_EXPORT void *OCI_API OCI_GetUserData(OCI_Connection *con)
Return the pointer to user data previously associated with the connection.
ocilib::Enqueue::GetRelativeMsgID
Raw GetRelativeMsgID() const
Get the current associated message identifier used for enqueuing messages using a sequence deviation...
Definition: ocilib_impl.hpp:6810
ocilib::Dequeue::Subscribe
void Subscribe(unsigned int port, unsigned int timeout, NotifyAQHandlerProc handler)
Subscribe for asynchronous messages notifications.
Definition: ocilib_impl.hpp:6955
ocilib::Exception::GetConnection
Connection GetConnection() const
Return the connection within the error occurred.
Definition: ocilib_impl.hpp:962
ocilib::Environment::Cleanup
static void Cleanup()
Clean up all resources allocated by the environment.
Definition: ocilib_impl.hpp:981
ocilib::Interval::SetMilliSeconds
void SetMilliSeconds(int value)
Set the interval milliseconds value.
Definition: ocilib_impl.hpp:2471
OCI_DequeueGetMode
OCI_EXPORT unsigned int OCI_API OCI_DequeueGetMode(OCI_Dequeue *dequeue)
Get the dequeuing/locking behavior.
OCI_GetUnsignedShort
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_FetchFirst
OCI_EXPORT boolean OCI_API OCI_FetchFirst(OCI_Resultset *rs)
Fetch the first row of the resultset.
ocilib::Collection::Clear
void Clear()
Clear all items of the collection.
Definition: ocilib_impl.hpp:3839
ocilib::Connection::IsServerAlive
bool IsServerAlive() const
Indicate if the connection is still connected to the server.
Definition: ocilib_impl.hpp:1452
ocilib::Interval::operator+
Interval operator+(const Interval &other) const
Return a new Interval holding the sum of the current Interval value and the given Interval value...
Definition: ocilib_impl.hpp:2529
OCI_DateSetTime
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_GetTimestamp2
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.
ocilib::Statement::SetBindArraySize
void SetBindArraySize(unsigned int size)
Set the input array size for bulk operations.
Definition: ocilib_impl.hpp:5078
ocilib::Interval::operator+=
Interval & operator+=(const Interval &other)
Increment the current Value with the given Interval value.
Definition: ocilib_impl.hpp:2541
ocilib::Thread::Run
static void Run(ThreadHandle handle, ThreadProc func, void *args)
Execute the given routine within the given thread.
Definition: ocilib_impl.hpp:1274
OCI_SubscriptionGetPort
OCI_EXPORT unsigned int OCI_API OCI_SubscriptionGetPort(OCI_Subscription *sub)
Return the port used by the notification.
OCI_RefGetHexSize
OCI_EXPORT unsigned int OCI_API OCI_RefGetHexSize(OCI_Ref *ref)
Returns the size of the hex representation of the given Ref handle.
ocilib::Collection::GetSize
unsigned int GetSize() const
Returns the total number of elements in the collection.
Definition: ocilib_impl.hpp:3819
OCI_AgentGetAddress
OCI_EXPORT const otext *OCI_API OCI_AgentGetAddress(OCI_Agent *agent)
Get the given AQ agent address.
ocilib::Statement::GetFetchSize
unsigned int GetFetchSize() const
Return the number of rows fetched per internal server fetch call.
Definition: ocilib_impl.hpp:5773
OCI_GetOCICompileVersion
OCI_EXPORT unsigned int OCI_API OCI_GetOCICompileVersion(void)
Return the version of OCI used for compilation.
OCI_NumberSub
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_DatabaseStartup
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_ObjectGetFloat
OCI_EXPORT float OCI_API OCI_ObjectGetFloat(OCI_Object *obj, const otext *attr)
Return the float value of the given object attribute.
ocilib::Transaction::Prepare
void Prepare()
Prepare a global transaction validation.
Definition: ocilib_impl.hpp:1668
OCI_ColumnGetLeadingPrecision
OCI_EXPORT int OCI_API OCI_ColumnGetLeadingPrecision(OCI_Column *col)
Return the leading precision of the column for interval columns.
ocilib::Enqueue::SetMode
void SetMode(EnqueueMode value)
Set the enqueuing mode of messages to put in the queue.
Definition: ocilib_impl.hpp:6805
OCI_GetServerMinorVersion
OCI_EXPORT unsigned int OCI_API OCI_GetServerMinorVersion(OCI_Connection *con)
Return the minor version number of the connected database server.
OCI_DirPathReset
OCI_EXPORT boolean OCI_API OCI_DirPathReset(OCI_DirPath *dp)
Reset internal arrays and streams to prepare another load.
OCI_ElemGetInterval
OCI_EXPORT OCI_Interval *OCI_API OCI_ElemGetInterval(OCI_Elem *elem)
Return the Interval value of the given collection element.
OCI_MsgSetObject
OCI_EXPORT boolean OCI_API OCI_MsgSetObject(OCI_Msg *msg, OCI_Object *obj)
Set the object payload of the given message.
OCI_CollGetMax
OCI_EXPORT unsigned int OCI_API OCI_CollGetMax(OCI_Coll *coll)
Returns the maximum number of elements of the given collection.
OCI_DequeueGetCorrelation
OCI_EXPORT const otext *OCI_API OCI_DequeueGetCorrelation(OCI_Dequeue *dequeue)
Get the correlation identifier of the message to be dequeued.
OCI_NumberCompare
OCI_EXPORT int OCI_API OCI_NumberCompare(OCI_Number *number1, OCI_Number *number2)
Compares two number handles.
ocilib::Collection
Object identifying the SQL data types VARRAY and NESTED TABLE.
Definition: ocilib.hpp:4990
ocilib::Message::SetPriority
void SetPriority(int value)
Set the priority of the message.
Definition: ocilib_impl.hpp:6703
OCI_ElemGetRaw
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.
ocilib::Date::ToString
ostring ToString() const override
Convert the date value to a string using default format OCI_STRING_FORMAT_DATE.
Definition: ocilib_impl.hpp:2220
ocilib::Object::IsAttributeNull
bool IsAttributeNull(const ostring &name) const
Check if an object attribute is null.
Definition: ocilib_impl.hpp:3378
ocilib::Timestamp::operator--
Timestamp & operator--()
Decrement the Timestamp by 1 day.
Definition: ocilib_impl.hpp:2881
OCI_GetStatement2
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.
ocilib::Column::GetScale
int GetScale() const
Return the scale of the column for numeric columns.
Definition: ocilib_impl.hpp:6424
OCI_FileFree
OCI_EXPORT boolean OCI_API OCI_FileFree(OCI_File *file)
Free a local File object.
OCI_ColumnGetPropertyFlags
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetPropertyFlags(OCI_Column *col)
Return the column property flags.
ocilib::Pool::SetNoWait
void SetNoWait(bool value)
Set the waiting mode used when no more connections/sessions are available from the pool...
Definition: ocilib_impl.hpp:1357
OCI_LobOpen
OCI_EXPORT boolean OCI_API OCI_LobOpen(OCI_Lob *lob, unsigned int mode)
Open explicitly a Lob.
ocilib::Date::SetMonth
void SetMonth(int value)
Set the date month value.
Definition: ocilib_impl.hpp:2055
OCI_Date
struct OCI_Date OCI_Date
Oracle internal date representation.
Definition: ocilib.h:578
OCI_GetBigInt
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.
ocilib::Lob::Clone
Lob Clone() const
Clone the current instance to a new one performing deep copy.
Definition: ocilib_impl.hpp:3080
ocilib::Timestamp::operator<=
bool operator<=(const Timestamp &other) const
Indicates if the current Timestamp value is inferior or equal to the given Timestamp value...
Definition: ocilib_impl.hpp:2983
ocilib::Pool::GetMaxSize
unsigned int GetMaxSize() const
Return the maximum number of connections/sessions that can be opened to the database.
Definition: ocilib_impl.hpp:1377
ocilib::Connection::GetVersion
OracleVersion GetVersion() const
Return the Oracle version supported by the connection.
Definition: ocilib_impl.hpp:1477
ocilib::Pool::GetStatementCacheSize
unsigned int GetStatementCacheSize() const
Return the maximum number of statements to keep in the pool&#39;s statement cache.
Definition: ocilib_impl.hpp:1387
OCI_DequeueGetNavigation
OCI_EXPORT unsigned int OCI_API OCI_DequeueGetNavigation(OCI_Dequeue *dequeue)
Return the navigation position of messages to retrieve from the queue.
OCI_ElemGetNumber
OCI_EXPORT OCI_Number *OCI_API OCI_ElemGetNumber(OCI_Elem *elem)
Return the number value of the given collection element.
OCI_PoolGetNoWait
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_DirPathConvert
OCI_EXPORT unsigned int OCI_API OCI_DirPathConvert(OCI_DirPath *dp)
Convert provided user data to the direct path stream format.
OCI_DateSetDate
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_DateDaysBetween
OCI_EXPORT int OCI_API OCI_DateDaysBetween(OCI_Date *date, OCI_Date *date2)
Return the number of days betWeen two dates.
ocilib::Timestamp::SetTimeZone
void SetTimeZone(const ostring &timeZone)
Set the given time zone to the timestamp.
Definition: ocilib_impl.hpp:2795
ocilib::Collection::Clone
Collection Clone() const
Clone the current instance to a new one performing deep copy.
Definition: ocilib_impl.hpp:3791
OCI_GetVersionConnection
OCI_EXPORT unsigned int OCI_API OCI_GetVersionConnection(OCI_Connection *con)
Return the highest Oracle version is supported by the connection.
OCI_BindGetDataSizeAtPos
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.
ocilib::Timestamp::GetTimeZone
ostring GetTimeZone() const
Return the name of the current time zone.
Definition: ocilib_impl.hpp:2806
OCI_IsTAFCapable
OCI_EXPORT boolean OCI_API OCI_IsTAFCapable(OCI_Connection *con)
Verify if the given connection support TAF events.
ocilib::Environment::Initialized
static bool Initialized()
Return true if the environment has been successfully initialized.
Definition: ocilib_impl.hpp:1006
OCI_HandleGetEnvironment
OCI_EXPORT const void *OCI_API OCI_HandleGetEnvironment(void)
Return the OCI Environment Handle (OCIEnv *) of OCILIB library.
ocilib::Exception::GetInternalErrorCode
int GetInternalErrorCode() const
Return the OCILIB error code.
Definition: ocilib_impl.hpp:952
OCI_MsgGetExpiration
OCI_EXPORT int OCI_API OCI_MsgGetExpiration(OCI_Msg *msg)
Return the duration that the message is available for dequeuing.
ocilib::Interval::GetMilliSeconds
int GetMilliSeconds() const
Return the interval seconds value.
Definition: ocilib_impl.hpp:2462
ocilib::Mutex::Destroy
static void Destroy(MutexHandle handle)
Destroy a mutex handle.
Definition: ocilib_impl.hpp:1245
OCI_BindDate
OCI_EXPORT boolean OCI_API OCI_BindDate(OCI_Statement *stmt, const otext *name, OCI_Date *data)
Bind a date variable.
ocilib::Resultset::GetCount
unsigned int GetCount() const
Retrieve the number of rows fetched so far.
Definition: ocilib_impl.hpp:5963
ocilib::Environment::GetRuntimeVersion
static OracleVersion GetRuntimeVersion()
Return the version of OCI used at runtime.
Definition: ocilib_impl.hpp:1016
OCI_CollFree
OCI_EXPORT boolean OCI_API OCI_CollFree(OCI_Coll *coll)
Free a local collection.
ocilib::Statement::AllowRebinding
void AllowRebinding(bool value)
Allow different host variables to be binded using the same bind name or position between executions o...
Definition: ocilib_impl.hpp:5088
OCI_DateSysDate
OCI_EXPORT boolean OCI_API OCI_DateSysDate(OCI_Date *date)
Return the current system date/time into the date handle.
OCI_BindArrayOfRaws
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_RefGetObject
OCI_EXPORT OCI_Object *OCI_API OCI_RefGetObject(OCI_Ref *ref)
Returns the object pointed by the Ref handle.
ocilib::Statement::GetBatchErrors
void GetBatchErrors(std::vector< Exception > &exceptions)
Returns all errors that occurred within a DML array statement execution.
Definition: ocilib_impl.hpp:5828
OCI_ElemGetColl
OCI_EXPORT OCI_Coll *OCI_API OCI_ElemGetColl(OCI_Elem *elem)
Return the collection value of the given collection element.
ocilib::Transaction::Resume
void Resume()
Resume a stopped global transaction.
Definition: ocilib_impl.hpp:1683
OCI_Transaction
struct OCI_Transaction OCI_Transaction
Oracle Transaction.
Definition: ocilib.h:537
ocilib::Timestamp::SetSeconds
void SetSeconds(int value)
Set the timestamp seconds value.
Definition: ocilib_impl.hpp:2739
OCI_CollGetCount
OCI_EXPORT unsigned int OCI_API OCI_CollGetCount(OCI_Coll *coll)
Returns the current number of elements of the given collection.
ocilib::Statement::GetPrefetchMemory
unsigned int GetPrefetchMemory() const
Return the amount of memory used to retrieve rows pre-fetched by OCI Client.
Definition: ocilib_impl.hpp:5793
OCI_CollGetElem
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_ElemSetUnsignedInt
OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedInt(OCI_Elem *elem, unsigned int value)
Set a unsigned int value to a collection element.
OCI_ObjectGetUnsignedShort
OCI_EXPORT unsigned short OCI_API OCI_ObjectGetUnsignedShort(OCI_Object *obj, const otext *attr)
Return the unsigned short value of the given object attribute.
ocilib::Date::GetSeconds
int GetSeconds() const
Return the date seconds value.
Definition: ocilib_impl.hpp:2114
OCI_GetInstanceName
OCI_EXPORT const otext *OCI_API OCI_GetInstanceName(OCI_Connection *con)
Return the Oracle server Instance name of the connected database/service name.
OCI_GetFetchMode
OCI_EXPORT unsigned int OCI_API OCI_GetFetchMode(OCI_Statement *stmt)
Return the fetch mode of a SQL statement.
ocilib::File::Clone
File Clone() const
Clone the current instance to a new one performing deep copy.
Definition: ocilib_impl.hpp:3237
OCI_SubscriptionAddStatement
OCI_EXPORT boolean OCI_API OCI_SubscriptionAddStatement(OCI_Subscription *sub, OCI_Statement *stmt)
Add a statement to the notification to monitor.
OCI_LobTruncate
OCI_EXPORT boolean OCI_API OCI_LobTruncate(OCI_Lob *lob, big_uint size)
Truncate the given lob to a shorter length.
ocilib::Agent::SetAddress
void SetAddress(const ostring &value)
Set the given AQ agent address.
Definition: ocilib_impl.hpp:6591
OCI_ThreadKeyGetValue
OCI_EXPORT void *OCI_API OCI_ThreadKeyGetValue(const otext *name)
Get a thread key value.
ocilib::ThreadKey::ThreadKeyFreeProc
POCI_THREADKEYDEST ThreadKeyFreeProc
Thread Key callback for freeing resources.
Definition: ocilib.hpp:1391
ocilib::Timestamp::SetDay
void SetDay(int value)
Set the timestamp day value.
Definition: ocilib_impl.hpp:2688
ocilib::Statement::GetBindCount
unsigned int GetBindCount() const
Return the number of binds currently associated to a statement.
Definition: ocilib_impl.hpp:5103
ocilib::NumericInt
Definition: ocilib.hpp:310
ocilib::Message::Message
Message(const TypeInfo &typeInfo)
Create a message object based on the given payload type.
Definition: ocilib_impl.hpp:6600
OCI_LobClose
OCI_EXPORT boolean OCI_API OCI_LobClose(OCI_Lob *lob)
Close explicitly a Lob.
OCI_BindArrayOfDates
OCI_EXPORT boolean OCI_API OCI_BindArrayOfDates(OCI_Statement *stmt, const otext *name, OCI_Date **data, unsigned int nbelem)
Bind an array of dates.
ocilib::Resultset::Prev
bool Prev()
Fetch the previous row of the resultset.
Definition: ocilib_impl.hpp:5943
OCI_GetInterval2
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.
ocilib::Pool::SetTimeout
void SetTimeout(unsigned int value)
Set the connections/sessions idle timeout.
Definition: ocilib_impl.hpp:1347
OCI_CollSetElem
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.
ocilib::Dequeue::SetMode
void SetMode(DequeueMode value)
Set the dequeuing/locking behavior.
Definition: ocilib_impl.hpp:6915
ocilib::Lob::GetType
LobType GetType() const
return the type of lob
Definition: ocilib_impl.hpp:3096
OCI_DirPathAbort
OCI_EXPORT boolean OCI_API OCI_DirPathAbort(OCI_DirPath *dp)
Terminate a direct path operation without committing changes.
OCI_CollAppend
OCI_EXPORT boolean OCI_API OCI_CollAppend(OCI_Coll *coll, OCI_Elem *elem)
Append the given element at the end of the collection.
OCI_ElemSetUnsignedBigInt
OCI_EXPORT boolean OCI_API OCI_ElemSetUnsignedBigInt(OCI_Elem *elem, big_uint value)
Set a unsigned big_int value to a collection element.
OCI_BindLob
OCI_EXPORT boolean OCI_API OCI_BindLob(OCI_Statement *stmt, const otext *name, OCI_Lob *data)
Bind a Lob variable.
ocilib::File::GetConnection
Connection GetConnection() const
Return the file parent connection.
Definition: ocilib_impl.hpp:3261
OCI_RegisterDouble
OCI_EXPORT boolean OCI_API OCI_RegisterDouble(OCI_Statement *stmt, const otext *name)
Register a double output bind placeholder.
OCI_GetColumnCount
OCI_EXPORT unsigned int OCI_API OCI_GetColumnCount(OCI_Resultset *rs)
Return the number of columns in the resultset.
OCI_DirPathGetErrorColumn
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_ColumnGetCharsetForm
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetCharsetForm(OCI_Column *col)
Return the charset form of the given column.
POCI_NOTIFY
void(* POCI_NOTIFY)(OCI_Event *event)
Database Change Notification User callback prototype.
Definition: ocilib.h:839
ocilib::Queue::Start
static void Start(const Connection &connection, const ostring &queue, bool enableEnqueue=true, bool enableDequeue=true)
Start the given queue.
Definition: ocilib_impl.hpp:7112
ocilib::Number::ToString
ostring ToString() const override
Convert the number value to a string using default format OCI_STRING_FORMAT_NUMERIC.
Definition: ocilib_impl.hpp:1760
OCI_AllowRebinding
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_Describe
OCI_EXPORT boolean OCI_API OCI_Describe(OCI_Statement *stmt, const otext *sql)
Describe the select list of a SQL select statement.
OCI_BindGetName
OCI_EXPORT const otext *OCI_API OCI_BindGetName(OCI_Bind *bnd)
Return the name of the given bind.
ocilib::Interval::UpdateTimeZone
void UpdateTimeZone(const ostring &timeZone)
Update the interval value with the given time zone.
Definition: ocilib_impl.hpp:2498
OCI_ServerEnableOutput
OCI_EXPORT boolean OCI_API OCI_ServerEnableOutput(OCI_Connection *con, unsigned int bufsize, unsigned int arrsize, unsigned int lnsize)
Enable the server output.
ocilib::Date::operator!=
bool operator!=(const Date &other) const
Indicates if the current date value is not equal the given date value.
Definition: ocilib_impl.hpp:2282
OCI_LobAppend
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_GetMaxCursors
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_LobCopy
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_MsgSetSender
OCI_EXPORT boolean OCI_API OCI_MsgSetSender(OCI_Msg *msg, OCI_Agent *sender)
Set the original sender of a message.
OCI_GetSQLVerb
OCI_EXPORT const otext *OCI_API OCI_GetSQLVerb(OCI_Statement *stmt)
Return the verb of the SQL command held by the statement handle.
ocilib::Interval::GetMinutes
int GetMinutes() const
Return the interval minutes value.
Definition: ocilib_impl.hpp:2428
OCI_ErrorGetString
OCI_EXPORT const otext *OCI_API OCI_ErrorGetString(OCI_Error *err)
Retrieve error message from error handle.
ocilib::File::SetInfos
void SetInfos(const ostring &directory, const ostring &name)
Set the directory and file name of our file object.
Definition: ocilib_impl.hpp:3271
OCI_Resultset
struct OCI_Resultset OCI_Resultset
Collection of output columns from a select statement.
Definition: ocilib.h:462
OCI_GetDomainName
OCI_EXPORT const otext *OCI_API OCI_GetDomainName(OCI_Connection *con)
Return the Oracle server domain name of the connected database/service name.
OCI_ObjectIsNull
OCI_EXPORT boolean OCI_API OCI_ObjectIsNull(OCI_Object *obj, const otext *attr)
Check if an object attribute is null.
OCI_DequeueGetWaitTime
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_Execute
OCI_EXPORT boolean OCI_API OCI_Execute(OCI_Statement *stmt)
Execute a prepared SQL statement or PL/SQL block.
ocilib::BindInfo::GetType
DataType GetType() const
Return the OCILIB type of the data associated with the bind object.
Definition: ocilib_impl.hpp:4888
ocilib::Connection::SetStatementCacheSize
void SetStatementCacheSize(unsigned int value)
Set the maximum number of statements to keep in the statement cache.
Definition: ocilib_impl.hpp:1612
ocilib::Connection::GetMaxCursors
unsigned int GetMaxCursors() const
Return the maximum number of SQL statements that can be opened in one session.
Definition: ocilib_impl.hpp:1627
OCI_ObjectFree
OCI_EXPORT boolean OCI_API OCI_ObjectFree(OCI_Object *obj)
Free a local object.
OCI_ElemSetFile
OCI_EXPORT boolean OCI_API OCI_ElemSetFile(OCI_Elem *elem, OCI_File *value)
Assign a File handle to a collection element.
ocilib::NumericTypeResolver
Allow resolving a the C API numeric enumerated type from a C++ type.
Definition: ocilib_impl.hpp:110
ocilib::Statement::GetFetchMode
FetchMode GetFetchMode() const
Return the fetch mode of a SQL statement.
Definition: ocilib_impl.hpp:5753
ocilib::Environment::SessionFlagsValues
SessionFlagsValues
Session flags enumerated values.
Definition: ocilib.hpp:749
ocilib::Transaction::TransactionFlagsValues
TransactionFlagsValues
Transaction flags enumerated values.
Definition: ocilib.hpp:2394
OCI_GetLastError
OCI_EXPORT OCI_Error *OCI_API OCI_GetLastError(void)
Retrieve the last error or warning occurred within the last OCILIB call.
OCI_TransactionPrepare
OCI_EXPORT boolean OCI_API OCI_TransactionPrepare(OCI_Transaction *trans)
Prepare a global transaction validation.
OCI_FileGetDirectory
OCI_EXPORT const otext *OCI_API OCI_FileGetDirectory(OCI_File *file)
Return the directory of the given file.
OCI_BindArrayOfInts
OCI_EXPORT boolean OCI_API OCI_BindArrayOfInts(OCI_Statement *stmt, const otext *name, int *data, unsigned int nbelem)
Bind an array of integers.
ocilib::Date::AddDays
void AddDays(int days)
Add or subtract days.
Definition: ocilib_impl.hpp:2166
ocilib::Pool::GetIncrement
unsigned int GetIncrement() const
Return the increment for connections/sessions to be opened to the database when the pool is not full...
Definition: ocilib_impl.hpp:1382
ocilib::Date::GetDate
void GetDate(int &year, int &month, int &day) const
Extract the date parts.
Definition: ocilib_impl.hpp:2151
OCI_DirPathGetAffectedRows
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_MsgGetEnqueueTime
OCI_EXPORT OCI_Date *OCI_API OCI_MsgGetEnqueueTime(OCI_Msg *msg)
return the time the message was enqueued
ocilib::Agent::GetName
ostring GetName() const
Get the given AQ agent name.
Definition: ocilib_impl.hpp:6576
ocilib::Interval::DaySecond
Definition: ocilib.hpp:3135
ocilib::Collection::Get
T Get(unsigned int index) const
Return the collection element value at the given position.
Definition: ocilib_impl.hpp:3887
OCI_BindBoolean
OCI_EXPORT boolean OCI_API OCI_BindBoolean(OCI_Statement *stmt, const otext *name, boolean *data)
Bind a boolean variable (PL/SQL ONLY)
ocilib::Thread::Destroy
static void Destroy(ThreadHandle handle)
Destroy a thread.
Definition: ocilib_impl.hpp:1269
OCI_GetInt
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.
ocilib::Statement::GetBind
BindInfo GetBind(unsigned int index) const
Return the bind at the given index in the internal array of bind objects.
Definition: ocilib_impl.hpp:5108
ocilib::Date::operator>=
bool operator>=(const Date &other) const
Indicates if the current date value is superior or equal to the given date value. ...
Definition: ocilib_impl.hpp:2297
ocilib::Date::SetTime
void SetTime(int hour, int min, int sec)
Set the time part.
Definition: ocilib_impl.hpp:2141
OCI_GetCurrentRow
OCI_EXPORT unsigned int OCI_API OCI_GetCurrentRow(OCI_Resultset *rs)
Retrieve the current row number.
OCI_SubscriptionGetConnection
OCI_EXPORT OCI_Connection *OCI_API OCI_SubscriptionGetConnection(OCI_Subscription *sub)
Return the connection handle associated with a subscription handle.
OCI_ObjectSetUnsignedInt
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_GetFloat2
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.
ocilib::Interval::GetYearMonth
void GetYearMonth(int &year, int &month) const
Extract the year / month parts from the interval value.
Definition: ocilib_impl.hpp:2489
OCI_GetBigInt2
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.
ocilib::Subscription::GetTimeout
unsigned int GetTimeout() const
Return the timeout of the given registered subscription.
Definition: ocilib_impl.hpp:6508
ocilib::Connection::GetStatementCacheSize
unsigned int GetStatementCacheSize() const
Return the maximum number of statements to keep in the statement cache.
Definition: ocilib_impl.hpp:1607
ocilib::Clong
Long< ostring, LongCharacter > Clong
Class handling LONG oracle type.
Definition: ocilib_impl.hpp:49
OCI_DirPathSetCurrentRows
OCI_EXPORT boolean OCI_API OCI_DirPathSetCurrentRows(OCI_DirPath *dp, unsigned int nb_rows)
Set the current number of rows to convert and load.
ocilib::Transaction::Start
void Start()
Start global transaction.
Definition: ocilib_impl.hpp:1673
OCI_MsgGetRaw
OCI_EXPORT boolean OCI_API OCI_MsgGetRaw(OCI_Msg *msg, void *raw, unsigned int *size)
Get the RAW payload of the given message.
ocilib::Transaction::GetFlags
TransactionFlags GetFlags() const
Return the transaction mode.
Definition: ocilib_impl.hpp:1693
ocilib::File::Read
Raw Read(unsigned int size)
Read a portion of a file.
Definition: ocilib_impl.hpp:3223
OCI_MutexRelease
OCI_EXPORT boolean OCI_API OCI_MutexRelease(OCI_Mutex *mutex)
Release a mutex lock.
ocilib::Timestamp::SetMilliSeconds
void SetMilliSeconds(int value)
Set the timestamp milliseconds value.
Definition: ocilib_impl.hpp:2756
OCI_TimestampConstruct
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_TimestampSubtract
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.
ocilib::Dequeue::SetVisibility
void SetVisibility(DequeueVisibility value)
Set whether the new message is dequeued as part of the current transaction.
Definition: ocilib_impl.hpp:6905
ocilib::ThreadKey::GetValue
static AnyPointer GetValue(const ostring &name)
Get a thread key value.
Definition: ocilib_impl.hpp:1303
OCI_MsgGetPriority
OCI_EXPORT int OCI_API OCI_MsgGetPriority(OCI_Msg *msg)
Return the priority of the message.
ocilib::Connection::DisableServerOutput
void DisableServerOutput()
Disable the server output.
Definition: ocilib_impl.hpp:1542
OCI_DateZoneToZone
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.
ocilib::Timestamp::operator==
bool operator==(const Timestamp &other) const
Indicates if the current Timestamp value is equal to the given Timestamp value.
Definition: ocilib_impl.hpp:2956
OCI_CollGetSize
OCI_EXPORT unsigned int OCI_API OCI_CollGetSize(OCI_Coll *coll)
Returns the total number of elements of the given collection.
ocilib::Statement::GetBindArraySize
unsigned int GetBindArraySize() const
Return the current input array size for bulk operations.
Definition: ocilib_impl.hpp:5083
OCI_HandleGetThreadID
OCI_EXPORT const void *OCI_API OCI_HandleGetThreadID(OCI_Thread *thread)
Return OCI Thread ID (OCIThreadId *) of an OCILIB OCI_Thread object.
ocilib::Message::GetState
MessageState GetState() const
Return the state of the message at the time of the dequeue.
Definition: ocilib_impl.hpp:6662
OCI_MsgFree
OCI_EXPORT boolean OCI_API OCI_MsgFree(OCI_Msg *msg)
Free a message object.
ocilib::Interval::GetDaySecond
void GetDaySecond(int &day, int &hour, int &min, int &sec, int &fsec) const
Extract the date / second parts from the interval value.
Definition: ocilib_impl.hpp:2479
ocilib::DirectPath::SetColumn
void SetColumn(unsigned int colIndex, const ostring &name, unsigned int maxSize, const ostring &format=OTEXT(""))
Describe a column to load into the given table.
Definition: ocilib_impl.hpp:6976
OCI_RegisterUnsignedInt
OCI_EXPORT boolean OCI_API OCI_RegisterUnsignedInt(OCI_Statement *stmt, const otext *name)
Register an unsigned integer output bind placeholder.
ocilib::Timestamp::Substract
static void Substract(const Timestamp &lsh, const Timestamp &rsh, Interval &result)
Subtract the given two timestamp and store the result into the given Interval.
Definition: ocilib_impl.hpp:2827
OCI_EnqueueSetVisibility
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_PoolGetBusyCount
OCI_EXPORT unsigned int OCI_API OCI_PoolGetBusyCount(OCI_Pool *pool)
Return the current number of busy connections/sessions.
OCI_ConnectionCreate
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.
ocilib::Interval::GetType
IntervalType GetType() const
Return the type of the given interval object.
Definition: ocilib_impl.hpp:2350
OCI_GetDouble
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_CollAssign
OCI_EXPORT boolean OCI_API OCI_CollAssign(OCI_Coll *coll, OCI_Coll *coll_src)
Assign a collection to another one.
ocilib::Statement::GetSqlErrorPos
unsigned int GetSqlErrorPos() const
Return the error position (in terms of characters) in the SQL statement where the error occurred in c...
Definition: ocilib_impl.hpp:5743
OCI_SubscriptionGetTimeout
OCI_EXPORT unsigned int OCI_API OCI_SubscriptionGetTimeout(OCI_Subscription *sub)
Return the timeout of the given registered subscription.
OCI_MsgGetSender
OCI_EXPORT OCI_Agent *OCI_API OCI_MsgGetSender(OCI_Msg *msg)
Return the original sender of a message.
ocilib::Environment::GetCompileVersion
static OracleVersion GetCompileVersion()
Return the version of OCI used for compiling OCILIB.
Definition: ocilib_impl.hpp:1011
ocilib::DirectPath::Finish
void Finish()
Terminate a direct path operation and commit changes into the database.
Definition: ocilib_impl.hpp:7007
OCI_SetHAHandler
OCI_EXPORT boolean OCI_API OCI_SetHAHandler(POCI_HA_HANDLER handler)
Set the High availability (HA) user handler.
ocilib::DirectPath::Convert
DirectPath::Result Convert()
Convert provided user data to the direct path stream format.
Definition: ocilib_impl.hpp:6997
ocilib::Interval::operator-=
Interval & operator-=(const Interval &other)
Decrement the current Value with the given Interval value.
Definition: ocilib_impl.hpp:2547
OCI_DateToText
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_ElemGetShort
OCI_EXPORT short OCI_API OCI_ElemGetShort(OCI_Elem *elem)
Return the short value of the given collection element.
ocilib::Enqueue::Enqueue
Enqueue(const TypeInfo &typeInfo, const ostring &queueName)
Create a Enqueue object for the given queue.
Definition: ocilib_impl.hpp:6780
ocilib::Dequeue::Dequeue
Dequeue(const TypeInfo &typeInfo, const ostring &queueName)
Parametrized constructor.
Definition: ocilib_impl.hpp:6837
ocilib::ThreadKey::SetValue
static void SetValue(const ostring &name, AnyPointer value)
Set a thread key value.
Definition: ocilib_impl.hpp:1298
OCI_EventGetDatabase
OCI_EXPORT const otext *OCI_API OCI_EventGetDatabase(OCI_Event *event)
Return the name of the database that generated the event.
OCI_RegisterObject
OCI_EXPORT boolean OCI_API OCI_RegisterObject(OCI_Statement *stmt, const otext *name, OCI_TypeInfo *typinf)
Register an object output bind placeholder.
OCI_ObjectSetBigInt
OCI_EXPORT boolean OCI_API OCI_ObjectSetBigInt(OCI_Object *obj, const otext *attr, big_int value)
Set an object attribute of type big int.
ocilib::TypeInfo::GetConnection
Connection GetConnection() const
Return the connection associated with a statement.
Definition: ocilib_impl.hpp:3335
OCI_File
struct OCI_File OCI_File
Oracle External Large objects:
Definition: ocilib.h:522
OCI_LobCreate
OCI_EXPORT OCI_Lob *OCI_API OCI_LobCreate(OCI_Connection *con, unsigned int type)
Create a local temporary Lob instance.
ocilib::Mutex::Create
static MutexHandle Create()
Create a Mutex handle.
Definition: ocilib_impl.hpp:1240
ocilib::Timestamp::ToString
ostring ToString() const override
Convert the timestamp value to a string using default date format and no precision.
Definition: ocilib_impl.hpp:2862
OCI_GetDatabase
OCI_EXPORT const otext *OCI_API OCI_GetDatabase(OCI_Connection *con)
Return the name of the connected database/service name.
OCI_IntervalAdd
OCI_EXPORT boolean OCI_API OCI_IntervalAdd(OCI_Interval *itv, OCI_Interval *itv2)
Adds an interval handle value to another.
ocilib::Date::operator==
bool operator==(const Date &other) const
Indicates if the current date value is equal to the given date value.
Definition: ocilib_impl.hpp:2277
OCI_BindTimestamp
OCI_EXPORT boolean OCI_API OCI_BindTimestamp(OCI_Statement *stmt, const otext *name, OCI_Timestamp *data)
Bind a timestamp variable.
OCI_SetTrace
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.
ocilib::Date::GetTime
void GetTime(int &hour, int &min, int &sec) const
Extract time parts.
Definition: ocilib_impl.hpp:2156
OCI_ObjectSetDate
OCI_EXPORT boolean OCI_API OCI_ObjectSetDate(OCI_Object *obj, const otext *attr, OCI_Date *value)
Set an object attribute of type Date.
ocilib::Interval::operator<
bool operator<(const Interval &other) const
Indicates if the current Interval value is inferior to the given Interval value.
Definition: ocilib_impl.hpp:2568
ocilib::BindInfo::SetDataNull
void SetDataNull(bool value, unsigned int index=1)
Mark as null or not null the current bind real value(s) used in SQL statements.
Definition: ocilib_impl.hpp:4908
ocilib::BindInfo::GetDataCount
unsigned int GetDataCount() const
Return the number of elements associated with the bind object.
Definition: ocilib_impl.hpp:4898
ocilib::DirectPath::Prepare
void Prepare()
Prepares the OCI direct path load interface before any rows can be converted or loaded.
Definition: ocilib_impl.hpp:6992
ocilib::NumericBigInt
Definition: ocilib.hpp:312
ocilib::Date::GetDateTime
void GetDateTime(int &year, int &month, int &day, int &hour, int &min, int &sec) const
Extract the date and time parts.
Definition: ocilib_impl.hpp:2161
OCI_FetchNext
OCI_EXPORT boolean OCI_API OCI_FetchNext(OCI_Resultset *rs)
Fetch the next row of the resultset.
OCI_GetFloat
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_GetFormat
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_BindArrayOfFiles
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_MsgSetRaw
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_MsgSetConsumers
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.
ocilib::Date::operator--
Date & operator--()
Decrement the date by 1 day.
Definition: ocilib_impl.hpp:2239
OCI_RegisterNumber
OCI_EXPORT boolean OCI_API OCI_RegisterNumber(OCI_Statement *stmt, const otext *name)
Register a register output bind placeholder.
OCI_QueueTableMigrate
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_ObjectSetTimestamp
OCI_EXPORT boolean OCI_API OCI_ObjectSetTimestamp(OCI_Object *obj, const otext *attr, OCI_Timestamp *value)
Set an object attribute of type Timestamp.
ocilib::Environment::GetRuntimeRevisionVersion
static unsigned int GetRuntimeRevisionVersion()
Return the revision version number of OCI used at runtime.
Definition: ocilib_impl.hpp:1046
OCI_RegisterLob
OCI_EXPORT boolean OCI_API OCI_RegisterLob(OCI_Statement *stmt, const otext *name, unsigned int type)
Register a lob output bind placeholder.
OCI_ThreadFree
OCI_EXPORT boolean OCI_API OCI_ThreadFree(OCI_Thread *thread)
Destroy a thread object.
ocilib::QueueTable::Drop
static void Drop(const Connection &connection, const ostring &table, bool force=true)
Drop the given queue table.
Definition: ocilib_impl.hpp:7139
ocilib::Dequeue::GetMode
DequeueMode GetMode() const
Get the dequeuing/locking behavior.
Definition: ocilib_impl.hpp:6910
OCI_TimestampIntervalAdd
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_ObjectGetDate
OCI_EXPORT OCI_Date *OCI_API OCI_ObjectGetDate(OCI_Object *obj, const otext *attr)
Return the date value of the given object attribute.
OCI_BindArrayOfStrings
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_ObjectGetSelfRef
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...
ocilib::Connection::IsTAFCapable
bool IsTAFCapable() const
Verify if the connection support TAF events.
Definition: ocilib_impl.hpp:1632
ocilib::Long::Write
unsigned int Write(const T &content)
Write the given string into the long Object.
Definition: ocilib_impl.hpp:4445
ocilib::Message::SetOriginalID
void SetOriginalID(const Raw &value)
Set the original ID of the message in the last queue that generated this message. ...
Definition: ocilib_impl.hpp:6719
ocilib::Lob::GetLength
big_uint GetLength() const
Returns the number of characters or bytes contained in the lob.
Definition: ocilib_impl.hpp:3108
OCI_PoolFree
OCI_EXPORT boolean OCI_API OCI_PoolFree(OCI_Pool *pool)
Destroy a pool object.
ocilib::Message::GetCorrelation
ostring GetCorrelation() const
Get the correlation identifier of the message.
Definition: ocilib_impl.hpp:6731
OCI_ElemSetNumber
OCI_EXPORT boolean OCI_API OCI_ElemSetNumber(OCI_Elem *elem, OCI_Number *value)
Set a number value to a collection element.
OCI_CollCreate
OCI_EXPORT OCI_Coll *OCI_API OCI_CollCreate(OCI_TypeInfo *typinf)
Create a local collection instance.
ocilib::Statement::IsRebindingAllowed
bool IsRebindingAllowed() const
Indicate if rebinding is allowed on the statement.
Definition: ocilib_impl.hpp:5093
ocilib::NumericDouble
Definition: ocilib.hpp:320
OCI_GetFetchSize
OCI_EXPORT unsigned int OCI_API OCI_GetFetchSize(OCI_Statement *stmt)
Return the number of rows fetched per internal server fetch call.
ocilib::Subscription::GetConnection
Connection GetConnection() const
Return the connection associated with a subscription handle.
Definition: ocilib_impl.hpp:6518
ocilib::Timestamp::SetMonth
void SetMonth(int value)
Set the timestamp month value.
Definition: ocilib_impl.hpp:2671
OCI_ColumnGetNullable
OCI_EXPORT boolean OCI_API OCI_ColumnGetNullable(OCI_Column *col)
Return the nullable attribute of the column.
OCI_FileGetName
OCI_EXPORT const otext *OCI_API OCI_FileGetName(OCI_File *file)
Return the name of the given file.
OCI_GetStatementType
OCI_EXPORT unsigned int OCI_API OCI_GetStatementType(OCI_Statement *stmt)
Return the type of a SQL statement.
OCI_QueueCreate
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_GetRaw
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_FileSeek
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.
ocilib::Resultset::operator+=
bool operator+=(int offset)
Convenient operator overloading that performs a call to Seek() with Resultset::SeekRelative and the g...
Definition: ocilib_impl.hpp:6018
OCI_SetAutoCommit
OCI_EXPORT boolean OCI_API OCI_SetAutoCommit(OCI_Connection *con, boolean enable)
Enable / disable auto commit mode.
OCI_LobIsTemporary
OCI_EXPORT boolean OCI_API OCI_LobIsTemporary(OCI_Lob *lob)
Check if the given lob is a temporary lob.
OCI_DirPathSetColumn
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_NumberSetValue
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_DirPathSetNoLog
OCI_EXPORT boolean OCI_API OCI_DirPathSetNoLog(OCI_DirPath *dp, boolean value)
Set the logging mode for the loading operation.
OCI_IsConnected
OCI_EXPORT boolean OCI_API OCI_IsConnected(OCI_Connection *con)
Returns TRUE is the given connection is still connected otherwise FALSE.
ocilib::Environment::SetHAHandler
static void SetHAHandler(HAHandlerProc handler)
Set the High availability (HA) user handler.
Definition: ocilib_impl.hpp:1085
OCI_QueueTableCreate
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_GetBind2
OCI_EXPORT OCI_Bind *OCI_API OCI_GetBind2(OCI_Statement *stmt, const otext *name)
Return a bind handle from its name.
OCI_Prepare
OCI_EXPORT boolean OCI_API OCI_Prepare(OCI_Statement *stmt, const otext *sql)
Prepare a SQL statement or PL/SQL block.
OCI_DequeueSetAgentList
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_PoolSetTimeout
OCI_EXPORT boolean OCI_API OCI_PoolSetTimeout(OCI_Pool *pool, unsigned int value)
Set the connections/sessions idle timeout.
ocilib::Timestamp::SetDate
void SetDate(int year, int month, int day)
Set the date part.
Definition: ocilib_impl.hpp:2779
OCI_GetFile
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_DateSetDateTime
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.
ocilib::Pool::GetConnection
Connection GetConnection(const ostring &sessionTag=OTEXT(""))
Get a connection from the pool.
Definition: ocilib_impl.hpp:1337
OCI_ObjectSetInt
OCI_EXPORT boolean OCI_API OCI_ObjectSetInt(OCI_Object *obj, const otext *attr, int value)
Set an object attribute of type int.
ocilib::Connection::GetSessionTag
ostring GetSessionTag() const
Return the tag associated with the given connection.
Definition: ocilib_impl.hpp:1507
OCI_LobGetLength
OCI_EXPORT big_uint OCI_API OCI_LobGetLength(OCI_Lob *lob)
Return the actual length of a lob.
OCI_GetServerMajorVersion
OCI_EXPORT unsigned int OCI_API OCI_GetServerMajorVersion(OCI_Connection *con)
Return the major version number of the connected database server.
OCI_DirPathSetEntry
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_ElemGetLob
OCI_EXPORT OCI_Lob *OCI_API OCI_ElemGetLob(OCI_Elem *elem)
Return the Lob value of the given collection element.
ocilib::File::operator!=
bool operator!=(const File &other) const
Indicates if the current file value is not equal the given file value.
Definition: ocilib_impl.hpp:3306
OCI_LobEnableBuffering
OCI_EXPORT boolean OCI_API OCI_LobEnableBuffering(OCI_Lob *lob, boolean value)
Enable / disable buffering mode on the given lob handle.
OCI_GetStatementCacheSize
OCI_EXPORT unsigned int OCI_API OCI_GetStatementCacheSize(OCI_Connection *con)
Return the maximum number of statements to keep in the statement cache.
ocilib::Message::SetConsumers
void SetConsumers(std::vector< Agent > &agents)
Set the recipient list of a message to enqueue.
Definition: ocilib_impl.hpp:6761
OCI_SetTransaction
OCI_EXPORT boolean OCI_API OCI_SetTransaction(OCI_Connection *con, OCI_Transaction *trans)
Set a transaction to a connection.
OCI_CollTrim
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.
ocilib::Connection::Open
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.
Definition: ocilib_impl.hpp:1416
OCI_RefFree
OCI_EXPORT boolean OCI_API OCI_RefFree(OCI_Ref *ref)
Free a local Ref.
OCI_GetTransaction
OCI_EXPORT OCI_Transaction *OCI_API OCI_GetTransaction(OCI_Connection *con)
Return the current transaction of the connection.
ocilib::Connection::GetUserData
AnyPointer GetUserData()
Return the pointer to user data previously associated with the connection.
Definition: ocilib_impl.hpp:1644
ocilib::Statement::SetLongMode
void SetLongMode(LongMode value)
Set the long data type handling mode of a SQL statement.
Definition: ocilib_impl.hpp:5808
OCI_DateNextDay
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_Rollback
OCI_EXPORT boolean OCI_API OCI_Rollback(OCI_Connection *con)
Cancel current pending changes.
ocilib::HandleHolder
Template class providing OCILIB handles auto memory, life cycle and scope management.
Definition: ocilib_core.hpp:144
OCI_ObjectGetTypeInfo
OCI_EXPORT OCI_TypeInfo *OCI_API OCI_ObjectGetTypeInfo(OCI_Object *obj)
Return the type info object associated to the object.
OCI_LongGetSize
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) ...
ocilib::Lob::GetOffset
big_uint GetOffset() const
Returns the current R/W offset within the lob.
Definition: ocilib_impl.hpp:3102
OCI_FileOpen
OCI_EXPORT boolean OCI_API OCI_FileOpen(OCI_File *file)
Open a file for reading.
OCI_FetchSeek
OCI_EXPORT boolean OCI_API OCI_FetchSeek(OCI_Resultset *rs, unsigned int mode, int offset)
Custom Fetch of the resultset.
ocilib::Timestamp::Timestamp
Timestamp()
Create an empty null timestamp instance.
Definition: ocilib_impl.hpp:2591
OCI_IntervalGetYearMonth
OCI_EXPORT boolean OCI_API OCI_IntervalGetYearMonth(OCI_Interval *itv, int *year, int *month)
Return the year / month portion of an interval handle.
ocilib::Collection::Collection
Collection()
Create an empty null Collection instance.
Definition: ocilib_impl.hpp:3774
OCI_IntervalSetDaySecond
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.
ocilib::Pool::Pool
Pool()
Default constructor.
Definition: ocilib_impl.hpp:1312
ocilib::Statement::Prepare
void Prepare(const ostring &sql)
Prepare a SQL statement or PL/SQL block.
Definition: ocilib_impl.hpp:4972
ocilib::Flags
Template Flags template class providing some type safety to some extends for manipulating flags set v...
Definition: ocilib_core.hpp:181
OCI_ElemSetColl
OCI_EXPORT boolean OCI_API OCI_ElemSetColl(OCI_Elem *elem, OCI_Coll *value)
Assign a Collection handle to a collection element.
OCI_DequeueGetVisibility
OCI_EXPORT unsigned int OCI_API OCI_DequeueGetVisibility(OCI_Dequeue *dequeue)
Get the dequeuing/locking behavior.
OCI_ElemSetDate
OCI_EXPORT boolean OCI_API OCI_ElemSetDate(OCI_Elem *elem, OCI_Date *value)
Assign a Date handle to a collection element.
OCI_ObjectSetUnsignedShort
OCI_EXPORT boolean OCI_API OCI_ObjectSetUnsignedShort(OCI_Object *obj, const otext *attr, unsigned short value)
Set an object attribute of type unsigned short.
ocilib::Timestamp::GetTime
void GetTime(int &hour, int &min, int &sec, int &fsec) const
Extract time parts.
Definition: ocilib_impl.hpp:2769
OCI_GetDataLength
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.
ocilib::Interval::SetDay
void SetDay(int value)
Set the interval day value.
Definition: ocilib_impl.hpp:2403
ocilib::Date::Clone
Date Clone() const
Clone the current instance to a new one performing deep copy.
Definition: ocilib_impl.hpp:2008
OCI_RegisterString
OCI_EXPORT boolean OCI_API OCI_RegisterString(OCI_Statement *stmt, const otext *name, unsigned int len)
Register a string output bind placeholder.
OCI_RegisterShort
OCI_EXPORT boolean OCI_API OCI_RegisterShort(OCI_Statement *stmt, const otext *name)
Register a short output bind placeholder.
ocilib::Connection::Commit
void Commit()
Commit current pending changes.
Definition: ocilib_impl.hpp:1427
ocilib::ThreadHandle
OCI_Thread * ThreadHandle
Alias for an OCI_Thread pointer.
Definition: ocilib.hpp:196
OCI_ElemGetObject
OCI_EXPORT OCI_Object *OCI_API OCI_ElemGetObject(OCI_Elem *elem)
Return the object value of the given collection element.
OCI_GetSQLCommand
OCI_EXPORT unsigned int OCI_API OCI_GetSQLCommand(OCI_Statement *stmt)
Return the Oracle SQL code the command held by the statement handle.
OCI_DirPathGetRowCount
OCI_EXPORT unsigned int OCI_API OCI_DirPathGetRowCount(OCI_DirPath *dp)
Return the number of rows successfully loaded into the database so far.
ocilib::Pool::GetMinSize
unsigned int GetMinSize() const
Return the minimum number of connections/sessions that can be opened to the database.
Definition: ocilib_impl.hpp:1372
ocilib::Connection::SetFormat
bool SetFormat(FormatType formatType, const ostring &format)
Set the format string for implicit string conversions of the given type.
Definition: ocilib_impl.hpp:1527
ocilib::Connection::Break
void Break()
Perform an immediate abort of any currently Oracle OCI call on the given connection.
Definition: ocilib_impl.hpp:1437
OCI_TimestampAssign
OCI_EXPORT boolean OCI_API OCI_TimestampAssign(OCI_Timestamp *tmsp, OCI_Timestamp *tmsp_src)
Assign the value of a timestamp handle to another one.
ocilib::Environment::StartDatabase
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.
Definition: ocilib_impl.hpp:1066
ocilib::Collection::GetMax
unsigned int GetMax() const
Returns the maximum number of elements for the collection.
Definition: ocilib_impl.hpp:3813
OCI_DirPathSetConvertMode
OCI_EXPORT boolean OCI_API OCI_DirPathSetConvertMode(OCI_DirPath *dp, unsigned int mode)
Set the direct path conversion mode.
ocilib::Dequeue::Unsubscribe
void Unsubscribe()
Unsubscribe for asynchronous messages notifications.
Definition: ocilib_impl.hpp:6962
OCI_ColumnGetFractionalPrecision
OCI_EXPORT int OCI_API OCI_ColumnGetFractionalPrecision(OCI_Column *col)
Return the fractional precision of the column for timestamp and interval columns. ...
ocilib::Timestamp::SetYear
void SetYear(int value)
Set the timestamp year value.
Definition: ocilib_impl.hpp:2654
OCI_GetPrefetchMemory
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_SetPrefetchSize
OCI_EXPORT boolean OCI_API OCI_SetPrefetchSize(OCI_Statement *stmt, unsigned int size)
Set the number of rows pre-fetched by OCI Client.
OCI_DequeueGetRelativeMsgID
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_DirPathSetParallel
OCI_EXPORT boolean OCI_API OCI_DirPathSetParallel(OCI_DirPath *dp, boolean value)
Set the parallel loading mode.
OCI_DequeueSetCorrelation
OCI_EXPORT boolean OCI_API OCI_DequeueSetCorrelation(OCI_Dequeue *dequeue, const otext *pattern)
set the correlation identifier of the message to be dequeued
OCI_NumberAssign
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_BindArrayOfRefs
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_QueueAlter
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.
ocilib::Raw
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
Definition: ocilib.hpp:178
OCI_DequeueCreate
OCI_EXPORT OCI_Dequeue *OCI_API OCI_DequeueCreate(OCI_TypeInfo *typinf, const otext *name)
Create a Dequeue object for the given queue.
OCI_GetBatchError
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.
ocilib::TypeInfo::GetName
ostring GetName() const
Return the type info name.
Definition: ocilib_impl.hpp:3330
ocilib::Date::operator-
Date operator-(int value) const
Return a new date holding the current date value decremented by the given number of days...
Definition: ocilib_impl.hpp:2259
OCI_GetNextResultset
OCI_EXPORT OCI_Resultset *OCI_API OCI_GetNextResultset(OCI_Statement *stmt)
Retrieve the next available resultset.
OCI_TransactionGetTimeout
OCI_EXPORT unsigned int OCI_API OCI_TransactionGetTimeout(OCI_Transaction *trans)
Return global transaction Timeout.
OCI_ElemSetInt
OCI_EXPORT boolean OCI_API OCI_ElemSetInt(OCI_Elem *elem, int value)
Set a int value to a collection element.
OCI_LongFree
OCI_EXPORT boolean OCI_API OCI_LongFree(OCI_Long *lg)
Free a local temporary long.
OCI_Long
struct OCI_Long OCI_Long
Oracle Long data type.
Definition: ocilib.h:559
OCI_ElemGetDouble
OCI_EXPORT double OCI_API OCI_ElemGetDouble(OCI_Elem *elem)
Return the Double value of the given collection element.
ocilib::Statement::Statement
Statement()
Create an empty null Statement instance.
Definition: ocilib_impl.hpp:4939
ocilib::Connection::GetDomain
ostring GetDomain() const
Return the Oracle server Domain name of the connected database/service name.
Definition: ocilib_impl.hpp:1597
ocilib::Message::GetSender
Agent GetSender() const
Return the original sender of the message.
Definition: ocilib_impl.hpp:6751
OCI_RegisterRef
OCI_EXPORT boolean OCI_API OCI_RegisterRef(OCI_Statement *stmt, const otext *name, OCI_TypeInfo *typinf)
Register a Ref output bind placeholder.
OCI_TimestampToText
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.
ocilib::Timestamp::GetMilliSeconds
int GetMilliSeconds() const
Return the timestamp seconds value.
Definition: ocilib_impl.hpp:2747
OCI_GetShort
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. ...
ocilib::Dequeue::SetWaitTime
void SetWaitTime(int value)
Set the time that Get() waits for messages if no messages are currently available.
Definition: ocilib_impl.hpp:6935
ocilib::Message::GetID
Raw GetID() const
Return the ID of the message.
Definition: ocilib_impl.hpp:6667
ocilib::Collection::end
iterator end()
Returns an iterator referring to the past-the-end element in the collection.
Definition: ocilib_impl.hpp:3875
ocilib::TypeInfo
Provides type information on Oracle Database objects.
Definition: ocilib.hpp:4523
OCI_SetPrefetchMemory
OCI_EXPORT boolean OCI_API OCI_SetPrefetchMemory(OCI_Statement *stmt, unsigned int size)
Set the amount of memory pre-fetched by OCI Client.
OCI_TypeInfoGetColumn
OCI_EXPORT OCI_Column *OCI_API OCI_TypeInfoGetColumn(OCI_TypeInfo *typinf, unsigned int index)
Return the column object handle at the given index in the table.
ocilib::File::GetName
ostring GetName() const
Return the file name.
Definition: ocilib_impl.hpp:3276
OCI_GetNumber
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_EventGetRowid
OCI_EXPORT const otext *OCI_API OCI_EventGetRowid(OCI_Event *event)
Return the rowid of the altered database object row.
OCI_TypeInfo
struct OCI_TypeInfo OCI_TypeInfo
Type info metadata handle.
Definition: ocilib.h:665
ocilib::Enqueue::GetVisibility
EnqueueVisibility GetVisibility() const
Get the enqueuing/locking behavior.
Definition: ocilib_impl.hpp:6790
OCI_DirPathGetErrorRow
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_ObjectGetBoolean
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)
ocilib::TypeInfo::GetType
TypeInfoType GetType() const
Return the type of the given TypeInfo object.
Definition: ocilib_impl.hpp:3325
ocilib::Connection::Rollback
void Rollback()
Cancel current pending changes.
Definition: ocilib_impl.hpp:1432
ocilib::DirectPath::SetCurrentRows
void SetCurrentRows(unsigned int value)
Set the current number of rows to convert and load.
Definition: ocilib_impl.hpp:7027
OCI_ElemGetString
OCI_EXPORT const otext *OCI_API OCI_ElemGetString(OCI_Elem *elem)
Return the String value of the given collection element.
ocilib::Column::GetSQLType
ostring GetSQLType() const
Return the Oracle SQL type name of the column data type.
Definition: ocilib_impl.hpp:6388
OCI_GetServiceName
OCI_EXPORT const otext *OCI_API OCI_GetServiceName(OCI_Connection *con)
Return the Oracle server service name of the connected database/service name.
OCI_MsgGetObject
OCI_EXPORT OCI_Object *OCI_API OCI_MsgGetObject(OCI_Msg *msg)
Get the object payload of the given message.
ocilib::BindResolverType
Resolve a bind input / output types.
Definition: ocilib_impl.hpp:68
ocilib::TypeInfo::GetColumnCount
unsigned int GetColumnCount() const
Return the number of columns contained in the type.
Definition: ocilib_impl.hpp:3340
OCI_BindShort
OCI_EXPORT boolean OCI_API OCI_BindShort(OCI_Statement *stmt, const otext *name, short *data)
Bind an short variable.
OCI_ElemSetDouble
OCI_EXPORT boolean OCI_API OCI_ElemSetDouble(OCI_Elem *elem, double value)
Set a double value to a collection element.
OCI_DequeueGetConsumer
OCI_EXPORT const otext *OCI_API OCI_DequeueGetConsumer(OCI_Dequeue *dequeue)
Get the current consumer name associated with the dequeuing process.
ocilib::DirectPath::Load
DirectPath::Result Load()
Loads the data converted to direct path stream format.
Definition: ocilib_impl.hpp:7002
ocilib::Message::GetEnqueueDelay
int GetEnqueueDelay() const
Return the number of seconds that a message is delayed for dequeuing.
Definition: ocilib_impl.hpp:6688
ocilib::Interval::IntervalTypeValues
IntervalTypeValues
Interval types enumerated values.
Definition: ocilib.hpp:3130
OCI_ElemSetObject
OCI_EXPORT boolean OCI_API OCI_ElemSetObject(OCI_Elem *elem, OCI_Object *value)
Assign an Object handle to a collection element.
OCI_GetUnsignedInt
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_RefIsNull
OCI_EXPORT boolean OCI_API OCI_RefIsNull(OCI_Ref *ref)
Check if the Ref points to an object or not.
ocilib::NumericShort
Definition: ocilib.hpp:308
ocilib::Pool::GetBusyConnectionsCount
unsigned int GetBusyConnectionsCount() const
Return the current number of busy connections/sessions.
Definition: ocilib_impl.hpp:1362
OCI_GetOCIRuntimeVersion
OCI_EXPORT unsigned int OCI_API OCI_GetOCIRuntimeVersion(void)
Return the version of OCI used at runtime.
OCI_BindFloat
OCI_EXPORT boolean OCI_API OCI_BindFloat(OCI_Statement *stmt, const otext *name, float *data)
Bind a float variable.
OCI_IsNull2
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.
ocilib::Statement::SetPrefetchSize
void SetPrefetchSize(unsigned int value)
Set the number of rows pre-fetched by OCI Client.
Definition: ocilib_impl.hpp:5778
OCI_TimestampGetDate
OCI_EXPORT boolean OCI_API OCI_TimestampGetDate(OCI_Timestamp *tmsp, int *year, int *month, int *day)
Extract the date part from a timestamp handle.
ocilib::Thread::ThreadProc
POCI_THREAD ThreadProc
Thread callback.
Definition: ocilib.hpp:1266
ocilib::BindInfo::IsDataNull
bool IsDataNull(unsigned int index=1) const
Check if the current bind value(s) used in SQL statements is marked as NULL.
Definition: ocilib_impl.hpp:4920
ocilib::Date::operator-=
Date & operator-=(int value)
Decrement the date by the given number of days.
Definition: ocilib_impl.hpp:2271
OCI_DequeueSetMode
OCI_EXPORT boolean OCI_API OCI_DequeueSetMode(OCI_Dequeue *dequeue, unsigned int mode)
Set the dequeuing/locking behavior.
ocilib::Statement::GetNextResultset
Resultset GetNextResultset()
Retrieve the next available resultset.
Definition: ocilib_impl.hpp:5073
ocilib::Environment::ShutdownFlagsValues
ShutdownFlagsValues
Oracle instance shutdown flags enumerated values.
Definition: ocilib.hpp:851
OCI_LobGetMaxSize
OCI_EXPORT big_uint OCI_API OCI_LobGetMaxSize(OCI_Lob *lob)
Return the maximum size that the lob can contain.
OCI_ElemGetInt
OCI_EXPORT int OCI_API OCI_ElemGetInt(OCI_Elem *elem)
Return the int value of the given collection element.
ocilib::Connection::GetDefaultLobPrefetchSize
unsigned int GetDefaultLobPrefetchSize() const
Return the default LOB prefetch buffer size for the connection.
Definition: ocilib_impl.hpp:1617
OCI_FileClose
OCI_EXPORT boolean OCI_API OCI_FileClose(OCI_File *file)
Close a file.
OCI_DirPathPrepare
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_LongGetBuffer
OCI_EXPORT void *OCI_API OCI_LongGetBuffer(OCI_Long *lg)
Return the internal buffer of an OCI_Long object read from a fetch sequence.
OCI_TypeInfoGetType
OCI_EXPORT unsigned int OCI_API OCI_TypeInfoGetType(OCI_TypeInfo *typinf)
Return the type of the type info object.
ocilib::Subscription::Watch
void Watch(const ostring &sql)
Add a SQL query to monitor.
Definition: ocilib_impl.hpp:6494
ocilib::Exception::GetStatement
Statement GetStatement() const
Return the statement within the error occurred.
Definition: ocilib_impl.hpp:957
ocilib::Connection::GetServerVersion
ostring GetServerVersion() const
Return the connected database server string version.
Definition: ocilib_impl.hpp:1482
OCI_SetFetchSize
OCI_EXPORT boolean OCI_API OCI_SetFetchSize(OCI_Statement *stmt, unsigned int size)
Set the number of rows fetched per internal server fetch call.
ocilib::Connection::GetInstance
ostring GetInstance() const
Return the Oracle server Instance name of the connected database/service name.
Definition: ocilib_impl.hpp:1582
ocilib::Column::GetFractionalPrecision
int GetFractionalPrecision() const
Return the fractional precision of the column for Timestamp and Interval columns. ...
Definition: ocilib_impl.hpp:6434
OCI_DirPathGetMaxRows
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_EnqueueGetSequenceDeviation
OCI_EXPORT unsigned int OCI_API OCI_EnqueueGetSequenceDeviation(OCI_Enqueue *enqueue)
Return the sequence deviation of messages to enqueue to the queue.
ocilib::Number::Number
Number(bool create=false)
Create an empty null number object.
Definition: ocilib_impl.hpp:1707
ocilib::Connection::EnableServerOutput
void EnableServerOutput(unsigned int bufsize, unsigned int arrsize, unsigned int lnsize)
Enable the server output.
Definition: ocilib_impl.hpp:1537
OCI_DequeueGet
OCI_EXPORT OCI_Msg *OCI_API OCI_DequeueGet(OCI_Dequeue *dequeue)
Dequeue messages from the given queue.
OCI_AgentCreate
OCI_EXPORT OCI_Agent *OCI_API OCI_AgentCreate(OCI_Connection *con, const otext *name, const otext *address)
Create an AQ agent object.
OCI_GetBindMode
OCI_EXPORT unsigned int OCI_API OCI_GetBindMode(OCI_Statement *stmt)
Return the binding mode of a SQL statement.
OCI_ObjectGetBigInt
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_TimestampSysTimestamp
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...
ocilib::File::Seek
bool Seek(SeekMode seekMode, big_uint offset)
Move the current position within the file for read/write operations.
Definition: ocilib_impl.hpp:3232
ocilib::DirectPath::Abort
void Abort()
Terminate a direct path operation without committing changes.
Definition: ocilib_impl.hpp:7012
OCI_CollGetType
OCI_EXPORT unsigned int OCI_API OCI_CollGetType(OCI_Coll *coll)
Return the collection type.
ocilib::Date::operator+=
Date & operator+=(int value)
Increment the date by the given number of days.
Definition: ocilib_impl.hpp:2265
OCI_CollToText
OCI_EXPORT boolean OCI_API OCI_CollToText(OCI_Coll *coll, unsigned int *size, otext *str)
Convert a collection handle value to a string.
OCI_SetSessionTag
OCI_EXPORT boolean OCI_API OCI_SetSessionTag(OCI_Connection *con, const otext *tag)
Associate a tag to the given connection/session.
OCI_BindIsNullAtPos
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_MsgSetExpiration
OCI_EXPORT boolean OCI_API OCI_MsgSetExpiration(OCI_Msg *msg, int value)
set the duration that the message is available for dequeuing
OCI_TimestampGetType
OCI_EXPORT unsigned int OCI_API OCI_TimestampGetType(OCI_Timestamp *tmsp)
Return the type of the given Timestamp object.
OCI_IntervalFromText
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.
ocilib::Message::SetSender
void SetSender(const Agent &agent)
Set the original sender of the message.
Definition: ocilib_impl.hpp:6756
ocilib::Timestamp::SetTime
void SetTime(int hour, int min, int sec, int fsec)
Set the time part.
Definition: ocilib_impl.hpp:2787
ocilib::MakeString
ostring MakeString(const otext *result, int size=-1)
Internal usage. Constructs a C++ string object from the given OCILIB string pointer.
Definition: ocilib_impl.hpp:136
ocilib::NClob
Lob< ostring, LobNationalCharacter > NClob
Class handling NCLOB oracle type.
Definition: ocilib.hpp:4313
ocilib::Collection::IsElementNull
bool IsElementNull(unsigned int index) const
check if the element at the given index is null
Definition: ocilib_impl.hpp:3845
ocilib::Dequeue::GetCorrelation
ostring GetCorrelation() const
Get the correlation identifier of the message to be dequeued.
Definition: ocilib_impl.hpp:6867
OCI_TimestampCreate
OCI_EXPORT OCI_Timestamp *OCI_API OCI_TimestampCreate(OCI_Connection *con, unsigned int type)
Create a local Timestamp instance.
OCI_ObjectSetInterval
OCI_EXPORT boolean OCI_API OCI_ObjectSetInterval(OCI_Object *obj, const otext *attr, OCI_Interval *value)
Set an object attribute of type Interval.
ocilib::Mutex::Acquire
static void Acquire(MutexHandle handle)
Acquire a mutex lock.
Definition: ocilib_impl.hpp:1250
OCI_SetStatementCacheSize
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_ObjectSetBoolean
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)
ocilib::Reference::SetReferenceNull
void SetReferenceNull()
Nullify the given Ref handle.
Definition: ocilib_impl.hpp:3748
ocilib::Environment::GetAllocatedBytes
static big_uint GetAllocatedBytes(AllocatedBytesFlags type)
Return the current number of bytes allocated internally in the library.
Definition: ocilib_impl.hpp:1001
OCI_ThreadCreate
OCI_EXPORT OCI_Thread *OCI_API OCI_ThreadCreate(void)
Create a Thread object.
ocilib::DirectPath::SetParallel
void SetParallel(bool value)
Set the parallel loading mode.
Definition: ocilib_impl.hpp:7057
OCI_SetFormat
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.
ocilib::Statement::GetSQLVerb
ostring GetSQLVerb() const
Return the verb of the SQL command held by the statement.
Definition: ocilib_impl.hpp:5823
OCI_TypeInfoGetColumnCount
OCI_EXPORT unsigned int OCI_API OCI_TypeInfoGetColumnCount(OCI_TypeInfo *typinf)
Return the number of columns of a table/view/object.
ocilib::Object::SetAttributeNull
void SetAttributeNull(const ostring &name)
Set the given object attribute to null.
Definition: ocilib_impl.hpp:3383
OCI_ObjectSetFloat
OCI_EXPORT boolean OCI_API OCI_ObjectSetFloat(OCI_Object *obj, const otext *attr, float value)
Set an object attribute of type float.
OCI_ObjectGetColl
OCI_EXPORT OCI_Coll *OCI_API OCI_ObjectGetColl(OCI_Object *obj, const otext *attr)
Return the collection value of the given object attribute.
OCI_SetLongMode
OCI_EXPORT boolean OCI_API OCI_SetLongMode(OCI_Statement *stmt, unsigned int mode)
Set the long data type handling mode of a SQL statement.
ocilib::Connection::GetService
ostring GetService() const
Return the Oracle server Service name of the connected database/service name.
Definition: ocilib_impl.hpp:1587
OCI_AgentFree
OCI_EXPORT boolean OCI_API OCI_AgentFree(OCI_Agent *agent)
Free an AQ agent object.
OCI_GetLong2
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_IntervalCheck
OCI_EXPORT int OCI_API OCI_IntervalCheck(OCI_Interval *itv)
Check if the given interval is valid.
OCI_StatementGetConnection
OCI_EXPORT OCI_Connection *OCI_API OCI_StatementGetConnection(OCI_Statement *stmt)
Return the connection handle associated with a statement handle.
OCI_QueueTableDrop
OCI_EXPORT boolean OCI_API OCI_QueueTableDrop(OCI_Connection *con, const otext *queue_table, boolean force)
Drop the given queue table.
OCI_GetTimestamp
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_BindLong
OCI_EXPORT boolean OCI_API OCI_BindLong(OCI_Statement *stmt, const otext *name, OCI_Long *data, unsigned int size)
Bind a Long variable.
OCI_GetBindCount
OCI_EXPORT unsigned int OCI_API OCI_GetBindCount(OCI_Statement *stmt)
Return the number of binds currently associated to a statement.
ocilib::Agent::SetName
void SetName(const ostring &value)
Set the given AQ agent name.
Definition: ocilib_impl.hpp:6581
OCI_DequeueListen
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_MsgSetPriority
OCI_EXPORT boolean OCI_API OCI_MsgSetPriority(OCI_Msg *msg, int value)
Set the priority of the message.
ocilib::Collection::SetElementNull
void SetElementNull(unsigned int index)
Nullify the element at the given index.
Definition: ocilib_impl.hpp:3851
OCI_MsgGetEnqueueDelay
OCI_EXPORT int OCI_API OCI_MsgGetEnqueueDelay(OCI_Msg *msg)
Return the number of seconds that a message is delayed for dequeuing.
ocilib::Lob
Object identifying the SQL data type LOB (CLOB, NCLOB and BLOB)
Definition: ocilib.hpp:4019
OCI_ColumnGetTypeInfo
OCI_EXPORT OCI_TypeInfo *OCI_API OCI_ColumnGetTypeInfo(OCI_Column *col)
Return the type information object associated to the column.
ocilib::Message::SetEnqueueDelay
void SetEnqueueDelay(int value)
set the number of seconds to delay the enqueued message
Definition: ocilib_impl.hpp:6693
OCI_PoolGetTimeout
OCI_EXPORT unsigned int OCI_API OCI_PoolGetTimeout(OCI_Pool *pool)
Get the idle timeout for connections/sessions in the pool.
OCI_RegisterTimestamp
OCI_EXPORT boolean OCI_API OCI_RegisterTimestamp(OCI_Statement *stmt, const otext *name, unsigned int type)
Register a timestamp output bind placeholder.
ocilib::Environment::Threaded
Definition: ocilib.hpp:686
OCI_ObjectGetFile
OCI_EXPORT OCI_File *OCI_API OCI_ObjectGetFile(OCI_Object *obj, const otext *attr)
Return the file value of the given object attribute.
ocilib::Lob::Append
unsigned int Append(const T &content)
Append the given content to the lob.
Definition: ocilib_impl.hpp:3061
ocilib::Connection::GetConnectionString
ostring GetConnectionString() const
Return the name of the connected database/service name.
Definition: ocilib_impl.hpp:1462
ocilib::Connection::GetServerMajorVersion
unsigned int GetServerMajorVersion() const
Return the major version number of the connected database server.
Definition: ocilib_impl.hpp:1487
ocilib::TypeInfo::TypeInfo
TypeInfo(const Connection &connection, const ostring &name, TypeInfoType type)
Parametrized constructor.
Definition: ocilib_impl.hpp:3315
OCI_ObjectGetInterval
OCI_EXPORT OCI_Interval *OCI_API OCI_ObjectGetInterval(OCI_Object *obj, const otext *attr)
Return the interval value of the given object attribute.
ocilib::Lob::Open
void Open(OpenMode mode)
Open explicitly a Lob.
Definition: ocilib_impl.hpp:3156
OCI_IntervalFree
OCI_EXPORT boolean OCI_API OCI_IntervalFree(OCI_Interval *itv)
Free an OCI_Interval handle.
ocilib::BindResolver
Internal usage. Allow resolving a native type used by C API from a C++ type in binding operations...
Definition: ocilib_core.hpp:117
OCI_DirPathSave
OCI_EXPORT boolean OCI_API OCI_DirPathSave(OCI_DirPath *dp)
Execute a data save-point (server side)
ocilib::Reference::GetObject
Object GetObject() const
Returns the object pointed by the reference.
Definition: ocilib_impl.hpp:3729
OCI_MsgSetEnqueueDelay
OCI_EXPORT boolean OCI_API OCI_MsgSetEnqueueDelay(OCI_Msg *msg, int value)
set the number of seconds to delay the enqueued message
OCI_DateGetDate
OCI_EXPORT boolean OCI_API OCI_DateGetDate(OCI_Date *date, int *year, int *month, int *day)
Extract the date part from a date handle.
ocilib::Statement::Execute
void Execute(const ostring &sql)
Prepare and execute a SQL statement or PL/SQL block.
Definition: ocilib_impl.hpp:5003
ocilib::Reference::GetTypeInfo
TypeInfo GetTypeInfo() const
Return the TypeInfo object describing the referenced object.
Definition: ocilib_impl.hpp:3724
ocilib::Pool::GetNoWait
bool GetNoWait() const
Get the waiting mode used when no more connections/sessions are available from the pool...
Definition: ocilib_impl.hpp:1352
OCI_ColumnGetSize
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetSize(OCI_Column *col)
Return the size of the column.
ocilib::Timestamp::SysTimestamp
static Timestamp SysTimestamp(TimestampType type=NoTimeZone)
return the current system timestamp
Definition: ocilib_impl.hpp:2832
ocilib::Environment::GetCharset
static Environment::CharsetMode GetCharset()
Return the OCILIB charset type.
Definition: ocilib_impl.hpp:996
OCI_TransactionStart
OCI_EXPORT boolean OCI_API OCI_TransactionStart(OCI_Transaction *trans)
Start global transaction.
ocilib::Date::GetYear
int GetYear() const
Return the date year value.
Definition: ocilib_impl.hpp:2029
ocilib::Clob
Lob< ostring, LobCharacter > Clob
Class handling CLOB oracle type.
Definition: ocilib.hpp:4302
ocilib::Date::operator>
bool operator>(const Date &other) const
Indicates if the current date value is superior to the given date value.
Definition: ocilib_impl.hpp:2287
ocilib::Message::SetExpiration
void SetExpiration(int value)
set the duration that the message is available for dequeuing
Definition: ocilib_impl.hpp:6683
ocilib::Enqueue::SetVisibility
void SetVisibility(EnqueueVisibility value)
Set whether the new message is enqueued as part of the current transaction.
Definition: ocilib_impl.hpp:6795
OCI_GetColumnIndex
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.
ocilib::Timestamp::IsValid
bool IsValid() const
Check if the given timestamp is valid.
Definition: ocilib_impl.hpp:2640
OCI_BindColl
OCI_EXPORT boolean OCI_API OCI_BindColl(OCI_Statement *stmt, const otext *name, OCI_Coll *data)
Bind a Collection variable.
ocilib::Connection::SetSessionTag
void SetSessionTag(const ostring &tag)
Associate a tag to the given connection/session.
Definition: ocilib_impl.hpp:1512
OCI_LongWrite
OCI_EXPORT unsigned int OCI_API OCI_LongWrite(OCI_Long *lg, void *buffer, unsigned int len)
Write a buffer into a Long.
OCI_Coll
struct OCI_Coll OCI_Coll
Oracle Collections (VARRAYs and Nested Tables) representation.
Definition: ocilib.h:618
OCI_QueueDrop
OCI_EXPORT boolean OCI_API OCI_QueueDrop(OCI_Connection *con, const otext *queue_name)
Drop the given queue.
ocilib::Object::Set
void Set(const ostring &name, const T &value)
Set the given object attribute value.
Definition: ocilib_impl.hpp:3682
OCI_ColumnGetPrecision
OCI_EXPORT int OCI_API OCI_ColumnGetPrecision(OCI_Column *col)
Return the precision of the column for numeric columns.
OCI_GetServerName
OCI_EXPORT const otext *OCI_API OCI_GetServerName(OCI_Connection *con)
Return the Oracle server machine name of the connected database/service name.
OCI_DequeueUnsubscribe
OCI_EXPORT boolean OCI_API OCI_DequeueUnsubscribe(OCI_Dequeue *dequeue)
Unsubscribe for asynchronous messages notifications.
OCI_TransactionStop
OCI_EXPORT boolean OCI_API OCI_TransactionStop(OCI_Transaction *trans)
Stop current global transaction.
OCI_NumberFromText
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_BindArrayOfNumbers
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_DirPathGetCurrentRows
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_MsgSetCorrelation
OCI_EXPORT boolean OCI_API OCI_MsgSetCorrelation(OCI_Msg *msg, const otext *correlation)
set the correlation identifier of the message
ocilib::Column::PropertyFlagsValues
PropertyFlagsValues
Column properties flags values.
Definition: ocilib.hpp:6783
OCI_ErrorGetRow
OCI_EXPORT unsigned int OCI_API OCI_ErrorGetRow(OCI_Error *err)
Return the row index which caused an error during statement execution.
OCI_ElemFree
OCI_EXPORT boolean OCI_API OCI_ElemFree(OCI_Elem *elem)
Free a local collection element.
OCI_AgentGetName
OCI_EXPORT const otext *OCI_API OCI_AgentGetName(OCI_Agent *agent)
Get the given AQ agent name.
OCI_DirPathCreate
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.
ocilib::Subscription::Unregister
void Unregister()
Unregister a previously registered notification.
Definition: ocilib_impl.hpp:6487
OCI_LobSeek
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_BindArrayOfObjects
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.
ocilib::Date::SetYear
void SetYear(int value)
Set the date year value.
Definition: ocilib_impl.hpp:2038
OCI_Elem
struct OCI_Elem OCI_Elem
Oracle Collection item representation.
Definition: ocilib.h:628
ocilib::Interval::Clone
Interval Clone() const
Clone the current instance to a new one performing deep copy.
Definition: ocilib_impl.hpp:2336
OCI_DirPathFlushRow
OCI_EXPORT boolean OCI_API OCI_DirPathFlushRow(OCI_DirPath *dp)
Flushes a partially loaded row from server.
OCI_ElemSetTimestamp
OCI_EXPORT boolean OCI_API OCI_ElemSetTimestamp(OCI_Elem *elem, OCI_Timestamp *value)
Assign a Timestamp handle to a collection element.
OCI_Initialize
OCI_EXPORT boolean OCI_API OCI_Initialize(POCI_ERROR err_handler, const otext *lib_path, unsigned int mode)
Initialize the library.
OCI_GetSql
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_ObjectGetNumber
OCI_EXPORT OCI_Number *OCI_API OCI_ObjectGetNumber(OCI_Object *obj, const otext *attr)
Return the number value of the given object attribute.
ocilib::Message
AQ message.
Definition: ocilib.hpp:7310
ocilib::Timestamp::operator+
Timestamp operator+(int value) const
Return a new Timestamp holding the current Timestamp value incremented by the given number of days...
Definition: ocilib_impl.hpp:2895
ocilib::Resultset
Database resultset.
Definition: ocilib.hpp:6412
OCI_GetColl2
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. ...
ocilib::DirectPath::DirectPath
DirectPath(const TypeInfo &typeInfo, unsigned int nbCols, unsigned int nbRows, const ostring &partition=OTEXT(""))
Constructor.
Definition: ocilib_impl.hpp:6971
OCI_ObjectSetString
OCI_EXPORT boolean OCI_API OCI_ObjectSetString(OCI_Object *obj, const otext *attr, const otext *value)
Set an object attribute of type string.
ocilib::Date::operator++
Date & operator++()
Increment the date by 1 day.
Definition: ocilib_impl.hpp:2225
OCI_ElemGetUnsignedBigInt
OCI_EXPORT big_uint OCI_API OCI_ElemGetUnsignedBigInt(OCI_Elem *elem)
Return the unsigned big int value of the given collection element.
OCI_PoolGetMin
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.
ocilib::Connection::PingServer
bool PingServer() const
Performs a round trip call to the server to confirm that the connection to the server is still valid...
Definition: ocilib_impl.hpp:1457
ocilib::DirectPath::SetDateFormat
void SetDateFormat(const ostring &format)
Set the default date format string for input conversion.
Definition: ocilib_impl.hpp:7052
ocilib::Reference::IsReferenceNull
bool IsReferenceNull() const
Check if the reference points to an object or not.
Definition: ocilib_impl.hpp:3743
OCI_MsgGetAttemptCount
OCI_EXPORT int OCI_API OCI_MsgGetAttemptCount(OCI_Msg *msg)
Return the number of attempts that have been made to dequeue the message.
ocilib::Connection::GetInstanceStartTime
Timestamp GetInstanceStartTime() const
Return the date and time (Timestamp) server instance start of the.
Definition: ocilib_impl.hpp:1602
ocilib::Environment::GetRuntimeMinorVersion
static unsigned int GetRuntimeMinorVersion()
Return the minor version number of OCI used at runtime.
Definition: ocilib_impl.hpp:1041
ocilib::Column::GetSize
unsigned int GetSize() const
Return the size of the column.
Definition: ocilib_impl.hpp:6419
ocilib::ostring
std::basic_string< otext, std::char_traits< otext >, std::allocator< otext > > ostring
string class wrapping the OCILIB otext * type and OTEXT() macros ( see Character sets ) ...
Definition: ocilib.hpp:160
OCI_ElemSetShort
OCI_EXPORT boolean OCI_API OCI_ElemSetShort(OCI_Elem *elem, short value)
Set a short value to a collection element.
ocilib::Dequeue::GetWaitTime
int GetWaitTime() const
Return the time that Get() waits for messages if no messages are currently available.
Definition: ocilib_impl.hpp:6930
ocilib::Message::GetEnqueueTime
Date GetEnqueueTime() const
return the time the message was enqueued
Definition: ocilib_impl.hpp:6652
ocilib::Lob::operator!=
bool operator!=(const Lob &other) const
Indicates if the current lob value is not equal the given lob value.
Definition: ocilib_impl.hpp:3193
ocilib::Lob::GetMaxSize
big_uint GetMaxSize() const
Returns the lob maximum possible size.
Definition: ocilib_impl.hpp:3114
OCI_Object
struct OCI_Object OCI_Object
Oracle Named types representation.
Definition: ocilib.h:608
OCI_BindGetDataCount
OCI_EXPORT unsigned int OCI_API OCI_BindGetDataCount(OCI_Bind *bnd)
Return the number of elements of the bind handle.
OCI_MutexCreate
OCI_EXPORT OCI_Mutex *OCI_API OCI_MutexCreate(void)
Create a Mutex object.
ocilib::Pool::GetTimeout
unsigned int GetTimeout() const
Get the idle timeout for connections/sessions in the pool.
Definition: ocilib_impl.hpp:1342
OCI_LongCreate
OCI_EXPORT OCI_Long *OCI_API OCI_LongCreate(OCI_Statement *stmt, unsigned int type)
Create a local temporary Long instance.
OCI_IntervalAssign
OCI_EXPORT boolean OCI_API OCI_IntervalAssign(OCI_Interval *itv, OCI_Interval *itv_src)
Assign the value of a interval handle to another one.
ocilib::Environment::StartModeValues
StartModeValues
Oracle instance start modes enumerated values.
Definition: ocilib.hpp:775
OCI_IntervalCompare
OCI_EXPORT int OCI_API OCI_IntervalCompare(OCI_Interval *itv, OCI_Interval *itv2)
Compares two interval handles.
OCI_BindArrayOfBigInts
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.
ocilib::Interval::IsValid
bool IsValid() const
Check if the given interval is valid.
Definition: ocilib_impl.hpp:2355
OCI_ElemGetTimestamp
OCI_EXPORT OCI_Timestamp *OCI_API OCI_ElemGetTimestamp(OCI_Elem *elem)
Return the Timestamp value of the given collection element.
ocilib::Environment::GetRuntimeMajorVersion
static unsigned int GetRuntimeMajorVersion()
Return the major version number of OCI used at runtime.
Definition: ocilib_impl.hpp:1036
ocilib::Timestamp::GetDay
int GetDay() const
Return the timestamp day value.
Definition: ocilib_impl.hpp:2679
ocilib::Interval::SetSeconds
void SetSeconds(int value)
Set the interval seconds value.
Definition: ocilib_impl.hpp:2454
ocilib::Connection::GetAutoCommit
bool GetAutoCommit() const
Indicates if auto commit is currently activated.
Definition: ocilib_impl.hpp:1447
ocilib::Message::GetAttemptCount
int GetAttemptCount() const
Return the number of attempts that have been made to dequeue the message.
Definition: ocilib_impl.hpp:6657
ocilib::Resultset::Seek
bool Seek(SeekMode mode, int offset)
Custom Fetch of the resultset.
Definition: ocilib_impl.hpp:5958
OCI_Column
struct OCI_Column OCI_Column
Oracle SQL Column and Type member representation.
Definition: ocilib.h:474
ocilib::Dequeue::GetRelativeMsgID
Raw GetRelativeMsgID() const
Get the message identifier of the message to be dequeued.
Definition: ocilib_impl.hpp:6877
ocilib::Statement::GetPrefetchSize
unsigned int GetPrefetchSize() const
Return the number of rows pre-fetched by OCI Client.
Definition: ocilib_impl.hpp:5783
OCI_GetDefaultLobPrefetchSize
OCI_EXPORT unsigned int OCI_API OCI_GetDefaultLobPrefetchSize(OCI_Connection *con)
Return the default LOB prefetch buffer size for the connection.
ocilib::File::IsOpened
bool IsOpened() const
Check if the specified file is currently opened on the server by our object.
Definition: ocilib_impl.hpp:3291
OCI_LobFree
OCI_EXPORT boolean OCI_API OCI_LobFree(OCI_Lob *lob)
Free a local temporary lob.
OCI_ColumnGetType
OCI_EXPORT unsigned int OCI_API OCI_ColumnGetType(OCI_Column *col)
Return the type of the given column.
ocilib::Environment::SetFormat
static bool SetFormat(FormatType formatType, const ostring &format)
Set the format string for implicit string conversions of the given type.
Definition: ocilib_impl.hpp:1056
ocilib::Date::AddMonths
void AddMonths(int months)
Add or subtract months.
Definition: ocilib_impl.hpp:2171
ocilib::Connection::GetServerOutput
bool GetServerOutput(ostring &line) const
Retrieve one line of the server buffer.
Definition: ocilib_impl.hpp:1547
ocilib::Object::GetType
ObjectType GetType() const
Return the type of the given object.
Definition: ocilib_impl.hpp:3405
OCI_GetObject
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_TimestampGetTimeZoneOffset
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.
ocilib::Object::ToString
ostring ToString() const
return a string representation of the current object
Definition: ocilib_impl.hpp:3687
ocilib::Message::GetExpiration
int GetExpiration() const
Return the duration that the message is available for dequeuing.
Definition: ocilib_impl.hpp:6678
OCI_EnqueuePut
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_TransactionResume
OCI_EXPORT boolean OCI_API OCI_TransactionResume(OCI_Transaction *trans)
Resume a stopped global transaction.
OCI_GetSqlErrorPos
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...
ocilib::Column::GetType
DataType GetType() const
Return the type of the given column.
Definition: ocilib_impl.hpp:6404
OCI_QueueStop
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_LobAppendLob
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.
ocilib::Enqueue::GetMode
EnqueueMode GetMode() const
Return the enqueuing mode of messages to enqueue.
Definition: ocilib_impl.hpp:6800
ocilib::File::Close
void Close()
Close the file on the server.
Definition: ocilib_impl.hpp:3296
OCI_MsgSetExceptionQueue
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_RegisterInterval
OCI_EXPORT boolean OCI_API OCI_RegisterInterval(OCI_Statement *stmt, const otext *name, unsigned int type)
Register an interval output bind placeholder.
ocilib::File::operator==
bool operator==(const File &other) const
Indicates if the current file value is equal the given file value.
Definition: ocilib_impl.hpp:3301
OCI_Error
struct OCI_Error OCI_Error
Encapsulates an Oracle or OCILIB exception.
Definition: ocilib.h:689
ocilib::Interval::SetMonth
void SetMonth(int value)
Set the interval month value.
Definition: ocilib_impl.hpp:2386
OCI_Parse
OCI_EXPORT boolean OCI_API OCI_Parse(OCI_Statement *stmt, const otext *sql)
Parse a SQL statement or PL/SQL block.
OCI_IntervalSetYearMonth
OCI_EXPORT boolean OCI_API OCI_IntervalSetYearMonth(OCI_Interval *itv, int year, int month)
Set the year / month portion if the given Interval handle.
ocilib::Statement::GetSQLCommand
unsigned int GetSQLCommand() const
Return the Oracle SQL code the command held by the statement.
Definition: ocilib_impl.hpp:5818
OCI_ErrorGetStatement
OCI_EXPORT OCI_Statement *OCI_API OCI_ErrorGetStatement(OCI_Error *err)
Retrieve statement handle within the error occurred.
ocilib::Dequeue::SetNavigation
void SetNavigation(NavigationMode value)
Set the position of messages to be retrieved.
Definition: ocilib_impl.hpp:6925
OCI_SetFetchMode
OCI_EXPORT boolean OCI_API OCI_SetFetchMode(OCI_Statement *stmt, unsigned int mode)
Set the fetch mode of a SQL statement.
ocilib::Enqueue::SetRelativeMsgID
void SetRelativeMsgID(const Raw &value)
Set a message identifier to use for enqueuing messages using a sequence deviation.
Definition: ocilib_impl.hpp:6821
OCI_GetNumber2
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_BindArrayOfColls
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.
ocilib::Dequeue
Dequeue object for dequeuing messages into an Oracle Queue.
Definition: ocilib.hpp:7826
OCI_DirPathSetDateFormat
OCI_EXPORT boolean OCI_API OCI_DirPathSetDateFormat(OCI_DirPath *dp, const otext *format)
Set the default date format string for input conversion.
ocilib::Statement::Bind
void Bind(const ostring &name, T &value, BindInfo::BindDirection mode)
Bind an host variable.
ocilib::Transaction::GetTimeout
unsigned int GetTimeout() const
Return the transaction Timeout.
Definition: ocilib_impl.hpp:1698
ocilib::Lob::Truncate
void Truncate(big_uint length)
Truncate the lob to a shorter length.
Definition: ocilib_impl.hpp:3132
ocilib::Transaction::Transaction
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.
Definition: ocilib_impl.hpp:1658
OCI_DequeueSetRelativeMsgID
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_RegisterRaw
OCI_EXPORT boolean OCI_API OCI_RegisterRaw(OCI_Statement *stmt, const otext *name, unsigned int len)
Register an raw output bind placeholder.
OCI_DirPathFinish
OCI_EXPORT boolean OCI_API OCI_DirPathFinish(OCI_DirPath *dp)
Terminate a direct path operation and commit changes into the database.
OCI_EnqueueFree
OCI_EXPORT boolean OCI_API OCI_EnqueueFree(OCI_Enqueue *enqueue)
Free a Enqueue object.
ocilib::Resultset::First
bool First()
Fetch the first row of the resultset.
Definition: ocilib_impl.hpp:5948
ocilib::Interval::SetYearMonth
void SetYearMonth(int year, int month)
Set the Year / Month parts.
Definition: ocilib_impl.hpp:2493
OCI_RefAssign
OCI_EXPORT boolean OCI_API OCI_RefAssign(OCI_Ref *ref, OCI_Ref *ref_src)
Assign a Ref to another one.
OCI_GetTrace
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.
ocilib::Lob::Seek
bool Seek(SeekMode seekMode, big_uint offset)
Move the current position within the lob for read/write operations.
Definition: ocilib_impl.hpp:3074
OCI_MsgCreate
OCI_EXPORT OCI_Msg *OCI_API OCI_MsgCreate(OCI_TypeInfo *typinf)
Create a message object based on the given payload type.
ocilib::Timestamp::GetTimeZoneOffset
void GetTimeZoneOffset(int &hour, int &min) const
Return the time zone (hour, minute) offsets.
Definition: ocilib_impl.hpp:2822
OCI_AgentSetAddress
OCI_EXPORT boolean OCI_API OCI_AgentSetAddress(OCI_Agent *agent, const otext *address)
Set the given AQ agent address.
ocilib::Collection::Truncate
void Truncate(unsigned int size)
Trim the given number of elements from the end of the collection.
Definition: ocilib_impl.hpp:3833
ocilib::Thread::GetThreadId
static ThreadId GetThreadId(ThreadHandle handle)
Return the system Thread ID of the given thread handle.
Definition: ocilib_impl.hpp:1284
ocilib::Interval::operator==
bool operator==(const Interval &other) const
Indicates if the current Interval value is equal to the given Interval value.
Definition: ocilib_impl.hpp:2553
OCI_LobFlush
OCI_EXPORT boolean OCI_API OCI_LobFlush(OCI_Lob *lob)
Flush Lob content to the server.
ocilib::ThreadKey::Create
static void Create(const ostring &name, ThreadKeyFreeProc freeProc=nullptr)
Create a thread key object.
Definition: ocilib_impl.hpp:1293
ocilib::Lob::EnableBuffering
void EnableBuffering(bool value)
Enable / disable buffering mode on the given lob object.
Definition: ocilib_impl.hpp:3174
ocilib::Resultset::operator-=
bool operator-=(int offset)
Convenient operator overloading that performs a call to Seek() with Resultset::SeekRelative and the g...
Definition: ocilib_impl.hpp:6023
ocilib::Timestamp::GetHours
int GetHours() const
Return the timestamp hours value.
Definition: ocilib_impl.hpp:2696
ocilib::Object::Get
T Get(const ostring &name) const
Return the given object attribute value.
Definition: ocilib_impl.hpp:3543
ocilib::Environment::EnvironmentFlagsValues
EnvironmentFlagsValues
Environment Flags enumerated values.
Definition: ocilib.hpp:681
OCI_GetLob
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.
OCI_Event
struct OCI_Event OCI_Event
OCILIB encapsulation of Oracle DCN event.
Definition: ocilib.h:739
ocilib::DirectPath::FlushRow
void FlushRow()
Flushes a partially loaded row from server.
Definition: ocilib_impl.hpp:7022
OCI_BindUnsignedShort
OCI_EXPORT boolean OCI_API OCI_BindUnsignedShort(OCI_Statement *stmt, const otext *name, unsigned short *data)
Bind an unsigned short variable.
OCI_SubscriptionRegister
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_ElemGetRef
OCI_EXPORT OCI_Ref *OCI_API OCI_ElemGetRef(OCI_Elem *elem)
Return the Ref value of the given collection element.
OCI_RegisterFloat
OCI_EXPORT boolean OCI_API OCI_RegisterFloat(OCI_Statement *stmt, const otext *name)
Register a float output bind placeholder.
OCI_NumberMultiply
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_ElemSetFloat
OCI_EXPORT boolean OCI_API OCI_ElemSetFloat(OCI_Elem *elem, float value)
Set a float value to a collection element.
ocilib::Subscription
Subscription to database or objects changes.
Definition: ocilib.hpp:6959
ocilib::Event::GetDatabaseName
ostring GetDatabaseName() const
Return the name of the database that generated the event.
Definition: ocilib_impl.hpp:6542
ocilib::Message::GetOriginalID
Raw GetOriginalID() const
Return the original ID of the message in the last queue that generated this message.
Definition: ocilib_impl.hpp:6708
ocilib::Statement::GetBindMode
BindMode GetBindMode() const
Return the binding mode of a SQL statement.
Definition: ocilib_impl.hpp:5763
OCI_ObjectGetRawSize
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.
ocilib::File::GetDirectory
ostring GetDirectory() const
Return the file directory.
Definition: ocilib_impl.hpp:3281
OCI_Lob
struct OCI_Lob OCI_Lob
Oracle Internal Large objects:
Definition: ocilib.h:497
ocilib::Statement::GetLongMode
LongMode GetLongMode() const
Return the long data type handling mode of a SQL statement.
Definition: ocilib_impl.hpp:5813
OCI_BindRef
OCI_EXPORT boolean OCI_API OCI_BindRef(OCI_Statement *stmt, const otext *name, OCI_Ref *data)
Bind a Ref variable.
OCI_FileIsEqual
OCI_EXPORT boolean OCI_API OCI_FileIsEqual(OCI_File *file, OCI_File *file2)
Compare two file handle for equality.
OCI_Cleanup
OCI_EXPORT boolean OCI_API OCI_Cleanup(void)
Clean up all resources allocated by the library.
ocilib::NumericUnsignedBigInt
Definition: ocilib.hpp:318
ocilib::DirectPath::Save
void Save()
Execute a data save-point (server side)
Definition: ocilib_impl.hpp:7017
ocilib::Lob::Erase
big_uint Erase(big_uint offset, big_uint length)
Erase a portion of the lob at a given position.
Definition: ocilib_impl.hpp:3138
ocilib::Connection::TAFHandlerProc
FailoverResult(* TAFHandlerProc)(Connection &con, FailoverRequest failoverRequest, FailoverEvent failoverEvent)
User callback for TAF event notifications.
Definition: ocilib.hpp:1790
OCI_BindGetType
OCI_EXPORT unsigned int OCI_API OCI_BindGetType(OCI_Bind *bnd)
Return the OCILIB type of the given bind.
OCI_NumberCreate
OCI_EXPORT OCI_Number *OCI_API OCI_NumberCreate(OCI_Connection *con)
Create a local number object.
ocilib::Thread::Create
static ThreadHandle Create()
Create a Thread.
Definition: ocilib_impl.hpp:1264
ocilib::Connection::Connection
Connection()
Default constructor.
Definition: ocilib_impl.hpp:1401
OCI_PoolCreate
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.
ocilib::File::Exists
bool Exists() const
Check if the given file exists on server.
Definition: ocilib_impl.hpp:3266
OCI_BindNumber
OCI_EXPORT boolean OCI_API OCI_BindNumber(OCI_Statement *stmt, const otext *name, OCI_Number *data)
Bind an Number variable.
OCI_TimestampConvert
OCI_EXPORT boolean OCI_API OCI_TimestampConvert(OCI_Timestamp *tmsp, OCI_Timestamp *tmsp_src)
Convert one timestamp value from one type to another.