23 #include "ocilibcpp/types.hpp"
48 AcquireTransient(pColl,parent);
158 SetElem(elem, value);
168 SetElem(elem, value);
177 ARG_NOT_USED(parent);
183 inline short Collection<short>::GetElem(
OCI_Elem *elem, core::Handle *parent)
185 ARG_NOT_USED(parent);
191 inline unsigned short Collection<unsigned short>::GetElem(
OCI_Elem *elem, core::Handle *parent)
193 ARG_NOT_USED(parent);
199 inline int Collection<int>::GetElem(
OCI_Elem *elem, core::Handle *parent)
201 ARG_NOT_USED(parent);
207 inline unsigned int Collection<unsigned int>::GetElem(
OCI_Elem *elem, core::Handle *parent)
209 ARG_NOT_USED(parent);
215 inline big_int Collection<big_int>::GetElem(
OCI_Elem *elem, core::Handle *parent)
217 ARG_NOT_USED(parent);
223 inline big_uint Collection<big_uint>::GetElem(
OCI_Elem *elem, core::Handle *parent)
225 ARG_NOT_USED(parent);
231 inline float Collection<float>::GetElem(
OCI_Elem *elem, core::Handle *parent)
233 ARG_NOT_USED(parent);
239 inline double Collection<double>::GetElem(
OCI_Elem *elem, core::Handle *parent)
241 ARG_NOT_USED(parent);
247 inline Number Collection<Number>::GetElem(
OCI_Elem *elem, core::Handle *parent)
253 inline ostring Collection<ostring>::GetElem(
OCI_Elem *elem, core::Handle *parent)
255 ARG_NOT_USED(parent);
261 inline Raw Collection<Raw>::GetElem(
OCI_Elem *elem, core::Handle *parent)
263 ARG_NOT_USED(parent);
267 core::ManagedBuffer<unsigned char> buffer(
static_cast<size_t>(size + 1));
275 inline Date Collection<Date>::GetElem(
OCI_Elem *elem, core::Handle *parent)
281 inline Timestamp Collection<Timestamp>::GetElem(
OCI_Elem *elem, core::Handle *parent)
287 inline Interval Collection<Interval>::GetElem(
OCI_Elem *elem, core::Handle *parent)
293 inline Object Collection<Object>::GetElem(
OCI_Elem *elem, core::Handle *parent)
299 inline Reference Collection<Reference>::GetElem(
OCI_Elem *elem, core::Handle *parent)
305 inline Clob Collection<Clob>::GetElem(
OCI_Elem *elem, core::Handle *parent)
311 inline NClob Collection<NClob>::GetElem(
OCI_Elem *elem, core::Handle *parent)
316 inline Blob Collection<Blob>::GetElem(
OCI_Elem *elem, core::Handle *parent)
322 inline File Collection<File>::GetElem(
OCI_Elem *elem, core::Handle *parent)
328 T Collection<T>::GetElem(
OCI_Elem *elem, core::Handle *parent)
334 inline void Collection<bool>::SetElem(
OCI_Elem *elem,
const bool &value)
340 inline void Collection<short>::SetElem(
OCI_Elem *elem,
const short &value)
346 inline void Collection<unsigned short>::SetElem(
OCI_Elem *elem,
const unsigned short &value)
352 inline void Collection<int>::SetElem(
OCI_Elem *elem,
const int &value)
358 inline void Collection<unsigned int>::SetElem(
OCI_Elem *elem,
const unsigned int &value)
364 inline void Collection<big_int>::SetElem(
OCI_Elem *elem,
const big_int &value)
370 inline void Collection<big_uint>::SetElem(
OCI_Elem *elem,
const big_uint &value)
376 inline void Collection<float>::SetElem(
OCI_Elem *elem,
const float &value)
382 inline void Collection<double>::SetElem(
OCI_Elem *elem,
const double &value)
388 inline void Collection<Number>::SetElem(
OCI_Elem *elem,
const Number &value)
394 inline void Collection<ostring>::SetElem(
OCI_Elem *elem,
const ostring& value)
400 inline void Collection<Raw>::SetElem(
OCI_Elem *elem,
const Raw &value)
402 const AnyPointer data = value.empty() ? nullptr :
static_cast<AnyPointer>(
const_cast<Raw::value_type*
>(&value[0])) ;
408 inline void Collection<Date>::SetElem(
OCI_Elem *elem,
const Date &value)
414 inline void Collection<Timestamp>::SetElem(
OCI_Elem *elem,
const Timestamp &value)
420 inline void Collection<Interval>::SetElem(
OCI_Elem *elem,
const Interval &value)
426 inline void Collection<Object>::SetElem(
OCI_Elem *elem,
const Object &value)
432 inline void Collection<Reference>::SetElem(
OCI_Elem *elem,
const Reference &value)
438 inline void Collection<Clob>::SetElem(
OCI_Elem *elem,
const Clob &value)
444 inline void Collection<NClob>::SetElem(
OCI_Elem *elem,
const NClob &value)
450 inline void Collection<Blob>::SetElem(
OCI_Elem *elem,
const Blob &value)
456 inline void Collection<File>::SetElem(
OCI_Elem *elem,
const File &value)
462 void Collection<T>::SetElem(
OCI_Elem *elem,
const T &value)
472 unsigned int len = 0;
480 return core::MakeString(
static_cast<const otext *
>(buffer),
static_cast<int>(len));
483 return OCI_STRING_NULL;
Class used for handling transient collection value. it is used internally by the Collection<T> class:
Object identifying the SQL data types VARRAY and NESTED TABLE.
void SetElementNull(unsigned int index)
Nullify the element at the given index.
unsigned int GetCount() const
Returns the current number of elements in the collection.
CollectionElement< T > operator[](unsigned int index)
Returns the element at a given position in the collection.
Collection Clone() const
Clone the current instance to a new one performing deep copy.
iterator end()
Returns an iterator referring to the past-the-end element in the collection.
ostring ToString() const override
return a string representation of the current collection
unsigned int GetSize() const
Returns the total number of elements in the collection.
unsigned int GetMax() const
Returns the maximum number of elements for the collection.
void Truncate(unsigned int size)
Trim the given number of elements from the end of the collection.
void Clear()
Clear all items of the collection.
bool IsElementNull(unsigned int index) const
check if the element at the given index is null
void Set(unsigned int index, const T &value)
Set the collection element value at the given position.
CollectionType GetType() const
Return the type of the collection.
iterator begin()
Returns an iterator pointing to the first element in the collection.
TypeInfo GetTypeInfo() const
Return the type information object associated to the collection.
T Get(unsigned int index) const
Return the collection element value at the given position.
void Append(const T &value)
Append the given element value at the end of the collection.
bool Delete(unsigned int index) const
Delete the element at the given position in the Nested Table Collection.
STL compliant Collection Random iterator class.
Provides type information on Oracle Database objects.
Connection GetConnection() const
Return the connection associated with a statement.
Template Enumeration template class providing some type safety to some extends for manipulating enume...
Internal usage. Interface for handling ownership and relationship of a C API handle.
Internal usage. Provide a buffer class with RAII capabilities.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetBoolean(OCI_Elem *elem, boolean value)
Set a boolean value to a collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetNumber(OCI_Elem *elem, OCI_Number *value)
Set a number value to a collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_CollAppend(OCI_Coll *coll, OCI_Elem *elem)
Append the given element at the end of the collection.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemGetBoolean(OCI_Elem *elem)
Return the boolean value of the given collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetInterval(OCI_Elem *elem, OCI_Interval *value)
Assign an Interval handle to a collection element.
OCI_SYM_PUBLIC OCI_Coll *OCI_API OCI_ElemGetColl(OCI_Elem *elem)
Return the collection value of the given collection element.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_CollGetSize(OCI_Coll *coll)
Returns the total number of elements of the given collection.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemFree(OCI_Elem *elem)
Free a local collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetFile(OCI_Elem *elem, OCI_File *value)
Assign a File handle to a collection element.
OCI_SYM_PUBLIC int OCI_API OCI_ElemGetInt(OCI_Elem *elem)
Return the int value of the given collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetString(OCI_Elem *elem, const otext *value)
Set a string value to a collection element.
OCI_SYM_PUBLIC OCI_Date *OCI_API OCI_ElemGetDate(OCI_Elem *elem)
Return the Date value of the given collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetBigInt(OCI_Elem *elem, big_int value)
Set a big int value to a collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetDouble(OCI_Elem *elem, double value)
Set a double value to a collection element.
OCI_SYM_PUBLIC short OCI_API OCI_ElemGetShort(OCI_Elem *elem)
Return the short value of the given collection element.
OCI_SYM_PUBLIC OCI_Elem *OCI_API OCI_ElemCreate(OCI_TypeInfo *typinf)
Create a local collection element instance based on a collection type descriptor.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetNull(OCI_Elem *elem)
Set a collection element value to null.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetInt(OCI_Elem *elem, int value)
Set a int value to a collection element.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_CollGetCount(OCI_Coll *coll)
Returns the current number of elements of the given collection.
OCI_SYM_PUBLIC OCI_Object *OCI_API OCI_ElemGetObject(OCI_Elem *elem)
Return the object value of the given collection element.
OCI_SYM_PUBLIC 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.
OCI_SYM_PUBLIC OCI_Elem *OCI_API OCI_CollGetElem(OCI_Coll *coll, unsigned int index)
Return the element at the given position in the collection.
OCI_SYM_PUBLIC float OCI_API OCI_ElemGetFloat(OCI_Elem *elem)
Return the float value of the given collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetLob(OCI_Elem *elem, OCI_Lob *value)
Assign a Lob handle to a collection element.
OCI_SYM_PUBLIC OCI_TypeInfo *OCI_API OCI_CollGetTypeInfo(OCI_Coll *coll)
Return the type info object associated to the collection.
OCI_SYM_PUBLIC OCI_File *OCI_API OCI_ElemGetFile(OCI_Elem *elem)
Return the File value of the given collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_CollClear(OCI_Coll *coll)
clear all items of the given collection
OCI_SYM_PUBLIC OCI_Number *OCI_API OCI_ElemGetNumber(OCI_Elem *elem)
Return the number value of the given collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetObject(OCI_Elem *elem, OCI_Object *value)
Assign an Object handle to a collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_CollAssign(OCI_Coll *coll, OCI_Coll *coll_src)
Assign a collection to another one.
OCI_SYM_PUBLIC OCI_Interval *OCI_API OCI_ElemGetInterval(OCI_Elem *elem)
Return the Interval value of the given collection element.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_CollGetType(OCI_Coll *coll)
Return the collection type.
OCI_SYM_PUBLIC big_uint OCI_API OCI_ElemGetUnsignedBigInt(OCI_Elem *elem)
Return the unsigned big int value of the given collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetDate(OCI_Elem *elem, OCI_Date *value)
Assign a Date handle to a collection element.
OCI_SYM_PUBLIC unsigned short OCI_API OCI_ElemGetUnsignedShort(OCI_Elem *elem)
Return the unsigned short value of the given collection element.
OCI_SYM_PUBLIC const otext *OCI_API OCI_ElemGetString(OCI_Elem *elem)
Return the String value of the given collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_CollDeleteElem(OCI_Coll *coll, unsigned int index)
Delete the element at the given position in the Nested Table Collection.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetUnsignedShort(OCI_Elem *elem, unsigned short value)
Set a unsigned short value to a collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetUnsignedBigInt(OCI_Elem *elem, big_uint value)
Set a unsigned big_int value to a collection element.
OCI_SYM_PUBLIC 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.
OCI_SYM_PUBLIC boolean OCI_API OCI_CollToText(OCI_Coll *coll, unsigned int *size, otext *str)
Convert a collection handle value to a string.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetShort(OCI_Elem *elem, short value)
Set a short value to a collection element.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_CollGetMax(OCI_Coll *coll)
Returns the maximum number of elements of the given collection.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_ElemGetUnsignedInt(OCI_Elem *elem)
Return the unsigned int value of the given collection element.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_ElemGetRawSize(OCI_Elem *elem)
Return the raw attribute value size of the given element handle.
OCI_SYM_PUBLIC big_int OCI_API OCI_ElemGetBigInt(OCI_Elem *elem)
Return the big int value of the given collection element.
OCI_SYM_PUBLIC OCI_Lob *OCI_API OCI_ElemGetLob(OCI_Elem *elem)
Return the Lob value of the given collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetRef(OCI_Elem *elem, OCI_Ref *value)
Assign a Ref handle to a collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetRaw(OCI_Elem *elem, void *value, unsigned int len)
Set a RAW value to a collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetTimestamp(OCI_Elem *elem, OCI_Timestamp *value)
Assign a Timestamp handle to a collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetColl(OCI_Elem *elem, OCI_Coll *value)
Assign a Collection handle to a collection element.
OCI_SYM_PUBLIC OCI_Timestamp *OCI_API OCI_ElemGetTimestamp(OCI_Elem *elem)
Return the Timestamp value of the given collection element.
OCI_SYM_PUBLIC double OCI_API OCI_ElemGetDouble(OCI_Elem *elem)
Return the Double value of the given collection element.
OCI_SYM_PUBLIC OCI_Coll *OCI_API OCI_CollCreate(OCI_TypeInfo *typinf)
Create a local collection instance.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetFloat(OCI_Elem *elem, float value)
Set a float value to a collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_CollTrim(OCI_Coll *coll, unsigned int nb_elem)
Trims the given number of elements from the end of the collection.
OCI_SYM_PUBLIC OCI_Ref *OCI_API OCI_ElemGetRef(OCI_Elem *elem)
Return the Ref value of the given collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetUnsignedInt(OCI_Elem *elem, unsigned int value)
Set a unsigned int value to a collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemIsNull(OCI_Elem *elem)
Check if the collection element value is null.
struct OCI_Elem OCI_Elem
Oracle Collection item representation.
struct OCI_Coll OCI_Coll
Oracle Collections (VARRAYs and Nested Tables) representation.
long long big_int
big_int is a C scalar integer (32 or 64 bits) depending on compiler support for 64bits integers....
static T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so,...
ostring MakeString(const otext *result, int size=-1)
Internal usage. Constructs a C++ string object from the given OCILIB string pointer.
Raw MakeRaw(AnyPointer result, unsigned int size)
Internal usage. Constructs a C++ Raw object from the given OCILIB raw buffer.
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 )
Lob< ostring, LobNationalCharacter > NClob
Class handling NCLOB oracle type.
Lob< ostring, LobCharacter > Clob
Class handling CLOB oracle type.
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
void * AnyPointer
Alias for the generic void pointer.
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.