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

SQLDBC::SQLDBC_UpdatableRowSet Class Reference

Inheritance diagram for SQLDBC::SQLDBC_UpdatableRowSet:

SQLDBC::SQLDBC_RowSet SQLDBC::SQLDBC_ConnectionItem List of all members.

Detailed Description

A SQLDBC_UpdatableRowSet class for representing a SQLDBC updatable row set.

A SQLDBC updatable row set offers update, insert and delete operations on the underlying result set.

The insertAllRows() and insertOneRow() methods allow inserting either a whole row set or a single row (the first one) of the row set into the parent result set. The method updateRow() updates an arbitrary row of the result set while the method deleteRow() deletes a single row on a given position. The method insertRow() does insert a single row by using the data at the given position.

If the position supplied to insertRow(), updateRow(), or deleteRow() is zero, the insert/update/delete operation is executed for the whole row set.

Definition at line 1222 of file SQLDBC.h.

Public Member Functions


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_Retcode SQLDBC::SQLDBC_UpdatableRowSet::deleteRow int  position  ) 
 

SQLDBC_Retcode SQLDBC::SQLDBC_UpdatableRowSet::deleteRow SQLDBC_UInt4  position  ) 
 

Deletes a single row of the row set at a given position.

Parameters:
position Position in the row set which row has to be deleted.
Returns:
SQLDBC_OK if the row is deleted; SQLDBC_NOT_OK if a database access error occurs or the result set type is FORWARD_ONLY.

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

Returns a reference to the ErrorHndl object.

Note:
Applications should retrieve the content of the SQLDBC_ErrorHndl object immediatly since an new call to any SQLDBC function except the warning() method will empty SQLDBC_ErrorHndl object.
Returns:
An SQLDBC_ErrorHndl object.

SQLDBC_Retcode SQLDBC::SQLDBC_RowSet::fetch  )  [inherited]
 

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,
SQLDBC_Length  StartPos,
const SQLDBC_Bool  Terminate = SQLDBC_TRUE
[inherited]
 

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.

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 necessary for non-integral data types. For character data the Size argument must be large enough to store the terminator byte(s) if the Terminate flag is set.
StartPos [in] Start position in the column from which on the data should be retrieved. Start position is counted in bytes from 1. Negative StartPos counts from the end of the column.
Terminate [in] Specifies that the output buffer must be finished with a C-style zero-terminator. The Terminate flag works only for the host var 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 occurred. In this case an error is set on this SQLDBC_RowSet object.
See also:
bindColumn

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
[inherited]
 

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.

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 necessary for non-integral data types. 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 host var 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 occurred. In this case an error is set on this SQLDBC_RowSet object.
See also:
bindColumn

const SQLDBC_Int4 SQLDBC::SQLDBC_RowSet::getRowsAffected  )  const [inherited]
 

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.

const SQLDBC_Int4* SQLDBC::SQLDBC_RowSet::getRowStatus  )  const [inherited]
 

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.

Returns:
A pointer to the first element of the row status array.
See also:
setRowSetSize(), getRowsAffected

SQLDBC_Retcode SQLDBC::SQLDBC_UpdatableRowSet::insertAllRows  ) 
 

Performs a mass insert of the whole row set into the result set.

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_Retcode SQLDBC::SQLDBC_UpdatableRowSet::insertOneRow  ) 
 

Performs a single insert of the first row of the row set into the result set.

Returns:
SQLDBC_OK if the row is inserted; SQLDBC_NOT_OK if a database access error occurs

SQLDBC_Retcode SQLDBC::SQLDBC_UpdatableRowSet::insertRow SQLDBC_UInt4  position  ) 
 

Performs a single insert of the first row of the row set into the result set.

Parameters:
position Position in the row set. The data at this position is inserted as new row.
Returns:
SQLDBC_OK if the row is inserted; SQLDBC_NOT_OK if a database access error occurs

SQLDBC_Retcode SQLDBC::SQLDBC_UpdatableRowSet::nextParameter SQLDBC_Int2 paramIndex,
void *&  paramAddr
 

Switches to the next input parameter if the application uses data at execute parameters.

After calling this member function, the paramIndex and the paramAddr parameters are set.

Deprecated:
Use nextParameterByIndex instead.

Parameters:
paramIndex Index of the next parameter.
paramAddr The data pointer that was supplied when binding the parameter, plus any offset that originates from a batch execution sequence (including row-wise binding).
Returns:
See also:
putData

SQLDBC_Retcode SQLDBC::SQLDBC_UpdatableRowSet::nextParameterByIndex SQLDBC_Int2 paramIndex,
void *&  paramAddr
 

Switches to the input parameter if the application uses data at execute parameters,.

After calling this member function, the paramIndex and the paramAddr parameters are set. The paramIndex parameter is used to select the next parameter that is processed. You cannot process parameters that are bound to LOB columns before all parameters that are bound to non-LOB columns have been processed for a row.

Parameters:
paramIndex Index of the next parameter that shall be processed, or 0 if the application has no preferred next parameter.
paramAddr The data pointer that was supplied when binding the parameter, plus any offset that originates from a batch execution sequence (including row-wise binding).
Returns:
See also:
putData

SQLDBC_Retcode SQLDBC::SQLDBC_UpdatableRowSet::putData void *  paramAddr,
SQLDBC_Length paramLengthIndicator
 

Put data for an input parameter.

Parameters:
paramAddr Pointer to the data which is to be assigned to the SQL parameter. The type of the data must match the type assigned by the bindParameter() member function.
paramLengthIndicator [in] Pointer to parameter length or indicator.
Returns:
See also:
nextParameter

SQLDBC_Retcode SQLDBC::SQLDBC_RowSet::setPos SQLDBC_UInt4  pos  )  [inherited]
 

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_Retcode SQLDBC::SQLDBC_UpdatableRowSet::updateRow int  position  ) 
 

SQLDBC_Retcode SQLDBC::SQLDBC_UpdatableRowSet::updateRow SQLDBC_UInt4  position  ) 
 

Updates a single row with the values of the first row of the row set at a given position.

Parameters:
position Position in the row set which row has to be updated.
Returns:
SQLDBC_OK if the row is updated; 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.

Note:
Getting the reference to the SQLWarning object will not clear the ErrorHndl object. All other function calls will empty the ErrorHndl object.
Returns:
The SQLWarning object stored in the item.