Newbie question about TMyQuery and TMyTable

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
alan

Newbie question about TMyQuery and TMyTable

Post by alan » Wed 07 Jun 2006 17:29

Could someone give me a brief explanation as to why one would want to use a TMyQuery over a TMyTable? It seems like either one could be used for many circumstances. Most of the examples out there seem to prefer TMyQuery.

:?:

GEswin
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain
Contact:

Post by GEswin » Wed 07 Jun 2006 22:08

Well, TMyQuery lets you drill-down data to what you need, you can also join tables etc. If you have for example a 1000 records, and you only need to show 5 records which have some common reference, then with a TMyQuery you just select those 5 (example select * from table where condition = xxx), and it would retrieve only those records from server, with TMyTable everything is retreived and then procesed locally. But best to know about why to use TMyQuery would be knowing SQL.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Thu 08 Jun 2006 09:47

GEswin is right. MyQuery is more flexible than MyTable. But if you need just to get all data from table on the server to client application, MyTable is more convenient. It generates SELECT query itself.

Post Reply