Updating rows

The following procedure updates a row.

To update a row
  1. Move to the row you want to update.

    You can move to a row by scrolling through the table or by searching the table using find and lookup methods.

  2. Enter update mode.

    For example, the following instruction enters update mode on table tbl.

    tbl.BeginUpdate();
  3. Set the new values for the row to be updated. For example, the following instruction sets the id column in the buffer to 3.

    tbl.Set( UL_TEXT("id"), 3 );
  4. Execute the Update.

    tbl.Update();

After the update operation, the current row is the row that has been updated.

The UltraLite C++ API does not commit changes to the database until you commit them using conn->Commit(). See Managing transactions.

Caution

Do not update the primary key of a row: delete the row and add a new row instead.