Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: D32DBMS.H
Link against: edbms.lib

Class RDbView

class RDbView : public RDbRowSet;

Description

Generates rowsets from an SQL query. The query is prepared and evaluated using the interface to this class, while the rowset is manipulated using the RDbRowset base class.

There are no special rules to consider when deriving from this class.

Derivation

Members

Defined in RDbView:
Evaluate(), Evaluate(), EvaluateAll(), Prepare(), Prepare(), Prepare(), Unevaluated()

Inherited from RDbRowSet:
AtBeginning(), AtEnd(), AtRow(), BeginningL(), Bookmark(), Cancel(), Close(), ColCount(), ColDef(), ColDes(), ColDes16(), ColDes8(), ColInt(), ColInt16(), ColInt32(), ColInt64(), ColInt8(), ColLength(), ColReal(), ColReal32(), ColReal64(), ColSetL(), ColSize(), ColTime(), ColType(), ColUint(), ColUint16(), ColUint32(), ColUint8(), CountL(), DeleteL(), EBackwards, EBeginning, EEnd, EEnsure, EFirst, EForwards, EInsertOnly, ELast, ENext, EPrevious, EQuick, EReadOnly, EUpdatable, EndL(), FindL(), FirstL(), GetL(), GotoL(), InsertCopyL(), InsertL(), IsColNull(), IsEmptyL(), LastL(), MatchL(), NextL(), PreviousL(), PutL(), Reset(), SetColL(), SetColNullL(), TAccess, TAccuracy, TDirection, TPosition, UpdateL(), iCursor


Member functions


Prepare()

Capability: Security policy note: For a secure shared database, the caller must satisfy the read access policy for the table.

IMPORT_C TInt Prepare(RDbDatabase &aDatabase, const TDbQuery &aQuery, TAccess anAccess=EUpdatable);

Description

Prepares the view object for evaluating an SQL select-statement.

Following preparation, the rowset object can always provide schema information, but the view may first require evaluation to generate the rowset for navigation.

Parameters

RDbDatabase &aDatabase

The database on which to execute the query.

const TDbQuery &aQuery

The SQL query and the text comparison mode for the constraint.

TAccess anAccess

The access specification for the rowset. By default, updatable access is given.

Return value

TInt

KErrNone, if successful, otherwise one of the other system-wide error codes. Specifically: KErrNotFound if The table does not exist in the database or a column name in the SQL query does not exist::KErrNotSupported if a sort-specification in the SQL query cannot be provided by an index::KErrArgument if an invalid or unrecognised SQL syntax was used::KErrGeneral if there is a column type mismatch in a predicate in the SQL query or if a date-literal in the SQL query was invalid::KErrOverflow if a number-literal in the SQL query for an integral column was too large (did not fit in a 32-bit integral representation). This can also be one of the DBMS database error codes..


Prepare()

Capability: Security policy note: For a secure shared database, the caller must satisfy the read access policy for the table.

IMPORT_C TInt Prepare(RDbDatabase &aDatabase, const TDbQuery &aQuery, const TDbWindow &aWindow);

Description

Prepares the view object for evaluating an SQL select-statement and specifies the evaluation window shape for the rowset.

The function does not specify the access specification for the rowset updatable access is given.

Following preparation, the rowset object can always provide schema information, but the view may first require evaluation to generate the rowset for navigation.

Parameters

RDbDatabase &aDatabase

The database on which to execute the query.

const TDbQuery &aQuery

The SQL query and the text comparison mode for the constraint.

const TDbWindow &aWindow

The desired evaluation window shape for the rowset. If this parameter is omitted, an alternative overload is called e.g. no pre-evaluation window is requested.

Return value

TInt

KErrNone, if successful, otherwise one of the other system-wide error codes. Specifically: KErrNotFound if The table does not exist in the database or a column name in the SQL query does not exist::KErrNotSupported if a sort-specification in the SQL query cannot be provided by an index::KErrArgument if an invalid or unrecognised SQL syntax was used::KErrGeneral if there is a column type mismatch in a predicate in the SQL query or if a date-literal in the SQL query was invalid::KErrOverflow if a number-literal in the SQL query for an integral column was too large (did not fit in a 32-bit integral representation). This can also be one of the DBMS database error codes.


Prepare()

Capability: Security policy note: For a secure shared database, the caller must satisfy the read access policy for the table.

IMPORT_C TInt Prepare(RDbDatabase &aDatabase, const TDbQuery &aQuery, const TDbWindow &aWindow, TAccess anAccess);

Description

Prepares the view object for evaluating an SQL select-statement, specifies the evaluation window shape for the rowset, and sets the access specification for the rowset.

Following preparation, the rowset object can always provide schema information, but the view may first require evaluation to generate the rowset for navigation.

Parameters

RDbDatabase &aDatabase

The database on which to execute the query.

const TDbQuery &aQuery

The SQL query and the text comparison mode for the constraint.

const TDbWindow &aWindow

The desired evaluation window shape for the rowset. If this parameter is omitted, an alternative overload is called e.g. no pre-evaluation window is requested.

TAccess anAccess

The access specification for the rowset. If omitted, updatable access is given.

Return value

TInt

KErrNone, if successful, otherwise one of the other system-wide error codes. Specifically:KErrNotFound if The table does not exist in the database or a column name in the SQL query does not exist::KErrNotSupported if a sort-specification in the SQL query cannot be provided by an index::KErrArgument if an invalid or unrecognised SQL syntax was used::KErrGeneral if there is a column type mismatch in a predicate in the SQL query or if a date-literal in the SQL query was invalid::KErrOverflow if a number-literal in the SQL query for an integral column was too large (did not fit in a 32-bit integral representation). This can also be one of the DBMS database error codes.


EvaluateAll()

IMPORT_C TInt EvaluateAll();

Description

Use this function to fully evaluate the view. It is equivalent to:

while (Unevaluated()) { Evaluate(); }

Return value

TInt

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


Evaluate()

IMPORT_C TInt Evaluate();

Description

Performs a single step of the view evaluation, and returns when the step is complete. To completely evaluate a view in one go, EvaluateAll() should be used.

Return value

TInt

0, evaluation is complete.> 0, more evaluation can be done. < 0, an error code, see the class overview for more information.


Evaluate()

IMPORT_C void Evaluate(TRequestStatus &aStatus);

Description

Performs a single step of the view evaluation, returning immediately and signalling when the step is complete.

This function is most effectively used when the view evaluation is carried out from an active object.

Parameters

TRequestStatus &aStatus

The request status used to contain completion information for the function. On completion, the status value should be interpreted as follows: 0, evaluation is complete.> 0, more evaluation can be done. < 0, an error code, see the class overview for more information.


Unevaluated()

IMPORT_C TBool Unevaluated() const;

Description

Tests whether any more evaluation can be done to a view.

Return value

TBool

ETrue, if the view can be further evaluated; EFalse, if evaluation will have no effect.