Using Update Objects to Update a Dataset
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.
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 theUPDATE
statement.InsertSQL
specifies theINSERT
statement.DeleteSQL
specifies theDELETE
statement.RefreshSQL
specifies theSELECT
statement.
At runtime, when the update component is used to apply updates, it:
- 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. - Provides parameter values to the SQL statement.
- Prepares and executes the SQL statement to perform the specified update.
Topics
- Specifying the UpdateObject Property for a Dataset
- Creating SQL Statements for Update Components
- Executing Update Statements
- Using Dataset Components to Update a Dataset