![Symbian Developer Library](../../../../a_stock/images/mainheading.gif)
![]() |
![]() |
|
class RDbTable : public RDbRowSet;
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.
RDbRowSet
- An abstract base class that provides functionality which is shared between SQL v...
RDbTable
- Provides access to table data as a rowset, allowing manipulation of a named tabl...
Defined in RDbTable
:
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. ELessEqual
Retrieve the last row which is equal to or less than the key value. ELessThan
Retrieve the last row which is strictly less than the key value. Open(RDbDatabase &,const TDesC &,TAccess)
Opens the named table object on a database with the specified access.SeekL(const TDbSeekKey &,TComparison)
Finds a row in a table based on a key in the active index.SetIndex(const TDesC &)
Sets the specified index as the active index for this table. The rows will be pr...SetNoIndex()
Sets the ordering to be the underlying ordering of the rows — this will ...TComparison
Database table seek comparison types. Inherited from RDbRowSet
:
AtBeginning()const
Tests whether the cursor is at the beginning of the rowset.AtEnd()const
Tests whether the cursor is at the end of the rowset.AtRow()const
Tests whether the cursor is on a row.BeginningL()
Positions the cursor at the beginning of the rowset.Bookmark()const
Gets the bookmark for the current cursor position. Bookmarks cannot be extracted...Cancel()
Cancels the update or insertion of a row, or recovers the rowset if RDbRowSet::P...Close()
Closes the rowset and releases any owned resources. It is safe to close a rowset...ColCount()const
Returns the number of columns which are defined in this rowset.ColDef(TDbColNo)const
Returns the definition of a column in the rowset.ColDes(TDbColNo)const
Extracts a Text column value. The column type must match the default descriptor ...ColDes16(TDbColNo)const
Extracts a column as Unicode text.ColDes8(TDbColNo)const
Extracts any column type, except Long columns, as binary data. Can handle any ty...ColInt(TDbColNo)const
Extracts a signed integer column value. The type should fit within a TInt.ColInt16(TDbColNo)const
Extracts a TInt16 or TInt8 column value.ColInt32(TDbColNo)const
Extracts a TInt32, TInt16 or TInt8 column value.ColInt64(TDbColNo)const
Extracts a TInt64 column value.ColInt8(TDbColNo)const
Extracts a TInt8 column value.ColLength(TDbColNo)const
Gets the length of a column value. As compared with RDbRowSet::ColSize(TDbColNo)...ColReal(TDbColNo)const
Extracts a TReal64 column value.ColReal32(TDbColNo)const
Extracts a TReal32 column value.ColReal64(TDbColNo)const
Extracts a TReal64 column value.ColSetL()const
Returns the entire column set for the rowset. This can be used to discover colum...ColSize(TDbColNo)const
Gets the size in bytes of a column value. This can be used for all column types,...ColTime(TDbColNo)const
Extracts a TTime column value.ColType(TDbColNo)const
Returns the type of a column in the rowset.ColUint(TDbColNo)const
Extracts an unsigned integer column value.ColUint16(TDbColNo)const
Extracts a Uint16, Uint8 or Bit column value.ColUint32(TDbColNo)const
Extracts a Uint32, Uint16, Uint8 or Bit column value.ColUint8(TDbColNo)const
Extracts a Uint8 or Bit column value.CountL(TAccuracy)const
Returns the number of rows available in a rowset.DeleteL()
Deletes the current row in a rowset. The rowset must not currently be updating o...EBackwards
Search from the current row backwards through the set. EBeginning
Move to the position before the first row in the rowset. EEnd
Move to the position after the last row in the rowset. EEnsure
Take the time, if necessary, to return the exact value. EFirst
Move to the first row in the rowset. EForwards
Search from the current row forwards through the set. EInsertOnly
Inserting new rows is the only valid operation on the rowset. ELast
Move to the last row in the rowset. ENext
Move to the next row in the rowset. EPrevious
Move to the previous row in the rowset. EQuick
Return any immediately available value. EReadOnly
Row navigation and reading are permitted. EUpdatable
All operations can be performed on the rowset. EndL()
Positions the cursor at the end of the rowset.FindL(TDirection,TDbQuery)
Searches through a rowset for a row which fulfils an SQL search-condition. The s...FirstL()
Positions the cursor on the first row in the rowset. If there are no rows, the c...GetL()
Gets the current row data for access using the column extractor functions. The c...GotoL(TPosition)
Moves the cursor to a specified position.GotoL(const TDbBookmark &)
Goes to a previously bookmarked position in a rowset.InsertCopyL()
Inserts a copy of the current row into the rowset. All auto-increment columns wi...InsertL()
Inserts a new row into the rowset. All auto-increment columns will be initialise...IsColNull(TDbColNo)const
Tests whether a column has the NULL value.IsEmptyL()const
Tests whether there are any rows in the rowset. This is often faster than testin...LastL()
Positions the cursor on the last row in the rowset. If there are no rows, the cu...MatchL(const RDbRowConstraint &)
Tests whether the current row in the rowset matches a previously compiled row co...NextL()
Moves the cursor to the next row in the rowset. If there are no more rows, the c...PreviousL()
Moves the cursor to the previous row in the rowset. If there are no more rows, t...PutL()
Completes the update or insertion of a row.Reset()
Resets the rowset.SetColL(TDbColNo,TInt)
Sets a signed integer column value. The type should fit into a TInt.SetColL(TDbColNo,TInt32)
Sets a TInt32, TInt16 or TInt8 column value.SetColL(TDbColNo,TInt64)
Sets a TInt64 column value.SetColL(TDbColNo,TReal32)
Sets a TReal32 column value.SetColL(TDbColNo,TReal64)
Sets a TReal64 column value.SetColL(TDbColNo,TTime)
Sets a TTime column value.SetColL(TDbColNo,TUint)
Sets a signed integer column value. The type should fit into a TInt.SetColL(TDbColNo,TUint32)
Sets a TUint32, TUint16, TUint8 or Bit column value.SetColL(TDbColNo,const TDesC16 &)
Set a column value from Unicode text.SetColL(TDbColNo,const TDesC8 &)
Sets a column value from an 8 bit descriptor. This function can also set the val...SetColNullL(TDbColNo)
Use this function to set the value of a column to NULL.TAccess
Specifies which operations can be performed on a rowset. TAccuracy
Specifies whether the RDbRowSet::CountL(TAccuracy)const function should ensure t...TDirection
Specifies the direction to search through the rowset when using the RDbRowSet::F...TPosition
Specifies where the rowset should navigate to in the RDbRowSet::GotoL(TPosition)...UpdateL()
Prepares the current row for update. If no client-begun transaction is in progre...iCursor
Capability: | Security policy note: | For a secure shared database, the caller must satisfy either the read or the write access policy for the table. |
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.
|
|
Capability: | Security policy note: | For a secure shared database, the caller must satisfy the read access policy for the table. |
inline TInt SetIndex(const TDesC &anIndex);
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 RDbTable::SeekL(const TDbSeekKey &,TComparison)
function.
If successful, the rowset is reset to the beginning.
|
|
Capability: | Security policy note: | For a secure shared database, the caller must satisfy the read access policy for the table. |
inline TInt SetNoIndex();
Sets the ordering to be the underlying ordering of the rows — this will usually provide faster navigation of the rowset.
|
Capability: | Security policy note: | For a secure shared database, the caller must satisfy the read access policy for the table. |
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.
|
|
TComparison
Database table seek comparison types.
|