RDbTable Class Reference

#include <d32dbms.h>

Link against: edbms.lib

class RDbTable : public RDbRowSet

Inherits from

Public Member Enumerations
enumTComparison { ELessThan, ELessEqual, EEqualTo, EGreaterEqual, EGreaterThan }
Public Member Functions
IMPORT_C TIntOpen(RDbDatabase &, const TDesC &, TAccess)
IMPORT_C TBoolSeekL(const TDbSeekKey &, TComparison)
TInt SetIndex(const TDesC &)
TInt SetNoIndex()
Inherited Attributes
RDbRowSet::iCursor
Inherited Enumerations
RDbRowSet:TAccess
RDbRowSet:TAccuracy
RDbRowSet:TDirection
RDbRowSet:TPosition
Inherited Functions
RDbRowSet::AtBeginning()const
RDbRowSet::AtEnd()const
RDbRowSet::AtRow()const
RDbRowSet::BeginningL()
RDbRowSet::Bookmark()const
RDbRowSet::Cancel()
RDbRowSet::Close()
RDbRowSet::ColCount()const
RDbRowSet::ColDef(TDbColNo)const
RDbRowSet::ColDes(TDbColNo)const
RDbRowSet::ColDes16(TDbColNo)const
RDbRowSet::ColDes8(TDbColNo)const
RDbRowSet::ColInt(TDbColNo)const
RDbRowSet::ColInt16(TDbColNo)const
RDbRowSet::ColInt32(TDbColNo)const
RDbRowSet::ColInt64(TDbColNo)const
RDbRowSet::ColInt8(TDbColNo)const
RDbRowSet::ColLength(TDbColNo)const
RDbRowSet::ColReal(TDbColNo)const
RDbRowSet::ColReal32(TDbColNo)const
RDbRowSet::ColReal64(TDbColNo)const
RDbRowSet::ColSetL()const
RDbRowSet::ColSize(TDbColNo)const
RDbRowSet::ColTime(TDbColNo)const
RDbRowSet::ColType(TDbColNo)const
RDbRowSet::ColUint(TDbColNo)const
RDbRowSet::ColUint16(TDbColNo)const
RDbRowSet::ColUint32(TDbColNo)const
RDbRowSet::ColUint8(TDbColNo)const
RDbRowSet::CountL(TAccuracy)const
RDbRowSet::DeleteL()
RDbRowSet::EndL()
RDbRowSet::FindL(TDirection,TDbQuery)
RDbRowSet::FirstL()
RDbRowSet::GetL()
RDbRowSet::GotoL(TPosition)
RDbRowSet::GotoL(const TDbBookmark &)
RDbRowSet::InsertCopyL()
RDbRowSet::InsertL()
RDbRowSet::IsColNull(TDbColNo)const
RDbRowSet::IsEmptyL()const
RDbRowSet::LastL()
RDbRowSet::MatchL(const RDbRowConstraint &)
RDbRowSet::NextL()
RDbRowSet::PreviousL()
RDbRowSet::PutL()
RDbRowSet::Reset()
RDbRowSet::SetColL(TDbColNo,TInt)
RDbRowSet::SetColL(TDbColNo,TInt32)
RDbRowSet::SetColL(TDbColNo,TInt64)
RDbRowSet::SetColL(TDbColNo,TReal32)
RDbRowSet::SetColL(TDbColNo,TReal64)
RDbRowSet::SetColL(TDbColNo,TTime)
RDbRowSet::SetColL(TDbColNo,TUint)
RDbRowSet::SetColL(TDbColNo,TUint32)
RDbRowSet::SetColL(TDbColNo,const TDesC16 &)
RDbRowSet::SetColL(TDbColNo,const TDesC8 &)
RDbRowSet::SetColNullL(TDbColNo)
RDbRowSet::UpdateL()

Detailed Description

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.

Member Enumeration Documentation

Enum TComparison

Database table seek comparison types.

EnumeratorValueDescription
ELessThan

Retrieve the last row which is strictly less than the key value.

ELessEqual

Retrieve the last row which is equal to or less than the key value.

EEqualTo

Retrieve the first row which is equal to the key value.

EGreaterEqual

Retrieve the first row which is equal to or greater than the key value.

EGreaterThan

Retrieve the first row which is strictly greater than the key value.

Member Function Documentation

Open ( RDbDatabase &, const TDesC &, TAccess )

IMPORT_C TIntOpen(RDbDatabase &aDatabase,
const TDesC &aName,
TAccessanAccess = EUpdatable
)

Opens the named table object on a database with the specified access.

If successful, the rowset is positioned to the beginning.

capability
Note For a secure shared database, the caller must satisfy either the read or the write access policy for the table.
ParameterDescription
aDatabaseThe database on which to open the table.
aNameThe name of the table to open.
anAccessThe 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.

SeekL ( const TDbSeekKey &, TComparison )

IMPORT_C TBoolSeekL(const TDbSeekKey &aKey,
TComparisonaComparison = 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.

capability
Note For a secure shared database, the caller must satisfy the read access policy for the table.
ParameterDescription
aKeyThe key value to lookup in the index.
aComparisonThe 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.

SetIndex ( const TDesC & )

TInt SetIndex(const TDesC &anIndex)[inline]

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.

capability
Note For a secure shared database, the caller must satisfy the read access policy for the table.
ParameterDescription
anIndexThe 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.

SetNoIndex ( )

TInt SetNoIndex()[inline]

Sets the ordering to be the underlying ordering of the rows this will usually provide faster navigation of the rowset.

capability
Note For a secure shared database, the caller must satisfy the read access policy for the table.

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.