Page 1 of 1

one query two datasets

Posted: Thu 07 Oct 2010 14:22
by geanni
Hi,

I want to have two datasets related to a single MyQuery, and then populate the datasets in the application. I mean to make one query to the mysql ( "select first_name, last_name from users" for example) and then filter the results in two distinct datasets ( on the first one names starting with "a" and on the second dataset names starting with other letter than "a"). But to have only one query to the database.

In this moment I have a query, 2 datasets with filter condition on both of them, but when I call refresh for the two datasets I have two queries to the server.

Is any solution to avoid this duplicate query, I mean to refresh a dataset without query the server?

thanks,
Geanni

Posted: Fri 08 Oct 2010 12:43
by AndreyZ
Hello,

This is the TClientDataSet component behaviour and we cannot influence that. Maybe you should use two TMSQuery components instead of one TMSQuery and two TClientDataSet components.