#include <d32dbms.h>
class RDbTable : public RDbRowSet |
Public Member Enumerations | |
---|---|
enum | TComparison { ELessThan, ELessEqual, EEqualTo, EGreaterEqual, EGreaterThan } |
Public Member Functions | |
---|---|
IMPORT_C TInt | Open(RDbDatabase &, const TDesC &, TAccess) |
IMPORT_C TBool | SeekL(const TDbSeekKey &, TComparison) |
TInt | SetIndex(const TDesC &) |
TInt | SetNoIndex() |
Inherited Attributes | |
---|---|
RDbRowSet::iCursor |
Inherited Enumerations | |
---|---|
RDbRowSet:TAccess | |
RDbRowSet:TAccuracy | |
RDbRowSet:TDirection | |
RDbRowSet:TPosition |
Provides access to table data as a rowset, allowing manipulation of a named table in the database. Additionally, a named index can be used to order the rowset, and to provide fast key-based row retrieval from the table.
There are no special rules to consider when deriving from this class.
Database table seek comparison types.
IMPORT_C TInt | Open | ( | RDbDatabase & | aDatabase, |
const TDesC & | aName, | |||
TAccess | anAccess = EUpdatable | |||
) |
Opens the named table object on a database with the specified access.
If successful, the rowset is positioned to the beginning.
Parameter | Description |
---|---|
aDatabase | The database on which to open the table. |
aName | The name of the table to open. |
anAccess | The access specification for the rowset, the default is updatable access. |
Returns: KErrNone, if successful, otherwise one of the system-wide error codes. Specifically:KErrNotFound if the table does not exist in the database.KErrAccessDenied if an incremental operation is in progress. This can also be one of the DBMS database error codes.
IMPORT_C TBool | SeekL | ( | const TDbSeekKey & | aKey, |
TComparison | aComparison = EEqualTo | |||
) |
Finds a row in a table based on a key in the active index.
This function cannot be called while the rowset is currently updating or inserting a row. The currently active index on the table must have a key definition which matches the types in the key value.
Less columns can be added to the key than are present in the index definition: the keys will only be compared up to the columns present further columns in the index are not considered.
If successful the cursor is positioned to the row which was found, otherwise the cursor is left on an invalid row.
The underlying Store database can leave with KErrWrite, if the table was created with insert-only access.
The function can also leave with one of the DBMS database error codes.
Parameter | Description |
---|---|
aKey | The key value to lookup in the index. |
aComparison | The comparison operation for the lookup, the default is to look for an exact match (EEqualTo). |
Returns: ETrue if a row which compares correctly with the key exists, EFalse if not.
Sets the specified index as the active index for this table. The rows will be presented in index order, and this index key will be used for lookup by the SeekL() function.
If successful, the rowset is reset to the beginning.
Parameter | Description |
---|---|
anIndex | The name of the index to activate. |
Returns: KErrNone, if successful, otherwise one of the system-wide error codes. Specifically:KErrWrite if the table was created with insert-only access.KErrNotFound if the index does not exist on the table. This can also be one of the DBMS database error codes.
TInt | SetNoIndex | ( | ) | [inline] |
Sets the ordering to be the underlying ordering of the rows this will usually provide faster navigation of the rowset.
Returns: KErrNone, if successful, otherwise one of the system-wide error codes. Specifically:KErrWrite if the table was created with insert-only access. This can also be one of the DBMS database error codes.