i want to cache a table which is used to retrieve dropdown values. So i want to reduce the full scan, so caching the table and retrieving from it will improve the time. How to cache the table ? Please help.
Add a datastore global variable and retrieve it at startup. Then in the constructor event of datawindow controls add code like this:
To make it really easy to use and more efficient, you could create a datastore object and add a function that passes the column name and a by reference copy of the datawindow control. In the function it could retrieve the datastore if rowcount is zero. That way you wouldn't have to retrieve all the caches at startup, they would be retrieved as needed.
Looks like you answered your own question with the tag - datastore. Lots of options depending on how many screens you'd use it on. Easiest is to set the datastore as a global variable, then it's available anywhere. Create it before retrieving, then destroy on app close. You can also take a look at how the pfc does their caching service. Look at PFCAPSRV.PBL(pfc_n_cst_dwcache).
There are no comments made yet.
There are no replies made for this question yet. However, you are not allowed to reply to this question.
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here. Register Here »