Page 1 of 1

Master-Detail with TZTable - selects all records

Posted: 08.05.2014, 12:24
by Fr0sT
First of all, thank you guys for your work, I'm currently migrating from BDE and Zeos seems very easy to migrate to.

But I noticed that if I use 2 TZTables for master-detail via MasterSource/MasterField/LinkedField the detail TZTable selects ALL records from the DB table. Is it really desired behavior?

I had to switch to queries and implement master-detail via DataSource and SQL 'select * from <table> where <keyfield>=:<keyfield>'. Now things work as they should but I slighly miss convenient TableName and FieldNames design-time assignment.

So my suggestion is to modify TZTable so that it would act as Query with mastersource link.

Btw, what's the meaning of MasterSource/MasterField for Queries?

Re: Master-Detail with TZTable - selects all records

Posted: 12.05.2014, 19:54
by miab3
@Fr0sT,

Take a look to
http://www.intitec.com/varios/A_ZEOS_ba ... rebird.pdf
or
http://www.slashdocs.com/mrkihi/a-zeos- ... ebird.html

particularly:
Master/Detail with client sided filters(second)

Michal

Re: Master-Detail with TZTable - selects all records

Posted: 15.05.2014, 13:00
by Fr0sT
So it's "by design"... I was very surprised with this behavior. With BDE I've never bored about master-detail under-the-carpet techniques. Actually this phrase in the article:
This is the default behaviour of a BDE TTable component. 
...
With client sided filters both DataSets first transfer all table rows from server to client. The detail then sets a filter (on client side) to get the details according to
the current master record. 
is wrong. BDE executes proper "select * where Keyfield=:FK" queries for detail dataset.

In fact, I don't care a lot of using tables and pretty satisfied with queries but this unexpected behavior presented me several minutes of confusing when my 20Mb, 60k-record detail table started fetching from A to Z every time I started my app.