Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamically filtering clientdataset content

I'm asking myself a question about the way to filter content of a clientdataset in a 3 tier datasnap architecture : Oracle DB <=> My Datasnap Server <=> My Datasnap clients

I have a Oracle table accessed thru a TDSProviderConnection and a TClientDataset.

Multiple clients are using the dataset, which contains a field named "clientId". I would like each client to request only his rows (just like WHERE clientId = 'Client1' in a sql statement).

If I understant right, use of filter doesn't not reduce overhead.

myclientdataset.Filter:= 'ClientId = Client1';
myclientdataset.Filtered:= true;

As this pass all the client anyway. I want the server to filter what's sent.

But I have no idea how to accomplish this using these components.

Any idea would be greatly appreciated.

Regards, JP

like image 232
JPR Avatar asked Dec 06 '25 15:12

JPR


1 Answers

Sounds like a task for a parametrized query as described in this etutorial. As each client sets its own parameter only the requested data is transferred to each client.

like image 89
Uwe Raabe Avatar answered Dec 09 '25 14:12

Uwe Raabe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!