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.
- Note: If you use more than one update component to perform an update operation, you must create an OnUpdateRecordevent 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:
- ModifySQLspecifies the- UPDATEstatement.
- InsertSQLspecifies the- INSERTstatement.
- DeleteSQLspecifies the- DELETEstatement.
- RefreshSQLspecifies the- SELECTstatement.
At runtime, when the update component is used to apply updates, it:
- Selects a SQL statement to execute based on the UpdateKindparameter automatically generated on a record update event.UpdateKindspecifies 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.