Using Update Objects to Update a Dataset

From InterBase

Go Up to Working with Cached Updates


TIBUpdateSQL is an update component that uses SQL statements to update a dataset. You must provide one TIBUpdateSQL component for each underlying table accessed by the original query that you want to update.

Note:
If you use more than one update component to perform an update operation, you must create an OnUpdateRecord event to execute each update component.

An update component actually encapsulates four TIBQuery components. Each of these query components perform a single update task. One query component provides a SQL UPDATE statement for modifying existing records; a second query component provides an INSERT statement to add new records to a table; a third component provides a DELETE statement to remove records from a table, and a forth component provides a SELECT statement to refresh the records in a table.

When you place an update component in a data module, you do not see the query components it encapsulates. They are created by the update component at runtime based on four update properties for which you supply SQL statements:

  • ModifySQL specifies the UPDATE statement.
  • InsertSQL specifies the INSERT statement.
  • DeleteSQL specifies the DELETE statement.
  • RefreshSQL specifies the SELECT statement.

At runtime, when the update component is used to apply updates, it:

  1. Selects a SQL statement to execute based on the UpdateKind parameter automatically generated on a record update event. UpdateKind specifies whether the current record is modified, inserted, or deleted.
  2. Provides parameter values to the SQL statement.
  3. Prepares and executes the SQL statement to perform the specified update.

Topics

Advance To: