23 #include "ocilibcpp/types.hpp"
28 inline Resultset::Resultset(
OCI_Resultset *resultset, core::Handle *parent)
30 AcquireTransient(resultset, parent);
126 value = Get<T>(index);
132 value = Get<T>(name);
135 template<
class T,
class TAdapter>
138 return adapter(
static_cast<const Resultset&
>(*
this), value);
141 template<
class TCallback>
146 if (!callback(
static_cast<const Resultset&
>(*
this)))
155 template<
class T,
class U>
160 if (!callback(adapter(
static_cast<const Resultset&
>(*
this))))
170 inline short Resultset::Get<short>(
unsigned int index)
const
176 inline short Resultset::Get<short>(
const ostring& name)
const
182 inline unsigned short Resultset::Get<unsigned short>(
unsigned int index)
const
188 inline unsigned short Resultset::Get<unsigned short>(
const ostring& name)
const
194 inline int Resultset::Get<int>(
unsigned int index)
const
200 inline int Resultset::Get<int>(
const ostring& name)
const
206 inline unsigned int Resultset::Get<unsigned int>(
unsigned int index)
const
212 inline unsigned int Resultset::Get<unsigned int>(
const ostring& name)
const
218 inline big_int Resultset::Get<big_int>(
unsigned int index)
const
230 inline big_uint Resultset::Get<big_uint>(
unsigned int index)
const
236 inline big_uint Resultset::Get<big_uint>(
const ostring& name)
const
242 inline float Resultset::Get<float>(
unsigned int index)
const
248 inline float Resultset::Get<float>(
const ostring& name)
const
254 inline double Resultset::Get<double>(
unsigned int index)
const
260 inline double Resultset::Get<double>(
const ostring& name)
const
266 inline Number Resultset::Get<Number>(
unsigned int index)
const
272 inline Number Resultset::Get<Number>(
const ostring& name)
const
278 inline ostring Resultset::Get<ostring>(
unsigned int index)
const
290 inline Raw Resultset::Get<Raw>(
unsigned int index)
const
294 core::ManagedBuffer<unsigned char> buffer(
static_cast<size_t>(size + 1));
302 inline Raw Resultset::Get<Raw>(
const ostring& name)
const
306 core::ManagedBuffer<unsigned char> buffer(
static_cast<size_t>(size + 1));
314 inline Date Resultset::Get<Date>(
unsigned int index)
const
320 inline Date Resultset::Get<Date>(
const ostring& name)
const
326 inline Timestamp Resultset::Get<Timestamp>(
unsigned int index)
const
332 inline Timestamp Resultset::Get<Timestamp>(
const ostring& name)
const
338 inline Interval Resultset::Get<Interval>(
unsigned int index)
const
344 inline Interval Resultset::Get<Interval>(
const ostring& name)
const
350 inline Object Resultset::Get<Object>(
unsigned int index)
const
356 inline Object Resultset::Get<Object>(
const ostring& name)
const
362 inline Reference Resultset::Get<Reference>(
unsigned int index)
const
368 inline Reference Resultset::Get<Reference>(
const ostring& name)
const
374 inline Statement Resultset::Get<Statement>(
unsigned int index)
const
380 inline Statement Resultset::Get<Statement>(
const ostring& name)
const
386 inline Clob Resultset::Get<Clob>(
unsigned int index)
const
392 inline Clob Resultset::Get<Clob>(
const ostring& name)
const
398 inline NClob Resultset::Get<NClob>(
unsigned int index)
const
404 inline NClob Resultset::Get<NClob>(
const ostring& name)
const
410 inline Blob Resultset::Get<Blob>(
unsigned int index)
const
416 inline Blob Resultset::Get<Blob>(
const ostring& name)
const
422 inline File Resultset::Get<File>(
unsigned int index)
const
428 inline File Resultset::Get<File>(
const ostring& name)
const
434 inline Clong Resultset::Get<Clong>(
unsigned int index)
const
440 inline Clong Resultset::Get<Clong>(
const ostring& name)
const
446 inline Blong Resultset::Get<Blong>(
unsigned int index)
const
452 inline Blong Resultset::Get<Blong>(
const ostring& name)
const
Encapsulate a Resultset column or object member properties.
bool Last()
Fetch the last row of the resultset.
unsigned int GetCurrentRow() const
Retrieve the current row index.
Column GetColumn(unsigned int index) const
Return the column from its index in the resultset.
unsigned int GetColumnCount() const
Return the number of columns in the resultset.
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.
bool Seek(SeekMode mode, int offset)
Custom Fetch of the resultset.
bool operator+=(int offset)
Convenient operator overloading that performs a call to Seek() with Resultset::SeekRelative and the g...
T Get(unsigned int index) const
Return the current value of the column at the given index in the resultset.
bool Prev()
Fetch the previous row of the resultset.
bool IsColumnNull(unsigned int index) const
Check if the current row value is null for the column at the given index.
Statement GetStatement() const
Return the statement associated with the resultset.
bool operator++(int)
Convenient operator overloading that performs a call to Next()
bool First()
Fetch the first row of the resultset.
bool Next()
Fetch the next row of the resultset.
bool operator-=(int offset)
Convenient operator overloading that performs a call to Seek() with Resultset::SeekRelative and the g...
bool operator--(int)
Convenient operator overloading that performs a call to Prev()
unsigned int GetCount() const
Retrieve the number of rows fetched so far.
Object used for executing SQL or PL/SQL statement and returning the produced results.
Template Enumeration template class providing some type safety to some extends for manipulating enume...
long long big_int
big_int is a C scalar integer (32 or 64 bits) depending on compiler support for 64bits integers....
struct OCI_Resultset OCI_Resultset
Collection of output columns from a select statement.
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,...
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 )
Long< Raw, LongBinary > Blong
Class handling LONG RAW oracle type.
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.
Long< ostring, LongCharacter > Clong
Class handling LONG oracle type.
Lob< Raw, LobBinary > Blob
Class handling BLOB oracle type.