OCILIB (C and C++ Driver for Oracle)  4.7.6
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-2023 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  AcquireAllocated
39  (
40  core::Check(OCI_CollCreate(typeInfo)),
41  typeInfo.GetConnection().GetHandle()
42  );
43 }
44 
45 template<class T>
47 {
48  AcquireTransient(pColl,parent);
49 }
50 
51 template<class T>
53 {
54  Collection<T> result(GetTypeInfo());
55 
56  core::Check(OCI_CollAssign(result, *this));
57 
58  return result;
59 }
60 
61 template<class T>
63 {
65 }
66 
67 template<class T>
69 {
71 }
72 
73 template<class T>
74 unsigned int Collection<T>::GetMax() const
75 {
76  return core::Check(OCI_CollGetMax(*this));
77 }
78 
79 template<class T>
80 unsigned int Collection<T>::GetSize() const
81 
82 {
83  return core::Check(OCI_CollGetSize(*this));
84 }
85 
86 template<class T>
87 unsigned int Collection<T>::GetCount() const
88 
89 {
90  return core::Check(OCI_CollGetCount(*this));
91 }
92 
93 template<class T>
94 void Collection<T>::Truncate(unsigned int size)
95 {
96  core::Check(OCI_CollTrim(*this, size));
97 }
98 
99 template<class T>
101 {
102  core::Check(OCI_CollClear(*this));
103 }
104 
105 template<class T>
106 bool Collection<T>::IsElementNull(unsigned int index) const
107 {
108  return (core::Check(OCI_ElemIsNull(core::Check(OCI_CollGetElem(*this, index)))) == TRUE);
109 }
110 
111 template<class T>
112 void Collection<T>::SetElementNull(unsigned int index)
113 {
115 }
116 
117 template<class T>
118 bool Collection<T>::Delete(unsigned int index) const
119 {
120  return (core::Check(OCI_CollDeleteElem(*this, index)) == TRUE);
121 }
122 
123 template<class T>
125 {
126  return iterator(this, 1);
127 }
128 
129 template<class T>
131 {
132  return const_iterator(const_cast<Collection*>(this), 1);
133 }
134 
135 template<class T>
137 {
138  return iterator(const_cast<Collection*>(this), GetCount() + 1);
139 }
140 
141 template<class T>
143 {
144  return const_iterator(const_cast<Collection*>(this), GetCount() + 1);
145 }
146 
147 template<class T>
148 T Collection<T>::Get(unsigned int index) const
149 {
150  return GetElem(core::Check(OCI_CollGetElem(*this, index)), GetHandle());
151 }
152 
153 template<class T>
154 void Collection<T>::Set(unsigned int index, const T & value)
155 {
156  OCI_Elem * elem = core::Check(OCI_CollGetElem(*this, index));
157 
158  SetElem(elem, value);
159 
160  core::Check(OCI_CollSetElem(*this, index, elem));
161 }
162 
163 template<class T>
164 void Collection<T>::Append(const T &value)
165 {
167 
168  SetElem(elem, value);
169 
170  core::Check(OCI_CollAppend(*this, elem));
171  core::Check(OCI_ElemFree(elem));
172 }
173 
174 template<>
175 inline bool Collection<bool>::GetElem(OCI_Elem *elem, core::Handle *parent)
176 {
177  ARG_NOT_USED(parent);
178 
179  return (core::Check(OCI_ElemGetBoolean(elem)) == TRUE);
180 }
181 
182 template<>
183 inline short Collection<short>::GetElem(OCI_Elem *elem, core::Handle *parent)
184 {
185  ARG_NOT_USED(parent);
186 
187  return core::Check(OCI_ElemGetShort(elem));
188 }
189 
190 template<>
191 inline unsigned short Collection<unsigned short>::GetElem(OCI_Elem *elem, core::Handle *parent)
192 {
193  ARG_NOT_USED(parent);
194 
196 }
197 
198 template<>
199 inline int Collection<int>::GetElem(OCI_Elem *elem, core::Handle *parent)
200 {
201  ARG_NOT_USED(parent);
202 
203  return core::Check(OCI_ElemGetInt(elem));
204 }
205 
206 template<>
207 inline unsigned int Collection<unsigned int>::GetElem(OCI_Elem *elem, core::Handle *parent)
208 {
209  ARG_NOT_USED(parent);
210 
211  return core::Check(OCI_ElemGetUnsignedInt(elem));
212 }
213 
214 template<>
215 inline big_int Collection<big_int>::GetElem(OCI_Elem *elem, core::Handle *parent)
216 {
217  ARG_NOT_USED(parent);
218 
219  return core::Check(OCI_ElemGetBigInt(elem));
220 }
221 
222 template<>
223 inline big_uint Collection<big_uint>::GetElem(OCI_Elem *elem, core::Handle *parent)
224 {
225  ARG_NOT_USED(parent);
226 
228 }
229 
230 template<>
231 inline float Collection<float>::GetElem(OCI_Elem *elem, core::Handle *parent)
232 {
233  ARG_NOT_USED(parent);
234 
235  return core::Check(OCI_ElemGetFloat(elem));
236 }
237 
238 template<>
239 inline double Collection<double>::GetElem(OCI_Elem *elem, core::Handle *parent)
240 {
241  ARG_NOT_USED(parent);
242 
243  return core::Check(OCI_ElemGetDouble(elem));
244 }
245 
246 template<>
247 inline Number Collection<Number>::GetElem(OCI_Elem *elem, core::Handle *parent)
248 {
249  return Number(core::Check(OCI_ElemGetNumber(elem)), parent);
250 }
251 
252 template<>
253 inline ostring Collection<ostring>::GetElem(OCI_Elem *elem, core::Handle *parent)
254 {
255  ARG_NOT_USED(parent);
256 
258 }
259 
260 template<>
261 inline Raw Collection<Raw>::GetElem(OCI_Elem *elem, core::Handle *parent)
262 {
263  ARG_NOT_USED(parent);
264 
265  unsigned int size = core::Check(OCI_ElemGetRawSize(elem));
266 
267  core::ManagedBuffer<unsigned char> buffer(static_cast<size_t>(size + 1));
268 
269  size = core::Check(OCI_ElemGetRaw(elem, static_cast<AnyPointer>(buffer), size));
270 
271  return core::MakeRaw(buffer, size);
272 }
273 
274 template<>
275 inline Date Collection<Date>::GetElem(OCI_Elem *elem, core::Handle *parent)
276 {
277  return Date(core::Check(OCI_ElemGetDate(elem)), parent);
278 }
279 
280 template<>
281 inline Timestamp Collection<Timestamp>::GetElem(OCI_Elem *elem, core::Handle *parent)
282 {
283  return Timestamp(core::Check(OCI_ElemGetTimestamp(elem)), parent);
284 }
285 
286 template<>
287 inline Interval Collection<Interval>::GetElem(OCI_Elem *elem, core::Handle *parent)
288 {
289  return Interval(core::Check(OCI_ElemGetInterval(elem)), parent);
290 }
291 
292 template<>
293 inline Object Collection<Object>::GetElem(OCI_Elem *elem, core::Handle *parent)
294 {
295  return Object(core::Check(OCI_ElemGetObject(elem)), parent);
296 }
297 
298 template<>
299 inline Reference Collection<Reference>::GetElem(OCI_Elem *elem, core::Handle *parent)
300 {
301  return Reference(core::Check(OCI_ElemGetRef(elem)), parent);
302 }
303 
304 template<>
305 inline Clob Collection<Clob>::GetElem(OCI_Elem *elem, core::Handle *parent)
306 {
307  return Clob(core::Check(OCI_ElemGetLob(elem)), parent);
308 }
309 
310 template<>
311 inline NClob Collection<NClob>::GetElem(OCI_Elem *elem, core::Handle *parent)
312 {
313  return NClob(core::Check(OCI_ElemGetLob(elem)), parent);
314 }
315 template<>
316 inline Blob Collection<Blob>::GetElem(OCI_Elem *elem, core::Handle *parent)
317 {
318  return Blob(core::Check(OCI_ElemGetLob(elem)), parent);
319 }
320 
321 template<>
322 inline File Collection<File>::GetElem(OCI_Elem *elem, core::Handle *parent)
323 {
324  return File(core::Check(OCI_ElemGetFile(elem)), parent);
325 }
326 
327 template<class T>
328  T Collection<T>::GetElem(OCI_Elem *elem, core::Handle *parent)
329 {
330  return T(core::Check(OCI_ElemGetColl(elem)), parent);
331 }
332 
333 template<>
334 inline void Collection<bool>::SetElem(OCI_Elem *elem, const bool &value)
335 {
336  core::Check(OCI_ElemSetBoolean(elem, static_cast<boolean>(value)));
337 }
338 
339 template<>
340 inline void Collection<short>::SetElem(OCI_Elem *elem, const short &value)
341 {
342  core::Check(OCI_ElemSetShort(elem, value));
343 }
344 
345 template<>
346 inline void Collection<unsigned short>::SetElem(OCI_Elem *elem, const unsigned short &value)
347 {
349 }
350 
351 template<>
352 inline void Collection<int>::SetElem(OCI_Elem *elem, const int &value)
353 {
354  core::Check(OCI_ElemSetInt(elem, value));
355 }
356 
357 template<>
358 inline void Collection<unsigned int>::SetElem(OCI_Elem *elem, const unsigned int &value)
359 {
360  core::Check(OCI_ElemSetUnsignedInt(elem, value));
361 }
362 
363 template<>
364 inline void Collection<big_int>::SetElem(OCI_Elem *elem, const big_int &value)
365 {
366  core::Check(OCI_ElemSetBigInt(elem, value));
367 }
368 
369 template<>
370 inline void Collection<big_uint>::SetElem(OCI_Elem *elem, const big_uint &value)
371 {
373 }
374 
375 template<>
376 inline void Collection<float>::SetElem(OCI_Elem *elem, const float &value)
377 {
378  core::Check(OCI_ElemSetFloat(elem, value));
379 }
380 
381 template<>
382 inline void Collection<double>::SetElem(OCI_Elem *elem, const double &value)
383 {
384  core::Check(OCI_ElemSetDouble(elem, value));
385 }
386 
387 template<>
388 inline void Collection<Number>::SetElem(OCI_Elem *elem, const Number &value)
389 {
390  core::Check(OCI_ElemSetNumber(elem, value));
391 }
392 
393 template<>
394 inline void Collection<ostring>::SetElem(OCI_Elem *elem, const ostring& value)
395 {
396  core::Check(OCI_ElemSetString(elem, value.c_str()));
397 }
398 
399 template<>
400 inline void Collection<Raw>::SetElem(OCI_Elem *elem, const Raw &value)
401 {
402  const AnyPointer data = value.empty() ? nullptr : static_cast<AnyPointer>(const_cast<Raw::value_type*>(&value[0])) ;
403 
404  core::Check(OCI_ElemSetRaw(elem, data, static_cast<unsigned int>(value.size())));
405 }
406 
407 template<>
408 inline void Collection<Date>::SetElem(OCI_Elem *elem, const Date &value)
409 {
410  core::Check(OCI_ElemSetDate(elem, value));
411 }
412 
413 template<>
414 inline void Collection<Timestamp>::SetElem(OCI_Elem *elem, const Timestamp &value)
415 {
416  core::Check(OCI_ElemSetTimestamp(elem, value));
417 }
418 
419 template<>
420 inline void Collection<Interval>::SetElem(OCI_Elem *elem, const Interval &value)
421 {
422  core::Check(OCI_ElemSetInterval(elem, value));
423 }
424 
425 template<>
426 inline void Collection<Object>::SetElem(OCI_Elem *elem, const Object &value)
427 {
428  core::Check(OCI_ElemSetObject(elem, value));
429 }
430 
431 template<>
432 inline void Collection<Reference>::SetElem(OCI_Elem *elem, const Reference &value)
433 {
434  core::Check(OCI_ElemSetRef(elem, value));
435 }
436 
437 template<>
438 inline void Collection<Clob>::SetElem(OCI_Elem *elem, const Clob &value)
439 {
440  core::Check(OCI_ElemSetLob(elem, value));
441 }
442 
443 template<>
444 inline void Collection<NClob>::SetElem(OCI_Elem *elem, const NClob &value)
445 {
446  core::Check(OCI_ElemSetLob(elem, value));
447 }
448 
449 template<>
450 inline void Collection<Blob>::SetElem(OCI_Elem *elem, const Blob &value)
451 {
452  core::Check(OCI_ElemSetLob(elem, value));
453 }
454 
455 template<>
456 inline void Collection<File>::SetElem(OCI_Elem *elem, const File &value)
457 {
458  core::Check(OCI_ElemSetFile(elem, value));
459 }
460 
461 template<class T>
462 void Collection<T>::SetElem(OCI_Elem *elem, const T &value)
463 {
464  core::Check(OCI_ElemSetColl(elem, value));
465 }
466 
467 template<class T>
469 {
470  if (!IsNull())
471  {
472  unsigned int len = 0;
473 
474  core::Check(OCI_CollToText(*this, &len, nullptr));
475 
476  core::ManagedBuffer<otext> buffer(static_cast<size_t>(len + 1));
477 
478  core::Check(OCI_CollToText(*this, &len, buffer));
479 
480  return core::MakeString(static_cast<const otext *>(buffer), static_cast<int>(len));
481  }
482 
483  return OCI_STRING_NULL;
484 }
485 
486 template<class T>
488 {
489  return CollectionElement<T>(this, index);
490 }
491 
492 template<class T>
494 {
495  return CollectionElement<T>(const_cast<Collection<T>*>(this), index);
496 }
497 
498 }
Class used for handling transient collection value. it is used internally by the Collection<T> class:
Definition: types.hpp:4937
Object identifying the SQL data types VARRAY and NESTED TABLE.
Definition: types.hpp:5029
void SetElementNull(unsigned int index)
Nullify the element at the given index.
Definition: Collection.hpp:112
unsigned int GetCount() const
Returns the current number of elements in the collection.
Definition: Collection.hpp:87
CollectionElement< T > operator[](unsigned int index)
Returns the element at a given position in the collection.
Definition: Collection.hpp:487
Collection Clone() const
Clone the current instance to a new one performing deep copy.
Definition: Collection.hpp:52
iterator end()
Returns an iterator referring to the past-the-end element in the collection.
Definition: Collection.hpp:136
ostring ToString() const override
return a string representation of the current collection
Definition: Collection.hpp:468
unsigned int GetSize() const
Returns the total number of elements in the collection.
Definition: Collection.hpp:80
unsigned int GetMax() const
Returns the maximum number of elements for the collection.
Definition: Collection.hpp:74
void Truncate(unsigned int size)
Trim the given number of elements from the end of the collection.
Definition: Collection.hpp:94
void Clear()
Clear all items of the collection.
Definition: Collection.hpp:100
bool IsElementNull(unsigned int index) const
check if the element at the given index is null
Definition: Collection.hpp:106
void Set(unsigned int index, const T &value)
Set the collection element value at the given position.
Definition: Collection.hpp:154
CollectionType GetType() const
Return the type of the collection.
Definition: Collection.hpp:68
iterator begin()
Returns an iterator pointing to the first element in the collection.
Definition: Collection.hpp:124
TypeInfo GetTypeInfo() const
Return the type information object associated to the collection.
Definition: Collection.hpp:62
T Get(unsigned int index) const
Return the collection element value at the given position.
Definition: Collection.hpp:148
void Append(const T &value)
Append the given element value at the end of the collection.
Definition: Collection.hpp:164
bool Delete(unsigned int index) const
Delete the element at the given position in the Nested Table Collection.
Definition: Collection.hpp:118
STL compliant Collection Random iterator class.
Definition: types.hpp:4969
Provides type information on Oracle Database objects.
Definition: types.hpp:4531
Connection GetConnection() const
Return the connection associated with a statement.
Definition: TypeInfo.hpp:52
Template Enumeration template class providing some type safety to some extends for manipulating enume...
Definition: core.hpp:118
Internal usage. Interface for handling ownership and relationship of a C API handle.
Definition: core.hpp:325
Internal usage. Provide a buffer class with RAII capabilities.
Definition: core.hpp:197
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.
Definition: types.h:329
struct OCI_Coll OCI_Coll
Oracle Collections (VARRAYs and Nested Tables) representation.
Definition: types.h:319
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
static T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so,...
Definition: Utils.hpp:53
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
Raw MakeRaw(AnyPointer result, unsigned int size)
Internal usage. Constructs a C++ Raw object from the given OCILIB raw buffer.
Definition: Utils.hpp:70
OCILIB ++ Namespace.
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
Lob< ostring, LobNationalCharacter > NClob
Class handling NCLOB oracle type.
Definition: types.hpp:4320
Lob< ostring, LobCharacter > Clob
Class handling CLOB oracle type.
Definition: types.hpp:4309
std::vector< unsigned char > Raw
C++ counterpart of SQL RAW data type.
Definition: config.hpp:138
void * AnyPointer
Alias for the generic void pointer.
Definition: config.hpp:129
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.
Definition: types.hpp:4331