RDbIncremental Class Reference

class RDbIncremental

Provides the interface for performing long-running database operations in incremental steps, allowing application programs to remain responsive to other events.

After an operation has begun, a standard interface is used to continue and complete all incremental operations. On successful return from one of the initiating functions, a step value is also returned. This gives the progress indication and is, initially, positive. This value should be passed into subsequent steps in the operation, each of which may decrement the value by some amount, although they are allowed to leave it unchanged. The value reaches zero, if, and only if the operation completes.

While an incremental operation is in progress, the database cannot be used for any other operations such as opening tables or preparing views.

Starting an incremental operation also requires that no rowsets are open on the database and that no commit is pending for data manipulation transactions.

If no explicit transaction has been started by the database, then an automatic transaction is begun when any incremental operation is started and is committed when complete or rolled back if the operation either fails or is abandoned prior to completion.

Public Member Functions
IMPORT_C TIntAlterTable(RDbDatabase &, const TDesC &, const CDbColSet &, TInt &)
IMPORT_C voidClose()
IMPORT_C TIntCompact(RDbDatabase &, TInt &)
IMPORT_C TIntCreateIndex(RDbDatabase &, const TDesC &, const TDesC &, const CDbKey &, TInt &)
IMPORT_C TIntDropIndex(RDbDatabase &, const TDesC &, const TDesC &, TInt &)
IMPORT_C TIntDropTable(RDbDatabase &, const TDesC &, TInt &)
TInt Execute(RDbDatabase &, const TDesC &, TInt &)
IMPORT_C TIntExecute(RDbDatabase &, const TDesC &, TDbTextComparison, TInt &)
IMPORT_C TIntNext(TInt &)
IMPORT_C voidNext(TPckgBuf< TInt > &, TRequestStatus &)
IMPORT_C TIntRecover(RDbDatabase &, TInt &)
IMPORT_C TIntUpdateStats(RDbDatabase &, TInt &)
Private Attributes
RDbHandle< CDbIncremental >iState

Member Functions Documentation

AlterTable(RDbDatabase &, const TDesC &, const CDbColSet &, TInt &)

IMPORT_C TIntAlterTable(RDbDatabase &aDatabase,
const TDesC &aTable,
const CDbColSet &aNewDef,
TInt &aStep
)

Parameters

RDbDatabase & aDatabase
const TDesC & aTable
const CDbColSet & aNewDef
TInt & aStep

Close()

IMPORT_C voidClose()

Compact(RDbDatabase &, TInt &)

IMPORT_C TIntCompact(RDbDatabase &aDatabase,
TInt &aStep
)

Parameters

RDbDatabase & aDatabase
TInt & aStep

CreateIndex(RDbDatabase &, const TDesC &, const TDesC &, const CDbKey &, TInt &)

IMPORT_C TIntCreateIndex(RDbDatabase &aDatabase,
const TDesC &aName,
const TDesC &aTable,
const CDbKey &aKey,
TInt &aStep
)

Parameters

RDbDatabase & aDatabase
const TDesC & aName
const TDesC & aTable
const CDbKey & aKey
TInt & aStep

DropIndex(RDbDatabase &, const TDesC &, const TDesC &, TInt &)

IMPORT_C TIntDropIndex(RDbDatabase &aDatabase,
const TDesC &aName,
const TDesC &aTable,
TInt &aStep
)

Parameters

RDbDatabase & aDatabase
const TDesC & aName
const TDesC & aTable
TInt & aStep

DropTable(RDbDatabase &, const TDesC &, TInt &)

IMPORT_C TIntDropTable(RDbDatabase &aDatabase,
const TDesC &aTable,
TInt &aStep
)

Parameters

RDbDatabase & aDatabase
const TDesC & aTable
TInt & aStep

Execute(RDbDatabase &, const TDesC &, TInt &)

TInt Execute(RDbDatabase &aDatabase,
const TDesC &aSql,
TInt &aStep
)[inline]

Initiates the execution of a DDL (SQL schema update) statement on the database.

This is the incremental form of RDbDatabase::Execute().

Note that to begin executing a DML (SQL data update) statement incrementally, use the RDbUpdate class.

KErrNone if successful, otherwise another of the system-wide error codes.

RDbDatabase::Execute()

RDbUpdate

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;

Parameters

RDbDatabase & aDatabaseThe database on which the DDL (SQL schema update) statement is to execute.
const TDesC & aSqlThe DDL SQL statement to be executed on the database.
TInt & aStepOn return, contains the initial step count for the incremental operation. This value should be passed in to subsequent calls to Next() to continue the operation.

Execute(RDbDatabase &, const TDesC &, TDbTextComparison, TInt &)

IMPORT_C TIntExecute(RDbDatabase &aDatabase,
const TDesC &aSql,
TDbTextComparisonaComparison,
TInt &aStep
)

Parameters

RDbDatabase & aDatabase
const TDesC & aSql
TDbTextComparison aComparison
TInt & aStep

Next(TInt &)

IMPORT_C TIntNext(TInt &aStep)

Parameters

TInt & aStep

Next(TPckgBuf< TInt > &, TRequestStatus &)

IMPORT_C voidNext(TPckgBuf< TInt > &aStep,
TRequestStatus &aStatus
)

Parameters

TPckgBuf< TInt > & aStep
TRequestStatus & aStatus

Recover(RDbDatabase &, TInt &)

IMPORT_C TIntRecover(RDbDatabase &aDatabase,
TInt &aStep
)

Parameters

RDbDatabase & aDatabase
TInt & aStep

UpdateStats(RDbDatabase &, TInt &)

IMPORT_C TIntUpdateStats(RDbDatabase &aDatabase,
TInt &aStep
)

Parameters

RDbDatabase & aDatabase
TInt & aStep

Member Data Documentation

RDbHandle< CDbIncremental > iState

RDbHandle< CDbIncremental >iState[private]