Master-Detail with TZTable - selects all records

The official tester's forum for ZeosLib 7.1. Ask for help, post proposals or solutions.
Post Reply
Fr0sT
Zeos Dev Team
Zeos Dev Team
Posts: 280
Joined: 08.05.2014, 12:08

Master-Detail with TZTable - selects all records

Post 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?
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Re: Master-Detail with TZTable - selects all records

Post 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
Fr0sT
Zeos Dev Team
Zeos Dev Team
Posts: 280
Joined: 08.05.2014, 12:08

Re: Master-Detail with TZTable - selects all records

Post 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.
Post Reply