OCILIB (C and C++ Driver for Oracle)
4.1.0
|
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 TDataType > | |
TDataType | Get (unsigned int index) const |
Return the current value of the column at the given index in the resultset. More... | |
template<class TDataType > | |
void | Get (unsigned int index, TDataType &value) const |
Assign to the current value of the column at the given index in the resultset. More... | |
template<class TDataType > | |
TDataType | Get (const ostring &name) const |
Return the current value of the column from its name in the resultset. More... | |
template<class TDataType > | |
void | Get (const ostring &name, TDataType &value) const |
Assign to the current value of the column from its name in the resultset. More... | |
template<class TDataType , class TAdapter > | |
bool | Get (TDataType &value, TAdapter 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 TCallback > | |
unsigned int | ForEach (TCallback callback) |
Fetch all rows in the resultset and call the given callback for row. More... | |
template<typename TAdapter , typename TCallback > | |
unsigned int | ForEach (TCallback callback, TAdapter 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 6121 of file ocilib.hpp.
Seek Modes.
Possible values are Resultset::SeekModeValues
Definition at line 6146 of file ocilib.hpp.
Seek Modes enumerated values.
Definition at line 6131 of file ocilib.hpp.
|
inline |
Return the current value of the column at the given index in the resultset.
TDataType | - C++ type of the value to retrieve |
index | - Column position |
Definition at line 5769 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_GetColl().
|
inline |
Assign to the current value of the column at the given index in the resultset.
TDataType | - C++ type of the value to retrieve |
index | - Column position |
value | - value to fill |
Definition at line 5447 of file ocilib_impl.hpp.
|
inline |
Return the current value of the column from its name in the resultset.
TDataType | - C++ type of the value to retrieve |
name | - Column name |
Definition at line 5775 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_GetColl2().
|
inline |
Assign to the current value of the column from its name in the resultset.
TDataType | - C++ type of the value to retrieve |
name | - Column name |
value | - value to fill |
Definition at line 5453 of file ocilib_impl.hpp.
|
inline |
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 |
Definition at line 5459 of file ocilib_impl.hpp.
|
inline |
Fetch all rows in the resultset and call the given callback for row.
callback | - User defined callback |
Definition at line 5465 of file ocilib_impl.hpp.
|
inline |
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 5479 of file ocilib_impl.hpp.
|
inline |
Fetch the next row of the resultset.
Definition at line 5356 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_FetchNext().
|
inline |
Fetch the previous row of the resultset.
Definition at line 5361 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_FetchPrev().
|
inline |
Fetch the first row of the resultset.
Definition at line 5366 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_FetchFirst().
|
inline |
Fetch the last row of the resultset.
Definition at line 5371 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 5376 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_FetchSeek().
|
inline |
Retrieve the current row index.
Definition at line 5386 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 5391 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 5401 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 5406 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 5411 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 5416 of file ocilib_impl.hpp.
References ocilib::Check(), and OCI_IsNull2().