zquery.datasource what is it? how to use it?

The offical for ZeosLib 7.3 Report problems, ask for help, post proposals for the new version of Zeoslib 7.3/v8
Quick Info:
-We made two new drivers: odbc(raw and unicode version) and oledb
-GUID domain/field-defined support for FB
-extended error infos of Firebird
-performance ups are still in queue
In future some more feature will arrive, so stay tuned and don't hassitate to help
Post Reply
hamacker
Junior Boarder
Junior Boarder
Posts: 37
Joined: 13.10.2021, 15:15

zquery.datasource what is it? how to use it?

Post by hamacker »

Still studing zeoslib, now zquery.
I would like a help, I am not understanding datasource property in zquery component.
To me I can reference a field in another dataset and maybe in another connection, but I can't find any doc about.
I know that is not for use master/detail 'cause I have masterdatasource property to do that.
So, someone can help me?
What is zquery.datasource and how to use it?
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Re: zquery.datasource what is it? how to use it?

Post by miab3 »

DataSource in ZQuery(detail) is used to link master-detail using SQL(in detail) "select * from tdetail where Field1_tdetail =:Field2_tmaster"
And it generates the appropriate query every time the position of the master cursor changes.

MasterSource works in conjunction with MasterFields and Linked Fields and ZTable or ZQuery(in detail) using SQL "select * from tdetail".
And it works on downloading all data to the client at once.
It can be said that it filters out detail every time the position of the master cursor changes.
It is a master-detail link on local data.

Michał
hamacker
Junior Boarder
Junior Boarder
Posts: 37
Joined: 13.10.2021, 15:15

Re: zquery.datasource what is it? how to use it?

Post by hamacker »

I tried several times but it does not recognize fields on second datasource(detail).
There is a secret to use :field_datasource2?
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Re: zquery.datasource what is it? how to use it?

Post by miab3 »

It is a field name from the master table.
E.g.
ZQuery_master: tmaster - idm, valuem - select * from tmaster
ZQuery_detail: tdetail - idd, valued, idmd - select * from tdetail where idmd=:idm
ZQuery_detail.DataSource:=DataSource_master;

Michał
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: zquery.datasource what is it? how to use it?

Post by marsupilami »

Note: This is also documented to some degree in chapter 2.6.1 (Master/Detail with server sided filters) of the Zeos documentation collection ;)

Server side filters meaning that the filter is applied on the server side before data is fetched to the client.
Post Reply