Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

SQLDBC::SQLDBC_RowSet Class Reference

#include <SQLDBC.h>

Inheritance diagram for SQLDBC::SQLDBC_RowSet:

SQLDBC::SQLDBC_ConnectionItem List of all members.

Detailed Description

An SQLDBC_RowSet class for representing a SQLDBC row set.

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 578 of file SQLDBC.h.

Public Methods


Member Function Documentation

void SQLDBC::SQLDBC_ConnectionItem::clearError   [inherited]
 

Deletes the error has been stored.

void SQLDBC::SQLDBC_ConnectionItem::clearWarnings   [inherited]
 

Deletes the warning stored in the SQLWarning object.

SQLDBC_ErrorHndl& SQLDBC::SQLDBC_ConnectionItem::error   [inherited]
 

Returns a reference to the ErrorHndl object.

Returns:
An SQLDBC_ErrorHndl object.

SQLDBC_Retcode SQLDBC::SQLDBC_RowSet::fetch  
 

Writes the retrieved data to the bound columns.

Returns:
SQLDBC_OK if successful; SQLDBC_NOT_OK otherwise

SQLDBC_Retcode SQLDBC::SQLDBC_RowSet::getObject const SQLDBC_Int4    Index,
const SQLDBC_HostType    Type,
void *    paramAddr,
SQLDBC_Length   LengthIndicator,
const SQLDBC_Length    Size,
const SQLDBC_Bool    Terminate = SQLDBC_TRUE
 

Retrieves the content of the specified column.

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. 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.

Parameters:
Index Index of the column. The first column is column number 1, the second is column number 2, ...
Type Parameter type of the output buffer.
paramAddr A pointer to the parameters output buffer.
LengthIndicator [out] Pointer to a variable that stores the column length or the indicator value SQLDBC_NULL_DATA if the column contains the NULL value. For character data it contains on success the number of bytes copied to the buffer, except the number of bytes necessary for the zero-terminator, if the Terminate flag was set. If the source string exceeds the Size value SQLDBC_DATA_TRUNC will be returned and LengthIndicator is set to the number of bytes (except the terminator bytes) needed to copy without truncation.
Size [in] Length of the parameter buffer in bytes. The Size argument is only neccessary for non-integral datatypes. For character data the Size argument must be large enough to store the terminator byte(s) if the Terminate flag is set.
Terminate [in] Specifies that the output buffer must be finished with a C-style zero-terminator. The Terminate flag works only for the hostvar type character (ASCII, UCS2 or UTF8). As a default, all character data is zero-terminated.
Returns:
SQLDBC_OK on success SQLDBC_DATA_TRUNC if the output buffer was too small. SQLDBC_NOT_OK if a database access or conversion error occursed. In this case an error is set on this SQLDBC_RowSet object.
See also:
bindColumn

const SQLDBC_Int4 SQLDBC::SQLDBC_RowSet::getRowsAffected   const
 

Returns the number of rows written to the bound parameters.

Returns:
The number of rows fetched with the last fetch() call.
Note:
The number of fetched rows is updated by the next fetch() call. Positioning of the cursor within result set with SQLDBC_ResultSet::next(), SQLDBC_ResultSet::first(), ... does not change the number of rows.

SQLDBC_Retcode SQLDBC::SQLDBC_RowSet::setPos SQLDBC_UInt4    pos
 

Sets the cursor to row pos in the SQLDBC_RowSet.

Parameters:
pos Row number within the row set. The first row of a row set is row number one.
Returns:
SQLDBC_OK if the cursor is positioned on a row; SQLDBC_NO_DATA_FOUND otherwise; SQLDBC_NOT_OK if a database access error occurs or the result set type is FORWARD_ONLY.

SQLDBC_SQLWarning* SQLDBC::SQLDBC_ConnectionItem::warning   [inherited]
 

Returns a reference to an SQLWarning object stored in the SQLDBC_ConnectionItem object.

Returns:
The SQLWarning object stored in the item.


Friends And Related Function Documentation

friend class SQLDBC_ResultSet [friend]
 

Reimplemented from SQLDBC::SQLDBC_ConnectionItem.

Definition at line 666 of file SQLDBC.h.

friend struct SQLDBC_ResultSetStorage [friend]
 

Definition at line 667 of file SQLDBC.h.


The documentation for this class was generated from the following file: