EPOC   SDK Home Glossary Indexes Previous   Up

RDbUpdate class


Contents


RDbUpdate class — Executing DML statements incrementally

Section Contents


Overview

Compatibility

Applications that use this class will not work correctly on a version of EPOC earlier than ER5.

Derivation

Not applicable.

Defined in

d32dbms.h

Link against

edbms.lib

Description

This class offers similar behaviour to the RDbIncremental class, i.e. it provides an interface which allows an application to perform long running operations while remaining responsive to events.

However, unlike RDbIncremental, this class is restricted to executing a DML (SQL data update) statement incrementally.


Release resources


Close() — Close the incremental operation

void Close();

Description

Use this function to release the resources used by this incremental operation object. If the operation has not yet completed, it is abandoned and the database rolled back.


Starting the incremental execution of the DML statement


Execute() — Begin executing a DML (SQL data update) statement

TInt Execute(RDbDatabase& aDatabase,const TDesC& aSql,TDbTextComparison aComparison=EDbCompareNormal);

Description

Use this function to initiate the execution of a DML (SQL data update) statement on the database.

See also the Execute() member function of the RDbDatabase class.

Arguments

RDbDatabase& aDatabase

The database on which the DML (SQL data update) statement is to execute.

const TDesC& aSql

A reference to a descriptor containing the DML statement to be executed.

TDbTextComparison aComparison

This argument is only used in the execution of some SQL statements; see the Execute() member function of the RDbDatabase class.

Return value

TInt

  • 0, if the operation is complete.

or

  • 1, if the operation requires further incremental execution

or

Notes

To begin executing a DDL (SQL schema update) statement incrementally, use the RDbIncremental class.


Continuing the incremental execution of the DML statement


Next() — Perform a synchronous step

TInt Next();

Description

Use this function to perform the next step in the incremental execution of the DML (SQL data update) statement; it returns when the step is complete.

Return value

TInt

  • 0, if execution of the DML statement is complete.

or

  • 1, if another step in the execution of the DML statement is needed

or

  • one of the system error codes, if the incremental step fails; see system error codes. The incremental object should be closed, and the operation abandoned.

Next() — Perform an asynchronous step

void Next(TRequestStatus& aStatus);

Description

Use this function to perform the next step in the incremental execution of the DML (SQL data update) statement; the function returns immediately and signals when the step is complete.

This function is most effectively used when the incremental operation is packaged as an active object.

Arguments

TRequestStatus& aStatus

The request status used to contain completion information for the operation.

On completion, it contains:

  • 0, if execution of the DML statement is complete.

or

  • 1, if another step in the execution of the DML statement is needed.

or

  • one of the system error codes, if the incremental step fails; see system error codes. The incremental object should be closed, and the operation abandoned.

Number of rows affected


RowCount() — Return the number of rows affected

TInt RowCount() const;

Description

Use this function to return the number of rows currently affected by the execution of the DML (SQL data update) statement on the database.

Once execution of the DML statement is complete, the value returned is the final total number of rows affected.

Return value

TInt

The current/final number of rows affected by the execution of the DML statement.

EPOC       SDK Home Glossary Indexes Previous   Up