Dynamic dataset
Posted: Thu 30 Sep 2010 07:45
I an old application we currently have to load data for each day of the week.
In the old application we did something like this:
We hit the database 7 times. That's not good. I want to only hit the database once.
So to speed up the application I would like to do something like this:
and then update the dataset dynamically with only the relevant information (for each day)
so that ClientDataSet1 only would get the date where day = 1 and ClientDataSet2 only would get the date where day = 2 and so on.
Can anybody point me in the right direction to do this?
In the old application we did something like this:
Code: Select all
MyQuery1->SQL->Clear();
MyQuery1->SQL->Add("select * from x where day = 1");
ClientDataSet1->Refresh();
MyQuery2->SQL->Clear();
MyQuery2->SQL->Add("select * from x where day = 2");
ClientDataSet2->Refresh();
...........
So to speed up the application I would like to do something like this:
Code: Select all
MyQuery->SQL->Clear();
MyQuery->SQL->Add("select * from x");
so that ClientDataSet1 only would get the date where day = 1 and ClientDataSet2 only would get the date where day = 2 and so on.
Can anybody point me in the right direction to do this?