Well... say you've got some sort of unique identifier for that user - be it
a GUID, or an ID that you generate, etc. that is assigned to that user in
some fashion (client variable, cookie, etc). Grab all or part of that ID and
use it in your query name, like "query123abc" for one guy and "query456def"
for the next. This way the queries don't overwrite each other when two or
more people hit the same page (though they may have different 'WHERE'
statements based on various choices they made to get to that page). And you
set up these queries to be cached for a short time so they don't get nailed
each time, but don't hang around terribly long either.
Here's how I do it -
<CFSET QueryName = "QueryName" & UserID>
Say "UserID" is '123abc', you'd end up with "QueryName123abc".
<CFQUERY NAME="#Evaluate("QueryName")#" DATASOURCE="ds"
CACHEDWITHIN="whatever you set">
Later when you want to reference the query, use the same method. I've found,
however, that sometimes you have to remove the quotes INSIDE the Evaluate()
function, a la 'Evaluate(QueryName)'. I use this method in an app I'm
working on. Depending on a particular variable setting, I grab the contents
of one of a series of pre-generated queries (tucked into Application
variables, as I use them all the time and they don't change). All the names
of the queries are a string plus a number (the value of the variable in
question). I use <CFWDDX> to packetize the query results - and in this case,
I have to use 'Evaluate(Queryname)' as opposed to 'Evaluate("QueryName")'.
Hope that helps!
--Scott
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 02, 2000 4:38 AM
> To: [EMAIL PROTECTED]
> Subject: RE: Paging query results
>
>
> Could someone explain this please.
>
> best, paul
>
> At 03:02 PM 8/1/00 -0700, you wrote:
> >Perhaps use a dynamically-generated
> >query name so that two people hitting the page at the same time won't
> >overwrite each other's query results.
>
> --------------------------------------------------------------
> ----------------
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=list
s/cf_talk or send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.