Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When to use TSQLDataset and when to use TClientDataset ?

dbExpress

When to use TSQLDataset and when to use TClientDataset ?

by  towerbase  Posted    (Edited  )
TSQLDataset should be used for SQL statements which either do not return a result set or where the result set can be used in an unidirectional / read-only way.

It is more efficient to use TSQLDataset than to use TClientDataset when dealing with unidirectional / read-only result sets.

Note that it is possible to update a record using TSQLDataset with an SQL statement such as
Code:
UPDATE customer SET credit=100 WHERE id=1234

TSQLDataset is very efficient when updating all the records in the table (especially when the table is on a remote computer)
Code:
UPDATE customer SET credit=100


TClientDataset should be used if bi-directional support is required (for example to populate a TDBGrid), when the current record is to be updated or when a what-if type scenario is to be investigated.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top