LiteDAC

Updating Data with LiteDAC Dataset Components

LiteDAC dataset components which descend from TCustomDADataSet provide different ways for reflecting local changes on the database.

The first approach is to use automatic generation of update SQL statements. When using this approach you should specify Key Fields (the KeyFields property) to avoid requesting KeyFields from the database. When SELECT statement uses multiple tables, you can use the UpdatingTable property to specify which table will be updated. If UpdatingTable is blank, the first table of the FROM clause will be used. In the most cases LiteDAC needs an additional information about updating objects. So LiteDAC executes additional queries to the database. This helps to generate correct updating SQL statements but may result in performance decrease. To disable these additional queries, set the ExtendedFieldsInfo option to False.

Another approach is to set update SQL statements using SQLInsert, SQLUpdate, and SQLDelete properties. Use them to specify SQL statements that will be used for corresponding data modifications. It is useful when generating data modification statements is not possible or you need to execute some specific statements. You may also assign the TLiteUpdateSQL component to the UpdateObject property. TLiteUpdateSQL component holds all updating SQL statements in one place. You can generate all these SQL statements using LiteDAC design time editors. For more careful customization of data update operations you can use InsertObject, ModifyObject and DeleteObject properties of the TLiteUpdateSQL component.

See Also

© 1997-2024 Devart. All Rights Reserved. Request Support DAC Forum Provide Feedback