Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: d32dbms.h
Link against: edbms.lib

Class RDbView

RDbView

Support

Supported from 5.0

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

RDbRowSetAn abstract base class that provides functionality which is shared between SQL view objects and Table objects
RDbViewGenerates rowsets from an SQL query

Defined in RDbView:
Evaluate(), EvaluateAll(), 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()


Preparation


Prepare()

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=EUpdatable

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

See also:


Prepare()

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.

See also:


Prepare()

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.

See also:

[Top]


Evaluation


Evaluate()

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()

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.


EvaluateAll()

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.

See also:


Unevaluated()

TBool Unevaluated() const;

Description

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

Return value

TBool

True, if the view can be further evaluated; false, if evaluation will have no effect.