Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <D32DBMS.H>

Class TDbQuery

class TDbQuery;

Description

A wrapper for an SQL string combined with a text comparison mode.

An instance of the class is used as a parameter to RDbView::Prepare(RDbDatabase &,const TDbQuery &,TAccess), RDbRowSet::FindL(TDirection,TDbQuery) and RDbRowConstraint::Open(const RDbRowSet &,TDbQuery).

The evaluation of SQL queries or constraints depends on how Text columns are compared so every SQL string is accompanied by a member of the TDbTextComparison enumeration to indicate how comparison is done.

If the SQL string contains a LIKE clause with * (asterisks) wildcard then the characters between them must be no longer than length 255. If only one * exists then the length is taken from the start and to the end of the clause. However, if the clause contains a ? (question mark) wildcard within it then the characters between must be no longer than length 253.

Members

Defined in TDbQuery:

See also:


Construction and destruction


TDbQuery(const TDesC &,TDbTextComparison)

inline TDbQuery(const TDesC &aQuery, TDbTextComparison aComparison=EDbCompareNormal);

Description

Constructs a query object from an SQL string and a text comparison mode.

Note that no copy is made of the descriptor passed; it is stored by reference in the query object.

Parameters

const TDesC16 &aQuery

The SQL string as a descriptor.

TDbTextComparison aComparison

The type of text comparison to use in evaluation of the SQL. If not supplied, normal comparison is used.

[Top]


Member functions


Query()const

inline const TDesC& Query() const;

Description

Returns the SQL string in the query object.

Return value

const TDesC16 &

A descriptor containing the SQL string.


Comparison()const

inline TDbTextComparison Comparison() const;

Description

Returns the text comparison mode for the query object.

Return value

TDbTextComparison

The text comparison mode.