OCILIB (C and C++ Driver for Oracle)  4.7.3
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
Collection.hpp
1 /*
2  * OCILIB - C Driver for Oracle (C Wrapper for Oracle OCI)
3  *
4  * Website: http://www.ocilib.net
5  *
6  * Copyright (c) 2007-2021 Vincent ROGIER <vince.rogier@ocilib.net>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #pragma once
22 
23 #include "ocilibcpp/types.hpp"
24 
25 // ReSharper disable CppClangTidyMiscMisplacedConst
26 
27 namespace ocilib
28 {
29 
30 template<class T>
32 {
33 }
34 
35 template<class T>
37 {
38  Acquire(core::Check(OCI_CollCreate(typeInfo)), reinterpret_cast<HandleFreeFunc>(OCI_CollFree), nullptr, typeInfo.GetConnection().GetHandle());
39 }
40 
41 template<class T>
43 {
44  Acquire(pColl, nullptr, nullptr, parent);
45 }
46 
47 template<class T>
49 {
50  Collection<T> result(GetTypeInfo());
51 
52  core::Check(OCI_CollAssign(result, *this));
53 
54  return result;
55 }
56 
57 template<class T>
59 {
61 }
62 
63 template<class T>
65 {
67 }
68 
69 template<class T>
70 unsigned int Collection<T>::GetMax() const
71 {
72  return core::Check(OCI_CollGetMax(*this));
73 }
74 
75 template<class T>
76 unsigned int Collection<T>::GetSize() const
77 
78 {
79  return core::Check(OCI_CollGetSize(*this));
80 }
81 
82 template<class T>
83 unsigned int Collection<T>::GetCount() const
84 
85 {
86  return core::Check(OCI_CollGetCount(*this));
87 }
88 
89 template<class T>
90 void Collection<T>::Truncate(unsigned int size)
91 {
92  core::Check(OCI_CollTrim(*this, size));
93 }
94 
95 template<class T>
97 {
98  core::Check(OCI_CollClear(*this));
99 }
100 
101 template<class T>
102 bool Collection<T>::IsElementNull(unsigned int index) const
103 {
104  return (core::Check(OCI_ElemIsNull(core::Check(OCI_CollGetElem(*this, index)))) == TRUE);
105 }
106 
107 template<class T>
108 void Collection<T>::SetElementNull(unsigned int index)
109 {
111 }
112 
113 template<class T>
114 bool Collection<T>::Delete(unsigned int index) const
115 {
116  return (core::Check(OCI_CollDeleteElem(*this, index)) == TRUE);
117 }
118 
119 template<class T>
121 {
122  return iterator(this, 1);
123 }
124 
125 template<class T>
127 {
128  return const_iterator(const_cast<Collection*>(this), 1);
129 }
130 
131 template<class T>
133 {
134  return iterator(const_cast<Collection*>(this), GetCount() + 1);
135 }
136 
137 template<class T>
139 {
140  return const_iterator(const_cast<Collection*>(this), GetCount() + 1);
141 }
142 
143 template<class T>
144 T Collection<T>::Get(unsigned int index) const
145 {
146  return GetElem(core::Check(OCI_CollGetElem(*this, index)), GetHandle());
147 }
148 
149 template<class T>
150 void Collection<T>::Set(unsigned int index, const T & value)
151 {
152  OCI_Elem * elem = core::Check(OCI_CollGetElem(*this, index));
153 
154  SetElem(elem, value);
155 
156  core::Check(OCI_CollSetElem(*this, index, elem));
157 }
158 
159 template<class T>
160 void Collection<T>::Append(const T &value)
161 {
163 
164  SetElem(elem, value);
165 
166  core::Check(OCI_CollAppend(*this, elem));
167  core::Check(OCI_ElemFree(elem));
168 }
169 
170 template<>
171 inline bool Collection<bool>::GetElem(OCI_Elem *elem, core::Handle *parent)
172 {
173  ARG_NOT_USED(parent);
174 
175  return (core::Check(OCI_ElemGetBoolean(elem)) == TRUE);
176 }
177 
178 template<>
179 inline short Collection<short>::GetElem(OCI_Elem *elem, core::Handle *parent)
180 {
181  ARG_NOT_USED(parent);
182 
183  return core::Check(OCI_ElemGetShort(elem));
184 }
185 
186 template<>
187 inline unsigned short Collection<unsigned short>::GetElem(OCI_Elem *elem, core::Handle *parent)
188 {
189  ARG_NOT_USED(parent);
190 
192 }
193 
194 template<>
195 inline int Collection<int>::GetElem(OCI_Elem *elem, core::Handle *parent)
196 {
197  ARG_NOT_USED(parent);
198 
199  return core::Check(OCI_ElemGetInt(elem));
200 }
201 
202 template<>
203 inline unsigned int Collection<unsigned int>::GetElem(OCI_Elem *elem, core::Handle *parent)
204 {
205  ARG_NOT_USED(parent);
206 
207  return core::Check(OCI_ElemGetUnsignedInt(elem));
208 }
209 
210 template<>
212 {
213  ARG_NOT_USED(parent);
214 
215  return core::Check(OCI_ElemGetBigInt(elem));
216 }
217 
218 template<>
219 inline big_uint Collection<big_uint>::GetElem(OCI_Elem *elem, core::Handle *parent)
220 {
221  ARG_NOT_USED(parent);
222 
224 }
225 
226 template<>
227 inline float Collection<float>::GetElem(OCI_Elem *elem, core::Handle *parent)
228 {
229  ARG_NOT_USED(parent);
230 
231  return core::Check(OCI_ElemGetFloat(elem));
232 }
233 
234 template<>
235 inline double Collection<double>::GetElem(OCI_Elem *elem, core::Handle *parent)
236 {
237  ARG_NOT_USED(parent);
238 
239  return core::Check(OCI_ElemGetDouble(elem));
240 }
241 
242 template<>
244 {
245  return Number(core::Check(OCI_ElemGetNumber(elem)), parent);
246 }
247 
248 template<>
250 {
251  ARG_NOT_USED(parent);
252 
254 }
255 
256 template<>
257 inline Raw Collection<Raw>::GetElem(OCI_Elem *elem, core::Handle *parent)
258 {
259  ARG_NOT_USED(parent);
260 
261  unsigned int size = core::Check(OCI_ElemGetRawSize(elem));
262 
263  core::ManagedBuffer<unsigned char> buffer(static_cast<size_t>(size + 1));
264 
265  size = core::Check(OCI_ElemGetRaw(elem, static_cast<AnyPointer>(buffer), size));
266 
267  return core::MakeRaw(buffer, size);
268 }
269 
270 template<>
272 {
273  return Date(core::Check(OCI_ElemGetDate(elem)), parent);
274 }
275 
276 template<>
278 {
279  return Timestamp(core::Check(OCI_ElemGetTimestamp(elem)), parent);
280 }
281 
282 template<>
284 {
285  return Interval(core::Check(OCI_ElemGetInterval(elem)), parent);
286 }
287 
288 template<>
290 {
291  return Object(core::Check(OCI_ElemGetObject(elem)), parent);
292 }
293 
294 template<>
296 {
297  return Reference(core::Check(OCI_ElemGetRef(elem)), parent);
298 }
299 
300 template<>
302 {
303  return Clob(core::Check(OCI_ElemGetLob(elem)), parent);
304 }
305 
306 template<>
308 {
309  return NClob(core::Check(OCI_ElemGetLob(elem)), parent);
310 }
311 template<>
313 {
314  return Blob(core::Check(OCI_ElemGetLob(elem)), parent);
315 }
316 
317 template<>
319 {
320  return File(core::Check(OCI_ElemGetFile(elem)), parent);
321 }
322 
323 template<class T>
325 {
326  return T(core::Check(OCI_ElemGetColl(elem)), parent);
327 }
328 
329 template<>
330 inline void Collection<bool>::SetElem(OCI_Elem *elem, const bool &value)
331 {
332  core::Check(OCI_ElemSetBoolean(elem, static_cast<boolean>(value)));
333 }
334 
335 template<>
336 inline void Collection<short>::SetElem(OCI_Elem *elem, const short &value)
337 {
338  core::Check(OCI_ElemSetShort(elem, value));
339 }
340 
341 template<>
342 inline void Collection<unsigned short>::SetElem(OCI_Elem *elem, const unsigned short &value)
343 {
345 }
346 
347 template<>
348 inline void Collection<int>::SetElem(OCI_Elem *elem, const int &value)
349 {
350  core::Check(OCI_ElemSetInt(elem, value));
351 }
352 
353 template<>
354 inline void Collection<unsigned int>::SetElem(OCI_Elem *elem, const unsigned int &value)
355 {
356  core::Check(OCI_ElemSetUnsignedInt(elem, value));
357 }
358 
359 template<>
360 inline void Collection<big_int>::SetElem(OCI_Elem *elem, const big_int &value)
361 {
362  core::Check(OCI_ElemSetBigInt(elem, value));
363 }
364 
365 template<>
366 inline void Collection<big_uint>::SetElem(OCI_Elem *elem, const big_uint &value)
367 {
369 }
370 
371 template<>
372 inline void Collection<float>::SetElem(OCI_Elem *elem, const float &value)
373 {
374  core::Check(OCI_ElemSetFloat(elem, value));
375 }
376 
377 template<>
378 inline void Collection<double>::SetElem(OCI_Elem *elem, const double &value)
379 {
380  core::Check(OCI_ElemSetDouble(elem, value));
381 }
382 
383 template<>
384 inline void Collection<Number>::SetElem(OCI_Elem *elem, const Number &value)
385 {
386  core::Check(OCI_ElemSetNumber(elem, value));
387 }
388 
389 template<>
390 inline void Collection<ostring>::SetElem(OCI_Elem *elem, const ostring& value)
391 {
392  core::Check(OCI_ElemSetString(elem, value.c_str()));
393 }
394 
395 template<>
396 inline void Collection<Raw>::SetElem(OCI_Elem *elem, const Raw &value)
397 {
398  const AnyPointer data = value.empty() ? nullptr : static_cast<AnyPointer>(const_cast<Raw::value_type*>(&value[0])) ;
399 
400  core::Check(OCI_ElemSetRaw(elem, data, static_cast<unsigned int>(value.size())));
401 }
402 
403 template<>
404 inline void Collection<Date>::SetElem(OCI_Elem *elem, const Date &value)
405 {
406  core::Check(OCI_ElemSetDate(elem, value));
407 }
408 
409 template<>
410 inline void Collection<Timestamp>::SetElem(OCI_Elem *elem, const Timestamp &value)
411 {
412  core::Check(OCI_ElemSetTimestamp(elem, value));
413 }
414 
415 template<>
416 inline void Collection<Interval>::SetElem(OCI_Elem *elem, const Interval &value)
417 {
418  core::Check(OCI_ElemSetInterval(elem, value));
419 }
420 
421 template<>
422 inline void Collection<Object>::SetElem(OCI_Elem *elem, const Object &value)
423 {
424  core::Check(OCI_ElemSetObject(elem, value));
425 }
426 
427 template<>
428 inline void Collection<Reference>::SetElem(OCI_Elem *elem, const Reference &value)
429 {
430  core::Check(OCI_ElemSetRef(elem, value));
431 }
432 
433 template<>
434 inline void Collection<Clob>::SetElem(OCI_Elem *elem, const Clob &value)
435 {
436  core::Check(OCI_ElemSetLob(elem, value));
437 }
438 
439 template<>
440 inline void Collection<NClob>::SetElem(OCI_Elem *elem, const NClob &value)
441 {
442  core::Check(OCI_ElemSetLob(elem, value));
443 }
444 
445 template<>
446 inline void Collection<Blob>::SetElem(OCI_Elem *elem, const Blob &value)
447 {
448  core::Check(OCI_ElemSetLob(elem, value));
449 }
450 
451 template<>
452 inline void Collection<File>::SetElem(OCI_Elem *elem, const File &value)
453 {
454  core::Check(OCI_ElemSetFile(elem, value));
455 }
456 
457 template<class T>
458 void Collection<T>::SetElem(OCI_Elem *elem, const T &value)
459 {
460  core::Check(OCI_ElemSetColl(elem, value));
461 }
462 
463 template<class T>
465 {
466  if (!IsNull())
467  {
468  unsigned int len = 0;
469 
470  core::Check(OCI_CollToText(*this, &len, nullptr));
471 
472  core::ManagedBuffer<otext> buffer(static_cast<size_t>(len + 1));
473 
474  core::Check(OCI_CollToText(*this, &len, buffer));
475 
476  return core::MakeString(static_cast<const otext *>(buffer), static_cast<int>(len));
477  }
478 
479  return OCI_STRING_NULL;
480 }
481 
482 template<class T>
484 {
485  return CollectionElement<T>(this, index);
486 }
487 
488 template<class T>
490 {
491  return CollectionElement<T>(this, index);
492 }
493 
494 }
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemGetBoolean(OCI_Elem *elem)
Return the boolean value of the given collection element.
OCI_SYM_PUBLIC OCI_Timestamp *OCI_API OCI_ElemGetTimestamp(OCI_Elem *elem)
Return the Timestamp value of the given collection element.
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.
Definition: types.hpp:4309
long long big_int
big_int is a C scalar integer (32 or 64 bits) depending on compiler support for 64bits integers...
Definition: platform.h:281
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 int OCI_API OCI_ElemGetInt(OCI_Elem *elem)
Return the int value of the given collection element.
STL compliant Collection Random iterator class.
Definition: types.hpp:4946
Internal usage. Interface for handling ownership and relationship of a C API handle.
Definition: core.hpp:312
OCI_SYM_PUBLIC OCI_Coll *OCI_API OCI_CollCreate(OCI_TypeInfo *typinf)
Create a local collection instance.
bool Delete(unsigned int index) const
Delete the element at the given position in the Nested Table Collection.
Definition: Collection.hpp:114
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemIsNull(OCI_Elem *elem)
Check if the collection element value is null.
unsigned int GetCount() const
Returns the current number of elements in the collection.
Definition: Collection.hpp:83
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 boolean OCI_API OCI_ElemSetDouble(OCI_Elem *elem, double value)
Set a double 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.
OCILIB ++ Namespace.
void Set(unsigned int index, const T &value)
Set the collection element value at the given position.
Definition: Collection.hpp:150
TypeInfo GetTypeInfo() const
Return the type information object associated to the collection.
Definition: Collection.hpp:58
iterator begin()
Returns an iterator pointing to the first element in the collection.
Definition: Collection.hpp:120
CollectionElement< T > operator[](unsigned int index)
Returns the element at a given position in the collection.
Definition: Collection.hpp:483
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.
Raw MakeRaw(AnyPointer result, unsigned int size)
Internal usage. Constructs a C++ Raw object from the given OCILIB raw buffer.
Definition: Utils.hpp:70
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_ElemSetDate(OCI_Elem *elem, OCI_Date *value)
Assign a Date 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 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_ElemSetNumber(OCI_Elem *elem, OCI_Number *value)
Set a number value to a 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 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_CollDeleteElem(OCI_Coll *coll, unsigned int index)
Delete the element at the given position in the Nested Table Collection.
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: Utils.hpp:53
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 boolean OCI_API OCI_ElemSetUnsignedShort(OCI_Elem *elem, unsigned short value)
Set a unsigned short value to a collection element.
ostring ToString() const override
return a string representation of the current collection
Definition: Collection.hpp:464
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 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_ElemSetInt(OCI_Elem *elem, int value)
Set a int value to a collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemFree(OCI_Elem *elem)
Free a local 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 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_ElemSetLob(OCI_Elem *elem, OCI_Lob *value)
Assign a Lob handle to a 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 boolean OCI_API OCI_ElemSetTimestamp(OCI_Elem *elem, OCI_Timestamp *value)
Assign a Timestamp handle to a collection element.
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 boolean OCI_API OCI_ElemSetBoolean(OCI_Elem *elem, boolean value)
Set a boolean 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.
Object identifying the SQL data type REF.
Definition: types.hpp:4825
ostring MakeString(const otext *result, int size=-1)
Internal usage. Constructs a C++ string object from the given OCILIB string pointer.
Definition: Utils.hpp:65
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetColl(OCI_Elem *elem, OCI_Coll *value)
Assign a Collection handle to a collection element.
Class used for handling transient collection value. it is used internally by the Collection<T> class:...
Definition: types.hpp:4914
OCI_SYM_PUBLIC unsigned int OCI_API OCI_CollGetCount(OCI_Coll *coll)
Returns the current number of elements of the given collection.
CollectionType GetType() const
Return the type of the collection.
Definition: Collection.hpp:64
void * AnyPointer
Alias for the generic void pointer.
Definition: config.hpp:129
void Clear()
Clear all items of the collection.
Definition: Collection.hpp:96
Template Enumeration template class providing some type safety to some extends for manipulating enume...
Definition: core.hpp:117
OCI_SYM_PUBLIC OCI_Ref *OCI_API OCI_ElemGetRef(OCI_Elem *elem)
Return the Ref value of the given collection element.
unsigned int GetSize() const
Returns the total number of elements in the collection.
Definition: Collection.hpp:76
Object identifying the SQL data type BFILE.
Definition: types.hpp:4319
Object identifying the SQL data types VARRAY and NESTED TABLE.
Definition: config.hpp:196
Collection Clone() const
Clone the current instance to a new one performing deep copy.
Definition: Collection.hpp:48
Object identifying the SQL data type INTERVAL.
Definition: types.hpp:3091
OCI_SYM_PUBLIC OCI_Coll *OCI_API OCI_ElemGetColl(OCI_Elem *elem)
Return the collection 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.
Internal usage. Provide a buffer class with RAII capabilities.
Definition: core.hpp:196
void Append(const T &value)
Append the given element value at the end of the collection.
Definition: Collection.hpp:160
OCI_SYM_PUBLIC boolean OCI_API OCI_CollFree(OCI_Coll *coll)
Free a local collection.
OCI_SYM_PUBLIC float OCI_API OCI_ElemGetFloat(OCI_Elem *elem)
Return the float value of the given collection element.
T Get(unsigned int index) const
Return the collection element value at the given position.
Definition: Collection.hpp:144
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetNull(OCI_Elem *elem)
Set a collection element value to null.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_CollGetType(OCI_Coll *coll)
Return the collection type.
Connection GetConnection() const
Return the connection associated with a statement.
Definition: TypeInfo.hpp:48
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 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_ElemSetFloat(OCI_Elem *elem, float value)
Set a float value to a collection element.
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetRef(OCI_Elem *elem, OCI_Ref *value)
Assign a Ref handle to a collection element.
Collection()
Create an empty null Collection instance.
Definition: Collection.hpp:31
OCI_SYM_PUBLIC boolean OCI_API OCI_CollToText(OCI_Coll *coll, unsigned int *size, otext *str)
Convert a collection handle value to a string.
unsigned int GetMax() const
Returns the maximum number of elements for the collection.
Definition: Collection.hpp:70
OCI_SYM_PUBLIC OCI_Object *OCI_API OCI_ElemGetObject(OCI_Elem *elem)
Return the object value of the given collection element.
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
Definition: config.hpp:138
iterator end()
Returns an iterator referring to the past-the-end element in the collection.
Definition: Collection.hpp:132
Provides type information on Oracle Database objects.
Definition: types.hpp:4508
Object identifying the SQL data type NUMBER.
Definition: types.hpp:2477
OCI_SYM_PUBLIC short OCI_API OCI_ElemGetShort(OCI_Elem *elem)
Return the short value of the given 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 unsigned int OCI_API OCI_CollGetSize(OCI_Coll *coll)
Returns the total number of elements of the given collection.
Lob< ostring, LobNationalCharacter > NClob
Class handling NCLOB oracle type.
Definition: types.hpp:4298
bool IsElementNull(unsigned int index) const
check if the element at the given index is null
Definition: Collection.hpp:102
OCI_SYM_PUBLIC boolean OCI_API OCI_CollClear(OCI_Coll *coll)
clear all items of the given collection
OCI_SYM_PUBLIC boolean OCI_API OCI_ElemSetFile(OCI_Elem *elem, OCI_File *value)
Assign a File handle to a collection element.
void SetElementNull(unsigned int index)
Nullify the element at the given index.
Definition: Collection.hpp:108
Object identifying the SQL data type LOB (CLOB, NCLOB and BLOB)
Definition: config.hpp:198
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 short OCI_API OCI_ElemGetUnsignedShort(OCI_Elem *elem)
Return the unsigned short value of the given collection element.
Lob< ostring, LobCharacter > Clob
Class handling CLOB oracle type.
Definition: types.hpp:4287
struct OCI_Coll OCI_Coll
Oracle Collections (VARRAYs and Nested Tables) representation.
Definition: types.h:307
OCI_SYM_PUBLIC big_int OCI_API OCI_ElemGetBigInt(OCI_Elem *elem)
Return the big int value of the given collection element.
struct OCI_Elem OCI_Elem
Oracle Collection item representation.
Definition: types.h:317
OCI_SYM_PUBLIC OCI_File *OCI_API OCI_ElemGetFile(OCI_Elem *elem)
Return the File value of the given collection element.
std::basic_string< otext, std::char_traits< otext >, std::allocator< otext > > ostring
string class wrapping the OCILIB otext * type and OTEXT() macros ( see Character sets ) ...
Definition: config.hpp:120
OCI_SYM_PUBLIC big_uint OCI_API OCI_ElemGetUnsignedBigInt(OCI_Elem *elem)
Return the unsigned big int value of the given collection element.
Object identifying the SQL data type TIMESTAMP.
Definition: types.hpp:3490
Object identifying the SQL data type OBJECT.
Definition: types.hpp:4645
void Truncate(unsigned int size)
Trim the given number of elements from the end of the collection.
Definition: Collection.hpp:90
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_ElemSetShort(OCI_Elem *elem, short value)
Set a short value 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.
Object identifying the SQL data type DATE.
Definition: types.hpp:2655