RDbUpdate Class Reference

#include <d32dbms.h>

class RDbUpdate
Public Member Functions
IMPORT_C voidClose()
IMPORT_C TIntExecute(RDbDatabase &, const TDesC &, TDbTextComparison)
IMPORT_C TIntNext()
IMPORT_C voidNext(TRequestStatus &)
IMPORT_C TIntRowCount()

Detailed Description

Provides an interface to allow incremental execution of a DML (SQL data update) statement.

This class offers similar behaviour to the RDbIncremental class, in that it allows an application to perform long running operations while remaining responsive to events. However, unlike that class, RDbUpdate is restricted to executing DML statements.

See also: RDbIncremental

Member Function Documentation

Close ( )

IMPORT_C voidClose()

Releases the resources used by this incremental operation object. If the operation is not yet complete, then the operation is abandoned and the database is rolled back to its state before the operation started.

Execute ( RDbDatabase &, const TDesC &, TDbTextComparison )

IMPORT_C TIntExecute(RDbDatabase &aDatabase,
const TDesC &aSql,
TDbTextComparisonaComparison = EDbCompareNormal
)

Initiates the incremental execution of a DML (SQL data update) statement on the database. This is similar to RDbDatabase::Execute().

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

See also: RDbIncremental RDbDatabase::Execute()

capability
Note For a secure shared database, the caller must satisfy:
  • the schema access policy for the database, if the SQL statement is CREATE/DROP/ALTER;

  • the write access policy for the table in the SQL, if the SQL statement is INSERT/UPDATE/DELETE;

ParameterDescription
aDatabaseThe database on which the DML (SQL data update) statement is to execute.
aSqlA reference to a descriptor containing the DML statement to be executed.
aComparisonThis argument is only used in the execution of some SQL statements. By default the comparison is EDbCompareNormal. For more information see RDbDatabase::Execute().

Returns: KErrNone, if the operation is complete or 1, if the operation requires further incremental execution or another of the system-wide error codes.

Next ( )

IMPORT_C TIntNext()

Performs the next step in the incremental execution of the DML (SQL data update) statement synchronously. The function returns when the step is complete.

Note that if the incremental step fails, then the incremental object should be closed and the operation abandoned.

Returns: KErrNone if execution of the DML statement is complete or 1 if another step in the execution of the DML statement is needed. or another of the system-wide error codes is returned if the incremental step fails.

Next ( TRequestStatus & )

IMPORT_C voidNext(TRequestStatus &aStatus)

Performs the next step in the incremental execution of the DML (SQL data update) statement asynchronously.

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.

Note that if the incremental step fails, then the incremental object should be closed, and the operation abandoned.

ParameterDescription
aStatusThe request status used to contain completion information for the operation. On completion, it contains:KErrNone, if execution of the DML statement is complete or 1, if another step in the execution of the DML statement is needed. or another of the system-wide error codes, if the incremental step fails.

RowCount ( )

IMPORT_C TIntRowCount()const

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

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