OCILIB (C and C++ Driver for Oracle)
4.6.3
|
Database resultset. More...
#include <ocilib.hpp>
Inherits ocilib::HandleHolder< OCI_Resultset *>.
Public Types | |
enum | SeekModeValues { SeekAbsolute = OCI_SFD_ABSOLUTE, SeekRelative = OCI_SFD_RELATIVE } |
Seek Modes enumerated values. More... | |
typedef Enum< SeekModeValues > | SeekMode |
Seek Modes. More... | |
Public Member Functions | |
template<class T > | |
T | Get (unsigned int index) const |
Return the current value of the column at the given index in the resultset. More... | |
template<class T > | |
void | Get (unsigned int index, T &value) const |
Assign to the current value of the column at the given index in the resultset. More... | |
template<class T > | |
T | Get (const ostring &name) const |
Return the current value of the column from its name in the resultset. More... | |
template<class T > | |
void | Get (const ostring &name, T &value) const |
Assign to the current value of the column from its name in the resultset. More... | |
template<class T , class U > | |
bool | Get (T &value, U adapter) const |
Return a given user type from the current fetched row. It allow translating row column values returned by a query to a user defined type using the given adapter type. More... | |
template<typename T > | |
unsigned int | ForEach (T callback) |
Fetch all rows in the resultset and call the given callback for row. More... | |
template<typename T , typename U > | |
unsigned int | ForEach (T callback, U adapter) |
Fetch all rows in the resultset and call the given callback for row It allow translating row column values returned by a query to a user defined type using the given adapter type. More... | |
bool | Next () |
Fetch the next row of the resultset. More... | |
bool | Prev () |
Fetch the previous row of the resultset. More... | |
bool | First () |
Fetch the first row of the resultset. More... | |
bool | Last () |
Fetch the last row of the resultset. More... | |
bool | Seek (SeekMode mode, int offset) |
Custom Fetch of the resultset. More... | |
unsigned int | GetCount () const |
Retrieve the number of rows fetched so far. | |
unsigned int | GetCurrentRow () const |
Retrieve the current row index. More... | |
unsigned int | GetColumnIndex (const ostring &name) const |
Return the index of the column in the result from its name. More... | |
unsigned int | GetColumnCount () const |
Return the number of columns in the resultset. | |
Column | GetColumn (unsigned int index) const |
Return the column from its index in the resultset. More... | |
Column | GetColumn (const ostring &name) const |
Return the column from its name in the resultset. More... | |
bool | IsColumnNull (unsigned int index) const |
Check if the current row value is null for the column at the given index. More... | |
bool | IsColumnNull (const ostring &name) const |
Check if the current row value is null for the column of the given name. More... | |
Statement | GetStatement () const |
Return the statement associated with the resultset. | |
bool | operator++ (int) |
Convenient operator overloading that performs a call to Next() | |
bool | operator-- (int) |
Convenient operator overloading that performs a call to Prev() | |
bool | operator+= (int offset) |
Convenient operator overloading that performs a call to Seek() with Resultset::SeekRelative and the given offset. | |
bool | operator-= (int offset) |
Convenient operator overloading that performs a call to Seek() with Resultset::SeekRelative and the given offset that is internally negated. | |
Database resultset.
This class wraps the OCILIB object handle OCI_Resultset and its related methods
Definition at line 6638 of file ocilib.hpp.
Seek Modes.
Possible values are Resultset::SeekModeValues
Definition at line 6663 of file ocilib.hpp.
Seek Modes enumerated values.
Definition at line 6648 of file ocilib.hpp.
T ocilib::Resultset::Get | ( | unsigned int | index | ) | const |
Return the current value of the column at the given index in the resultset.
T | - C++ type of the value to retrieve |
index | - Column position |
Definition at line 6530 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_GetColl().
Referenced by Get().
void ocilib::Resultset::Get | ( | unsigned int | index, |
T & | value | ||
) | const |
Assign to the current value of the column at the given index in the resultset.
T | - C++ type of the value to retrieve |
index | - Column position |
value | - value to fill |
Definition at line 6196 of file ocilib_impl.hpp.
T ocilib::Resultset::Get | ( | const ostring & | name | ) | const |
Return the current value of the column from its name in the resultset.
T | - C++ type of the value to retrieve |
name | - Column name |
Definition at line 6536 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_GetColl2().
void ocilib::Resultset::Get | ( | const ostring & | name, |
T & | value | ||
) | const |
Assign to the current value of the column from its name in the resultset.
T | - C++ type of the value to retrieve |
name | - Column name |
value | - value to fill |
Definition at line 6202 of file ocilib_impl.hpp.
bool ocilib::Resultset::Get | ( | T & | value, |
U | adapter | ||
) | const |
Return a given user type from the current fetched row. It allow translating row column values returned by a query to a user defined type using the given adapter type.
value | - User defined type value to be filled by the adapter function |
adapter | - User defined adapter function |
unsigned int ocilib::Resultset::ForEach | ( | T | callback | ) |
Fetch all rows in the resultset and call the given callback for row.
callback | - User defined callback |
Referenced by ocilib::Statement::Execute(), and Get().
unsigned int ocilib::Resultset::ForEach | ( | T | callback, |
U | adapter | ||
) |
Fetch all rows in the resultset and call the given callback for row It allow translating row column values returned by a query to a user defined type using the given adapter type.
callback | - User defined callback |
adapter | - User defined adapter function |
Definition at line 6228 of file ocilib_impl.hpp.
References ocilib::Check(), ocilib::MakeRaw(), ocilib::MakeString(), OCI_GetBigInt(), OCI_GetBigInt2(), OCI_GetColumnIndex(), OCI_GetDataLength(), OCI_GetDate(), OCI_GetDate2(), OCI_GetDouble(), OCI_GetDouble2(), OCI_GetFile(), OCI_GetFile2(), OCI_GetFloat(), OCI_GetFloat2(), OCI_GetInt(), OCI_GetInt2(), OCI_GetInterval(), OCI_GetInterval2(), OCI_GetLob(), OCI_GetLob2(), OCI_GetLong(), OCI_GetLong2(), OCI_GetNumber(), OCI_GetNumber2(), OCI_GetObject(), OCI_GetObject2(), OCI_GetRaw(), OCI_GetRaw2(), OCI_GetRef(), OCI_GetRef2(), OCI_GetShort(), OCI_GetShort2(), OCI_GetStatement(), OCI_GetStatement2(), OCI_GetString(), OCI_GetString2(), OCI_GetTimestamp(), OCI_GetTimestamp2(), OCI_GetUnsignedBigInt(), OCI_GetUnsignedBigInt2(), OCI_GetUnsignedInt(), OCI_GetUnsignedInt2(), OCI_GetUnsignedShort(), and OCI_GetUnsignedShort2().
|
inline |
Fetch the next row of the resultset.
Definition at line 6105 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_FetchNext().
|
inline |
Fetch the previous row of the resultset.
Definition at line 6110 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_FetchPrev().
|
inline |
Fetch the first row of the resultset.
Definition at line 6115 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_FetchFirst().
|
inline |
Fetch the last row of the resultset.
Definition at line 6120 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_FetchLast().
|
inline |
Custom Fetch of the resultset.
mode | - Fetch direction |
offset | - Fetch offset |
Definition at line 6125 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_FetchSeek().
|
inline |
Retrieve the current row index.
Definition at line 6135 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_GetCurrentRow().
|
inline |
Return the index of the column in the result from its name.
name | - Column name |
Definition at line 6140 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_GetColumnIndex().
|
inline |
Return the column from its index in the resultset.
index | - Column index |
Definition at line 6150 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_GetColumn().
Return the column from its name in the resultset.
name | - Column name |
Definition at line 6155 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_GetColumn2().
|
inline |
Check if the current row value is null for the column at the given index.
index | - Column index |
Definition at line 6160 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_IsNull().
|
inline |
Check if the current row value is null for the column of the given name.
name | - Column name |
Definition at line 6165 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_IsNull2().