OCILIB (C and C++ Driver for Oracle)  4.7.6
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
Resultset.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 namespace ocilib
26 {
27 
28 inline Resultset::Resultset(OCI_Resultset *resultset, core::Handle *parent)
29 {
30  AcquireTransient(resultset, parent);
31 }
32 
33 inline bool Resultset::Next()
34 {
35  return (core::Check(OCI_FetchNext(*this)) == TRUE);
36 }
37 
38 inline bool Resultset::Prev()
39 {
40  return (core::Check(OCI_FetchPrev(*this)) == TRUE);
41 }
42 
43 inline bool Resultset::First()
44 {
45  return (core::Check(OCI_FetchFirst(*this)) == TRUE);
46 }
47 
48 inline bool Resultset::Last()
49 {
50  return (core::Check(OCI_FetchLast(*this)) == TRUE);
51 }
52 
53 inline bool Resultset::Seek(SeekMode mode, int offset)
54 {
55  return (core::Check(OCI_FetchSeek(*this, mode, offset)) == TRUE);
56 }
57 
58 inline unsigned int Resultset::GetCount() const
59 {
60  return core::Check(OCI_GetRowCount(*this));
61 }
62 
63 inline unsigned int Resultset::GetCurrentRow() const
64 {
65  return core::Check(OCI_GetCurrentRow(*this));
66 }
67 
68 inline unsigned int Resultset::GetColumnIndex(const ostring& name) const
69 {
70  return core::Check(OCI_GetColumnIndex(*this, name.c_str()));
71 }
72 
73 inline unsigned int Resultset::GetColumnCount() const
74 {
75  return core::Check(OCI_GetColumnCount(*this));
76 }
77 
78 inline Column Resultset::GetColumn(unsigned int index) const
79 {
80  return Column(core::Check(OCI_GetColumn(*this, index)), GetHandle());
81 }
82 
83 inline Column Resultset::GetColumn(const ostring& name) const
84 {
85  return Column(core::Check(OCI_GetColumn2(*this, name.c_str())), GetHandle());
86 }
87 
88 inline bool Resultset::IsColumnNull(unsigned int index) const
89 {
90  return (core::Check(OCI_IsNull(*this, index)) == TRUE);
91 }
92 
93 inline bool Resultset::IsColumnNull(const ostring& name) const
94 {
95  return (core::Check(OCI_IsNull2(*this, name.c_str())) == TRUE);
96 }
97 
99 {
100  return Statement( core::Check(OCI_ResultsetGetStatement(*this)), nullptr);
101 }
102 
103 inline bool Resultset::operator ++ (int)
104 {
105  return Next();
106 }
107 
108 inline bool Resultset::operator -- (int)
109 {
110  return Prev();
111 }
112 
113 inline bool Resultset::operator += (int offset)
114 {
115  return Seek(SeekRelative, offset);
116 }
117 
118 inline bool Resultset::operator -= (int offset)
119 {
120  return Seek(SeekRelative, -offset);
121 }
122 
123 template<class T>
124 void Resultset::Get(unsigned int index, T& value) const
125 {
126  value = Get<T>(index);
127 }
128 
129 template<class T>
130 void Resultset::Get(const ostring &name, T& value) const
131 {
132  value = Get<T>(name);
133 }
134 
135 template<class T, class TAdapter>
136 bool Resultset::Get(T& value, TAdapter adapter) const
137 {
138  return adapter(static_cast<const Resultset&>(*this), value);
139 }
140 
141 template<class TCallback>
142 unsigned int Resultset::ForEach(TCallback callback)
143 {
144  while (Next())
145  {
146  if (!callback(static_cast<const Resultset&>(*this)))
147  {
148  break;
149  }
150  }
151 
152  return GetCurrentRow();
153 }
154 
155 template<class T, class U>
156 unsigned int Resultset::ForEach(T callback, U adapter)
157 {
158  while (Next())
159  {
160  if (!callback(adapter(static_cast<const Resultset&>(*this))))
161  {
162  break;
163  }
164  }
165 
166  return GetCurrentRow();
167 }
168 
169 template<>
170 inline short Resultset::Get<short>(unsigned int index) const
171 {
172  return core::Check(OCI_GetShort(*this, index));
173 }
174 
175 template<>
176 inline short Resultset::Get<short>(const ostring& name) const
177 {
178  return core::Check(OCI_GetShort2(*this, name.c_str()));
179 }
180 
181 template<>
182 inline unsigned short Resultset::Get<unsigned short>(unsigned int index) const
183 {
184  return core::Check(OCI_GetUnsignedShort(*this, index));
185 }
186 
187 template<>
188 inline unsigned short Resultset::Get<unsigned short>(const ostring& name) const
189 {
190  return core::Check(OCI_GetUnsignedShort2(*this, name.c_str()));
191 }
192 
193 template<>
194 inline int Resultset::Get<int>(unsigned int index) const
195 {
196  return core::Check(OCI_GetInt(*this, index));
197 }
198 
199 template<>
200 inline int Resultset::Get<int>(const ostring& name) const
201 {
202  return core::Check(OCI_GetInt2(*this, name.c_str()));
203 }
204 
205 template<>
206 inline unsigned int Resultset::Get<unsigned int>(unsigned int index) const
207 {
208  return core::Check(OCI_GetUnsignedInt(*this, index));
209 }
210 
211 template<>
212 inline unsigned int Resultset::Get<unsigned int>(const ostring& name) const
213 {
214  return core::Check(OCI_GetUnsignedInt2(*this, name.c_str()));
215 }
216 
217 template<>
218 inline big_int Resultset::Get<big_int>(unsigned int index) const
219 {
220  return core::Check(OCI_GetBigInt(*this, index));
221 }
222 
223 template<>
224 inline big_int Resultset::Get<big_int>(const ostring& name) const
225 {
226  return core::Check(OCI_GetBigInt2(*this, name.c_str()));
227 }
228 
229 template<>
230 inline big_uint Resultset::Get<big_uint>(unsigned int index) const
231 {
232  return core::Check(OCI_GetUnsignedBigInt(*this, index));
233 }
234 
235 template<>
236 inline big_uint Resultset::Get<big_uint>(const ostring& name) const
237 {
238  return core::Check(OCI_GetUnsignedBigInt2(*this, name.c_str()));
239 }
240 
241 template<>
242 inline float Resultset::Get<float>(unsigned int index) const
243 {
244  return core::Check(OCI_GetFloat(*this, index));
245 }
246 
247 template<>
248 inline float Resultset::Get<float>(const ostring& name) const
249 {
250  return core::Check(OCI_GetFloat2(*this, name.c_str()));
251 }
252 
253 template<>
254 inline double Resultset::Get<double>(unsigned int index) const
255 {
256  return core::Check(OCI_GetDouble(*this, index));
257 }
258 
259 template<>
260 inline double Resultset::Get<double>(const ostring& name) const
261 {
262  return core::Check(OCI_GetDouble2(*this, name.c_str()));
263 }
264 
265 template<>
266 inline Number Resultset::Get<Number>(unsigned int index) const
267 {
268  return Number(core::Check(OCI_GetNumber(*this, index)), GetHandle());
269 }
270 
271 template<>
272 inline Number Resultset::Get<Number>(const ostring& name) const
273 {
274  return Number(core::Check(OCI_GetNumber2(*this, name.c_str())), GetHandle());
275 }
276 
277 template<>
278 inline ostring Resultset::Get<ostring>(unsigned int index) const
279 {
280  return core::MakeString(core::Check(OCI_GetString(*this, index)));
281 }
282 
283 template<>
284 inline ostring Resultset::Get<ostring>(const ostring& name) const
285 {
286  return core::MakeString(core::Check(OCI_GetString2(*this,name.c_str())));
287 }
288 
289 template<>
290 inline Raw Resultset::Get<Raw>(unsigned int index) const
291 {
292  unsigned int size = core::Check(OCI_GetDataLength(*this,index));
293 
294  core::ManagedBuffer<unsigned char> buffer(static_cast<size_t>(size + 1));
295 
296  size = core::Check(OCI_GetRaw(*this, index, static_cast<AnyPointer>(buffer), size));
297 
298  return core::MakeRaw(buffer, size);
299 }
300 
301 template<>
302 inline Raw Resultset::Get<Raw>(const ostring& name) const
303 {
304  unsigned int size = core::Check(OCI_GetDataLength(*this, core::Check(OCI_GetColumnIndex(*this, name.c_str()))));
305 
306  core::ManagedBuffer<unsigned char> buffer(static_cast<size_t>(size + 1));
307 
308  size = core::Check(OCI_GetRaw2(*this, name.c_str(), static_cast<AnyPointer>(buffer), size));
309 
310  return core::MakeRaw(buffer, size);
311 }
312 
313 template<>
314 inline Date Resultset::Get<Date>(unsigned int index) const
315 {
316  return Date(core::Check(OCI_GetDate(*this, index)), GetHandle());
317 }
318 
319 template<>
320 inline Date Resultset::Get<Date>(const ostring& name) const
321 {
322  return Date(core::Check(OCI_GetDate2(*this,name.c_str())), GetHandle());
323 }
324 
325 template<>
326 inline Timestamp Resultset::Get<Timestamp>(unsigned int index) const
327 {
328  return Timestamp(core::Check(OCI_GetTimestamp(*this, index)), GetHandle());
329 }
330 
331 template<>
332 inline Timestamp Resultset::Get<Timestamp>(const ostring& name) const
333 {
334  return Timestamp(core::Check(OCI_GetTimestamp2(*this,name.c_str())), GetHandle());
335 }
336 
337 template<>
338 inline Interval Resultset::Get<Interval>(unsigned int index) const
339 {
340  return Interval(core::Check(OCI_GetInterval(*this, index)), GetHandle());
341 }
342 
343 template<>
344 inline Interval Resultset::Get<Interval>(const ostring& name) const
345 {
346  return Interval(core::Check(OCI_GetInterval2(*this,name.c_str())), GetHandle());
347 }
348 
349 template<>
350 inline Object Resultset::Get<Object>(unsigned int index) const
351 {
352  return Object(core::Check(OCI_GetObject(*this, index)), GetHandle());
353 }
354 
355 template<>
356 inline Object Resultset::Get<Object>(const ostring& name) const
357 {
358  return Object(core::Check(OCI_GetObject2(*this,name.c_str())), GetHandle());
359 }
360 
361 template<>
362 inline Reference Resultset::Get<Reference>(unsigned int index) const
363 {
364  return Reference(core::Check(OCI_GetRef(*this, index)), GetHandle());
365 }
366 
367 template<>
368 inline Reference Resultset::Get<Reference>(const ostring& name) const
369 {
370  return Reference(core::Check(OCI_GetRef2(*this,name.c_str())), GetHandle());
371 }
372 
373 template<>
374 inline Statement Resultset::Get<Statement>(unsigned int index) const
375 {
376  return Statement(core::Check(OCI_GetStatement(*this, index)), GetHandle());
377 }
378 
379 template<>
380 inline Statement Resultset::Get<Statement>(const ostring& name) const
381 {
382  return Statement(core::Check(OCI_GetStatement2(*this,name.c_str())), GetHandle());
383 }
384 
385 template<>
386 inline Clob Resultset::Get<Clob>(unsigned int index) const
387 {
388  return Clob(core::Check(OCI_GetLob(*this, index)), GetHandle());
389 }
390 
391 template<>
392 inline Clob Resultset::Get<Clob>(const ostring& name) const
393 {
394  return Clob(core::Check(OCI_GetLob2(*this,name.c_str())), GetHandle());
395 }
396 
397 template<>
398 inline NClob Resultset::Get<NClob>(unsigned int index) const
399 {
400  return NClob(core::Check(OCI_GetLob(*this, index)), GetHandle());
401 }
402 
403 template<>
404 inline NClob Resultset::Get<NClob>(const ostring& name) const
405 {
406  return NClob(core::Check(OCI_GetLob2(*this, name.c_str())), GetHandle());
407 }
408 
409 template<>
410 inline Blob Resultset::Get<Blob>(unsigned int index) const
411 {
412  return Blob(core::Check(OCI_GetLob(*this, index)), GetHandle());
413 }
414 
415 template<>
416 inline Blob Resultset::Get<Blob>(const ostring& name) const
417 {
418  return Blob(core::Check(OCI_GetLob2(*this,name.c_str())), GetHandle());
419 }
420 
421 template<>
422 inline File Resultset::Get<File>(unsigned int index) const
423 {
424  return File(core::Check(OCI_GetFile(*this, index)), GetHandle());
425 }
426 
427 template<>
428 inline File Resultset::Get<File>(const ostring& name) const
429 {
430  return File(core::Check(OCI_GetFile2(*this,name.c_str())), GetHandle());
431 }
432 
433 template<>
434 inline Clong Resultset::Get<Clong>(unsigned int index) const
435 {
436  return Clong(core::Check(OCI_GetLong(*this, index)), GetHandle());
437 }
438 
439 template<>
440 inline Clong Resultset::Get<Clong>(const ostring& name) const
441 {
442  return Clong(core::Check(OCI_GetLong2(*this,name.c_str())), GetHandle());
443 }
444 
445 template<>
446 inline Blong Resultset::Get<Blong>(unsigned int index) const
447 {
448  return Blong(core::Check(OCI_GetLong(*this, index)), GetHandle());
449 }
450 
451 template<>
452 inline Blong Resultset::Get<Blong>(const ostring& name) const
453 {
454  return Blong(core::Check(OCI_GetLong2(*this,name.c_str())), GetHandle());
455 }
456 
457 template<class T>
458 T Resultset::Get(unsigned int index) const
459 {
460  return T(core::Check(OCI_GetColl(*this, index)), GetHandle());
461 }
462 
463 template<class T>
464 T Resultset::Get(const ostring& name) const
465 {
466  return T(core::Check(OCI_GetColl2(*this, name.c_str())), GetHandle());
467 }
468 
469 }
Encapsulate a Resultset column or object member properties.
Definition: types.hpp:6867
Database resultset.
Definition: types.hpp:6508
bool Last()
Fetch the last row of the resultset.
Definition: Resultset.hpp:48
unsigned int GetCurrentRow() const
Retrieve the current row index.
Definition: Resultset.hpp:63
Column GetColumn(unsigned int index) const
Return the column from its index in the resultset.
Definition: Resultset.hpp:78
unsigned int GetColumnCount() const
Return the number of columns in the resultset.
Definition: Resultset.hpp:73
unsigned int ForEach(T callback)
Fetch all rows in the resultset and call the given callback for row.
unsigned int GetColumnIndex(const ostring &name) const
Return the index of the column in the result from its name.
Definition: Resultset.hpp:68
bool Seek(SeekMode mode, int offset)
Custom Fetch of the resultset.
Definition: Resultset.hpp:53
bool operator+=(int offset)
Convenient operator overloading that performs a call to Seek() with Resultset::SeekRelative and the g...
Definition: Resultset.hpp:113
T Get(unsigned int index) const
Return the current value of the column at the given index in the resultset.
Definition: Resultset.hpp:458
bool Prev()
Fetch the previous row of the resultset.
Definition: Resultset.hpp:38
bool IsColumnNull(unsigned int index) const
Check if the current row value is null for the column at the given index.
Definition: Resultset.hpp:88
Statement GetStatement() const
Return the statement associated with the resultset.
Definition: Resultset.hpp:98
bool operator++(int)
Convenient operator overloading that performs a call to Next()
Definition: Resultset.hpp:103
bool First()
Fetch the first row of the resultset.
Definition: Resultset.hpp:43
bool Next()
Fetch the next row of the resultset.
Definition: Resultset.hpp:33
bool operator-=(int offset)
Convenient operator overloading that performs a call to Seek() with Resultset::SeekRelative and the g...
Definition: Resultset.hpp:118
bool operator--(int)
Convenient operator overloading that performs a call to Prev()
Definition: Resultset.hpp:108
unsigned int GetCount() const
Retrieve the number of rows fetched so far.
Definition: Resultset.hpp:58
Object used for executing SQL or PL/SQL statement and returning the produced results.
Definition: types.hpp:5559
Template Enumeration template class providing some type safety to some extends for manipulating enume...
Definition: core.hpp:118
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
struct OCI_Resultset OCI_Resultset
Collection of output columns from a select statement.
Definition: types.h:163
OCI_SYM_PUBLIC 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_SYM_PUBLIC unsigned int OCI_API OCI_GetColumnIndex(OCI_Resultset *rs, const otext *name)
Return the index of the column in the result from its name.
OCI_SYM_PUBLIC 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.
OCI_SYM_PUBLIC 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.
OCI_SYM_PUBLIC 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.
OCI_SYM_PUBLIC 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_SYM_PUBLIC 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_SYM_PUBLIC 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_SYM_PUBLIC 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_SYM_PUBLIC 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.
OCI_SYM_PUBLIC 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_SYM_PUBLIC boolean OCI_API OCI_FetchSeek(OCI_Resultset *rs, unsigned int mode, int offset)
Custom Fetch of the resultset.
OCI_SYM_PUBLIC 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_SYM_PUBLIC 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.
OCI_SYM_PUBLIC boolean OCI_API OCI_FetchPrev(OCI_Resultset *rs)
Fetch the previous row of the resultset.
OCI_SYM_PUBLIC 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.
OCI_SYM_PUBLIC 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_SYM_PUBLIC OCI_Statement *OCI_API OCI_ResultsetGetStatement(OCI_Resultset *rs)
Return the statement handle associated with a resultset handle.
OCI_SYM_PUBLIC 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.
OCI_SYM_PUBLIC 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.
OCI_SYM_PUBLIC 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_SYM_PUBLIC OCI_Column *OCI_API OCI_GetColumn2(OCI_Resultset *rs, const otext *name)
Return the column object handle from its name in the resultset.
OCI_SYM_PUBLIC 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_SYM_PUBLIC boolean OCI_API OCI_FetchLast(OCI_Resultset *rs)
Fetch the last row of the resultset.
OCI_SYM_PUBLIC 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.
OCI_SYM_PUBLIC boolean OCI_API OCI_FetchNext(OCI_Resultset *rs)
Fetch the next row of the resultset.
OCI_SYM_PUBLIC 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.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetRowCount(OCI_Resultset *rs)
Retrieve the number of rows fetched so far.
OCI_SYM_PUBLIC 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.
OCI_SYM_PUBLIC 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.
OCI_SYM_PUBLIC 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_SYM_PUBLIC 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_SYM_PUBLIC 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_SYM_PUBLIC 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_SYM_PUBLIC 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.
OCI_SYM_PUBLIC 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_SYM_PUBLIC 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_SYM_PUBLIC 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.
OCI_SYM_PUBLIC 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_SYM_PUBLIC 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_SYM_PUBLIC 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_SYM_PUBLIC 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.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetColumnCount(OCI_Resultset *rs)
Return the number of columns in the resultset.
OCI_SYM_PUBLIC 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_SYM_PUBLIC 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_SYM_PUBLIC 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_SYM_PUBLIC 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.
OCI_SYM_PUBLIC 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.
OCI_SYM_PUBLIC OCI_Column *OCI_API OCI_GetColumn(OCI_Resultset *rs, unsigned int index)
Return the column object handle at the given index in the resultset.
OCI_SYM_PUBLIC boolean OCI_API OCI_FetchFirst(OCI_Resultset *rs)
Fetch the first row of the resultset.
OCI_SYM_PUBLIC 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.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_GetCurrentRow(OCI_Resultset *rs)
Retrieve the current row number.
OCI_SYM_PUBLIC 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.
OCI_SYM_PUBLIC 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_SYM_PUBLIC 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.
OCI_SYM_PUBLIC 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_SYM_PUBLIC 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.
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
Long< Raw, LongBinary > Blong
Class handling LONG RAW oracle type.
Definition: types.hpp:5372
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
Long< ostring, LongCharacter > Clong
Class handling LONG oracle type.
Definition: types.hpp:5361
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.
Definition: types.hpp:4331