Contents Index Accessing and manipulating data with the Table API Scrolling through the rows of a table

UltraLite C++ User's Guide
  Understanding UltraLite Development
    Accessing and manipulating data with the Table API

Data manipulation internals


UltraLite exposes the rows in a table to your application one at a time. The Table object has a current position, which may be on a row, before the first row, or after the last row of the table.

When your application changes its row (by using one of the navigation methods on the Table object) UltraLite makes a copy of the row in a buffer. Any operations to get or set values affect only the copy of data in this buffer. They do not affect the data in the database. For example, the following statement changes the value of the ID column in the buffer to 3.

TableSchema ts = t->GetSchema();
ULValue id = ts->GetColumnID( "ID" );
t.Set( id, 3 );
Using UltraLite modes 

UltraLite uses the values in the buffer for a variety of purposes, depending on the kind of operation you are carrying out. UltraLite has four different modes of operation, in addition to a default mode, and in each mode the buffer is used for a different purpose.

Whichever mode you are using, there is a similar sequence of operations:

  1. Enter the mode.

    The Table methods set UltraLite into the mode.

  2. Set the values in the buffer.

    Use the set methods to set values in the buffer.

  3. Carry out the operation.

    Use a Table method to carry out an operation such as insert, update, or find using the values in the buffer. The UltraLite mode is set back to the default method and you must enter a new mode before performing another data manipulation or searching operation.


Contents Index Accessing and manipulating data with the Table API Scrolling through the rows of a table