Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <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:

Inherited from RDbRowSet:


Member functions


Prepare(RDbDatabase &,const TDbQuery &,TAccess)

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.

RDbRowSet::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 KErrNotSupported if a sort-specification in the SQL query cannot be provided by an KErrArgument if an invalid or unrecognised SQL syntax was 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 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(RDbDatabase &,const TDbQuery &,const TDbWindow &)

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 KErrNotSupported if a sort-specification in the SQL query cannot be provided by an KErrArgument if an invalid or unrecognised SQL syntax was 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 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(RDbDatabase &,const TDbQuery &,const TDbWindow &,TAccess)

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.

RDbRowSet::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 KErrNotSupported if a sort-specification in the SQL query cannot be provided by an KErrArgument if an invalid or unrecognised SQL syntax was 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 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 (RDbView::Unevaluated()const) { RDbView::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, RDbView::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(TRequestStatus &)

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

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.