1. Kailainathan Kasinathan
  2. PowerBuilder
  3. Friday, 15 June 2018 07:20 AM

Hi,

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.

Roland Smith Accepted Answer Pending Moderation
  1. Friday, 15 June 2018 14:23 PM
  2. PowerBuilder
  3. # 1
0
Votes
Undo

If you aren't using PFC:

Add a datastore global variable and retrieve it at startup. Then in the constructor event of datawindow controls add code like this:

DataWindowChild ldwc_dddw

this.GetChild("colname", ldwc_dddw)

gds_dropdown.ShareData(ldwc_dddw)

 

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.

Comment
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Friday, 15 June 2018 12:14 PM
  2. PowerBuilder
  3. # 2
0
Votes
Undo

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).

 

Kevin

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.