Greetings,
I want to cache values from the DB (mainly lookup table values that are not changed); I have seen in the query bulider the checkbox: "Cache Record Set". I don't want to use the query builder.
What is the best practice to create cached record sets? Should I create global variables that will contain these values or does anyone else has a better idea?
Best,
Frank
Best practice for caching
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
I don't know how you're planning on using this, but here are a couple of ideas off the top of my head:
1. You can store the lookup values as custom properties of an object. Just grab them once, save them, and then look them up from the custom property after that.
set the xyz of card "prefs" to someData
put the xyz of card "prefs" into tNewVariable
2. Alternately, you can store them as local variables in the stack script and have an accessor function there to retrieve them:
local sLookupArray
on CachedValue pValue
return sLookupArray[pValue]
end CachedValue
1. You can store the lookup values as custom properties of an object. Just grab them once, save them, and then look them up from the custom property after that.
set the xyz of card "prefs" to someData
put the xyz of card "prefs" into tNewVariable
2. Alternately, you can store them as local variables in the stack script and have an accessor function there to retrieve them:
local sLookupArray
on CachedValue pValue
return sLookupArray[pValue]
end CachedValue