#include <SQLDBC.h>
Inheritance diagram for SQLDBC::SQLDBC_RowSet:
A SQLDBC row set is a window on a result set.
The size of the row set is determined by the setRowSetSize() method of the SQLDBC_ResultSet object. The method fetch retrieves the rows from the SQLDBC_RowSet object into the bound columns. The getObject() method retrieves one column from the current row into the given buffer. The setPos() method moves the cursor within the row set.
Definition at line 769 of file SQLDBC.h.
|
|
|
Deletes the error has been stored.
|
|
Deletes the warning stored in the SQLWarning object.
|
|
Returns a reference to the ErrorHndl object.
|
|
Writes the retrieved data to the bound columns.
|
|
Retrieves and converts the value with an start offset in of the specified column from a of the current row to a buffer. The specified column value in the current row of this SQLDBC_RowSet object is converted to the given length and SQLDBC_HostType and written to the output parameter buffer pointed to paramAddr. It can be called multiple times to retrieve character or binary data in parts. For fixed-length datatypes getObject retrieves the same data multiple times. Mixing variable-length datatypes and fixed-length datatypes may produce unexpected results. The current row may be set by a positioning command from SQLDBC_ResultSet (current row = 1) or by the setPos method of the SQLDBC_RowSet object.
|
|
Retrieves and converts the value of the specified column of the current row to a buffer. The specified column value in the current row of this SQLDBC_RowSet object is converted to the given length and SQLDBC_HostType and written to the output parameter buffer pointed to paramAddr. It can be called multiple times to retrieve character or binary data in parts. For fixed-length datatypes getObject retrieves the same data multiple times. Mixing variable-length datatypes and fixed-length datatypes may produce unexpected results. The current row may be set by a positioning command from SQLDBC_ResultSet (current row = 1) or by the setPos method of the SQLDBC_RowSet object.
|
|
Returns the number of rows written to the bound parameters.
|
|
Returns the row status array for the last fetch call. The row status array describes the state of each row. The maximum size of the row status array is given by the setRowSetSize(). The row status array is filled during the fetch() call. The return code of the first row matches to the first member of the row status array.
|
|
Sets the cursor to row pos in the SQLDBC_RowSet.
|
|
Returns a reference to an SQLWarning object stored in the SQLDBC_ConnectionItem object.
|
|
A class for presenting a database result set. A database result set is generated by executing an SQL statement that queries the database. Select statements, catalog functions, and some procedures create result sets. For example, the following SQL statement creates a result set containing all the rows and columns of the table DUAL:
A result set can be empty, which is different from there being no result set at all. For example, the following SQL statement creates an empty result set:
An SQLDBC_ResultSet object 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, and as it returns SQLDBC_NO_DATA_FOUND when there are no more rows in the SQLDBC_ResultSet object, it can be used in a WHILE loop to iterate the result set. Example for creating an SQLDBC_ResultSet object:
To reduce the time needed for retrieving the data from the database, the SQLDBC_ResultSet class supports so called block cursors, which can return more than one row at a time. The rows returned by a block cursor are called a 'row set'. The result set is fixed, the rowset is not. It changes position and contents each time a new set of rows is retrieved from the database. With block cursors, the method setRowSetSize() must be used with a parameter greater than 1. Navigation within the data represented by the SQLDBC_ResultSet object is possible using of navigation methods like first(), next(), previous(), relative() etc. When block cursors are used, after applying the navigation methods, the cursor points to the actual row set. For example assuming a result set size of 50 and a rowset size of 10, in the following sequence the block cursor points to the rows indicated:
In order to perform operations that operate on a single row only when multiple rows have been fetched, the application must indicate which row is the current row. When a block cursor first returns a row set, the current row is the first row of that row set. To change the current row, the application must call the member function setPos(). The data of a certain column in the current row can be retrieved by calling the method getObject(). Data fetched from the database is passed on to the application in variables that the application has allocated for this purpose. Before fetching the data from the database, the application bind these variables to the columns of the result set. Applications can bind any number of columns of the result set, including binding no columns at all. Binding of columns is done by calling to the member function bindColumn(). The column binding valid for all rows. After positioning the cursor through navigation methods, the data from the database is written into the bound column variables by a call to the member function fetch() of the row set of this result set. When block cursors are used, the number of rows actually filled can be determined with the member function getResultCount(). For unbounded columns, data can be written into application variables with getObject(), or - in case of block cursors - by calling setPos() on the rowset and then calling getObject(). Reimplemented from SQLDBC::SQLDBC_ConnectionItem. |
|
Reimplemented in SQLDBC::SQLDBC_UpdatableRowSet. |