|
virtual | ~ResultSet () |
|
const dtBOOLEAN | Absolute (dtLARGE) |
|
void | AfterLast () |
|
void | BeforeFirst () |
|
void | Close () |
|
dtRtnStatus | BindColumn (dtULARGE columnIndex, dtSTRING *value, dtULARGE length, dtTINY *indicator=NULL) |
|
dtRtnStatus | BindColumn (dtULARGE columnIndex, dtUSTRING *value, dtULARGE length, dtTINY *indicator=NULL) |
|
template<class T > |
dtRtnStatus | BindColumn (dtULARGE columnIndex, T *value, dtTINY *indicator=NULL) |
|
dtRtnStatus | BindColumn (dtSTRING *columnLabel, dtSTRING *value, dtULARGE length, dtTINY *indicator=NULL) |
|
template<class T > |
dtRtnStatus | BindColumn (dtSTRING *columnLabel, T *value, dtTINY *indicator=NULL) |
|
ResultSetColumnMetaData * | GetColumnMetaData (dtULARGE) |
|
const dtSTRING * | GetCursorName () |
|
const dtLARGE | GetFetchDirection () |
|
const dtULARGE | GetFetchSize () |
|
const dtLARGE | GetFetchType () |
|
dtULARGE | GetNumberResultColumns () |
|
const dtULARGE | GetRow () |
|
Statement * | GetStatement () |
|
dtRtnStatus | GetValue (dtULARGE columnIndex, dtSTRING *value, dtULARGE length, dtTINY *indicator=NULL) |
|
dtRtnStatus | GetValue (dtULARGE columnIndex, dtUSTRING *value, dtULARGE length, dtTINY *indicator=NULL) |
|
template<class T > |
dtRtnStatus | GetValue (dtULARGE columnIndex, T *value, dtTINY *indicator=NULL) |
|
dtRtnStatus | GetValue (dtSTRING *columnLabel, dtSTRING *value, dtULARGE length, dtTINY *indicator=NULL) |
|
template<class T > |
dtRtnStatus | GetValue (dtSTRING *columnLabel, T *value, dtTINY *indicator=NULL) |
|
const dtBOOLEAN | HasError () |
|
const dtBOOLEAN | IsAfterLast () |
|
const dtBOOLEAN | IsBeforeFirst () |
|
const dtBOOLEAN | IsCachingEnabled () |
|
const dtBOOLEAN | IsClosed () |
|
const dtBOOLEAN | IsLast () |
|
const dtBOOLEAN | Last () |
|
const dtBOOLEAN | Next () |
|
const dtBOOLEAN | Previous () |
|
const dtBOOLEAN | Relative (dtLARGE) |
|
dtRtnStatus | SetCachingEnabled (const dtBOOLEAN=TRUE) |
|
dtRtnStatus | SetFetchSize (dtULARGE) |
|
dtRtnStatus | SetFetchType (const dtLARGE) |
|
dtRtnStatus | SetServerFetchType (const dtLARGE) |
|
| cdbBase (cdbBase *, ccdbClassType, dtBOOLEAN=TRUE) |
|
virtual | ~cdbBase () |
|
cdb_childList_t & | GetChildList () |
|
Ccoms_CommsManager * | GetTransportComms () |
|
ccdbClassType | GetType () |
|
void | SetTransportComms (Ccoms_CommsManager *) |
|
A ResultSet provides access to a table of data.
A ResultSet object is usually generated by executing a Statement.
A ResultSet maintains a cursor pointing to its current row of
data. Initially the cursor is positioned before the first row.
The 'Next' method moves the cursor to the next row.
The GetXXX methods retrieve column values for the current
row. You can retrieve values either using the index number of the
column, or by using the name of the column. In general using the
column index will be more efficient. Columns are numbered from 1.
For maximum portability, ResultSet columns within each row should be
read in left-to-right order and each column should be read only once.
Column names used as input to GetXXX methods are case
insensitive. When performing a GetXXX using a column name, if
several columns have the same name, then the value of the first
matching column will be returned. The column name option is
designed to be used when column names are used in the SQL
query. For columns that are NOT explicitly named in the query, it
is best to use column numbers. If column names were used there is
no way for the programmer to guarantee that they actually refer to
the intended columns.
A ResultSet is automatically closed by the Statement that
generated it when that Statement is closed, re-executed, or is used
to retrieve the next result from a sequence of multiple results.
The number, types and properties of a ResultSet's columns are
provided by the ResultSetColumnMetaData object returned by the
<code>GetColumnMetaData()</code> method.
A DatabaseException will be thrown if a database error occurs and exceptions
are enabled. If exceptions are not enabled the following error methods can
be used to get information about the error;
<ul>
<li>GetErrorStatus()
<li>GetErrorCode()
<li>GetErrorMessage()
</ul>
@see Statement::Execute()
- See also
- ResultSetColumnMetaData()
- Since
- Version 1.0
const dtBOOLEAN dbSpaces::dbcli::ResultSet::Absolute |
( |
dtLARGE |
| ) |
|
Moves the cursor to the given row number in this ResultSet object.
If the row number is positive, the cursor moves to the given row number with respect to the beginning of the result set. The first row is row 1, the second is row 2, and so on.
If the given row number is negative, the cursor moves to an absolute row position with respect to the end of the result set. For example, calling the method absolute(-1)
positions the cursor on the last row; calling the method absolute(-2)
moves the cursor to the next-to-last row, and so on.
An attempt to position the cursor beyond the first/last row in the result set leaves the cursor before the first row or after the last row.
Note: Calling absolute(1)
is the same as calling first()
. Calling absolute(-1)
is the same as calling last()
.
- Parameters
-
row | The number of the row to which the cursor should move. A positive number indicates the row number counting from the beginning of the result set; a negative number indicates the row number counting from the end of the result set |
- Returns
TRUE
if the cursor is moved to a position in this ResultSet object; FALSE
if the cursor is before the first row or after the last row
- Exceptions
-
DatabaseException | (if exceptions are enabled) when a database error occurs; this method is called on a closed result set or the result set type is RESULTSET_TYPE_FORWARD_ONLY . |
- Since
- Version 1.0
dtRtnStatus dbSpaces::dbcli::ResultSet::BindColumn |
( |
dtSTRING * |
columnLabel, |
|
|
dtSTRING * |
value, |
|
|
dtULARGE |
length, |
|
|
dtTINY * |
indicator = NULL |
|
) |
| |
|
inline |
Bind a program variable to the column. Bound columns have their variables populated with data when rows are fetched from the database.
If the column is a multi-value (array) then the value
and indicator
variables should be large enough to contain all multi-values.
For example, if the storage class is a dtLARGE (size of 4 bytes) and the column has 2 multi-values, then value
will be 8 bytes in size. The first 4 bytes contains the first value and the second 4 bytes contains the second value. Similarly for indicator
its size will be 2 bytes, the first byte contains the indicator value for the first value and the second byte contains the indicator value for the second value.
- Parameters
-
columnLabel | The column label. |
value | Value(s) address. |
length | The length in bytes of the value. |
indicator | Indicator(s) address used to indicate NOT NULL or NULL data.
Possible indicator values are;
-
1 - (CTYPE_NOT_NULL) not null data.
-
2 - (CTYPE_NULL) null data.
|
- Note
- The indicator parameter is optional.
- Returns
- RTN_STATUS_SUCCESS or RTN_STATUS_ERROR.
- Since
- Version 1.0
template<class T >
dtRtnStatus dbSpaces::dbcli::ResultSet::BindColumn |
( |
dtSTRING * |
columnLabel, |
|
|
T * |
value, |
|
|
dtTINY * |
indicator = NULL |
|
) |
| |
|
inline |
Bind a program variable to the column. Bound columns have their variables populated with data when rows are fetched from the database.
If the column is a multi-value (array) then the value
and indicator
variables should be large enough to contain all multi-values.
For example, if the storage class is a dtLARGE (size of 4 bytes) and the column has 2 multi-values, then value
will be 8 bytes in size. The first 4 bytes contains the first value and the second 4 bytes contains the second value. Similarly for indicator
its size will be 2 bytes, the first byte contains the indicator value for the first value and the second byte contains the indicator value for the second value.
- Parameters
-
columnLabel | The column label. |
value | Value(s) address. |
indicator | Indicator(s) address used to indicate NOT NULL or NULL data.
Possible indicator values are;
-
1 - (CTYPE_NOT_NULL) not null data.
-
2 - (CTYPE_NULL) null data.
|
- Note
- The indicator parameter is optional.
- Returns
- RTN_STATUS_SUCCESS or RTN_STATUS_ERROR.
- Since
- Version 1.0
dtRtnStatus dbSpaces::dbcli::ResultSet::BindColumn |
( |
dtULARGE |
columnIndex, |
|
|
dtSTRING * |
value, |
|
|
dtULARGE |
length, |
|
|
dtTINY * |
indicator = NULL |
|
) |
| |
|
inline |
Bind a program variable to the column. Bound columns have their variables populated with data when rows are fetched from the database.
If the column is a multi-value (array) then the value
and indicator
variables should be large enough to contain all multi-values.
For example, if the storage class is a dtLARGE (size of 4 bytes) and the column has 2 multi-values, then value
will be 8 bytes in size. The first 4 bytes contains the first value and the second 4 bytes contains the second value. Similarly for indicator
its size will be 2 bytes, the first byte contains the indicator value for the first value and the second byte contains the indicator value for the second value.
- Parameters
-
columnIndex | The column index (ordinal position) starting from 1. |
value | Value(s) address. |
length | The length in bytes of the value. |
indicator | Indicator(s) address used to indicate NOT NULL or NULL data.
Possible indicator values are;
-
1 - (CTYPE_NOT_NULL) not null data.
-
2 - (CTYPE_NULL) null data.
|
- Note
- The indicator parameter is optional.
- Returns
- RTN_STATUS_SUCCESS or RTN_STATUS_ERROR.
- Since
- Version 1.0
template<class T >
dtRtnStatus dbSpaces::dbcli::ResultSet::BindColumn |
( |
dtULARGE |
columnIndex, |
|
|
T * |
value, |
|
|
dtTINY * |
indicator = NULL |
|
) |
| |
|
inline |
Bind a program variable to the column. Bound columns have their variables populated with data when rows are fetched from the database.
If the column is a multi-value (array) then the value
and indicator
variables should be large enough to contain all multi-values.
For example, if the storage class is a dtLARGE (size of 4 bytes) and the column has 2 multi-values, then value
will be 8 bytes in size. The first 4 bytes contains the first value and the second 4 bytes contains the second value. Similarly for indicator
its size will be 2 bytes, the first byte contains the indicator value for the first value and the second byte contains the indicator value for the second value.
- Parameters
-
columnIndex | The column index (ordinal position) starting from 1. |
value | Value(s) address. |
indicator | Indicator(s) address used to indicate NOT NULL or NULL data.
Possible indicator values are;
-
1 - (CTYPE_NOT_NULL) not null data.
-
2 - (CTYPE_NULL) null data.
|
- Note
- The indicator parameter is optional.
- Returns
- RTN_STATUS_SUCCESS or RTN_STATUS_ERROR.
- Since
- Version 1.0
const dtBOOLEAN dbSpaces::dbcli::ResultSet::Previous |
( |
| ) |
|
Moves the cursor to the previous row in this ResultSet object.
When a call to the previous
method returns false
, the cursor is positioned before the first row. Any invocation of a ResultSet method which requires a current row will result in a DatabaseException
being thrown.
If an input stream is open for the current row, a call to the method previous
will implicitly close it. A ResultSet object's warning change is cleared when a new row is read.
- Returns
TRUE
if the cursor is now positioned on a valid row; FALSE
if the cursor is positioned before the first row.
- Exceptions
-
DatabaseException | (if exceptions are enabled) when a database error occurs; this method is called on a closed result set or the result set type is RESULT_TYPE_FORWARD_ONLY . |
- Since
- Version 1.0