Okay, sure.

Lets say you've got a query in your qry_Application.cfm that calls
information that's usually pretty static, oh like the fields in your
tblStates.

    <cflock name="application.SetApplicationVariables" timeout="30"
type="exclusive">
        <cfif not isdefined("application.getStates")>
            <cfinclude template="qry_States.cfm">
        </cfif>
    </cflock>

The template qry_States.cfm looks like this:

<!--- qry_States.cfm --->
            <cfquery name="application.getStates"
datasource="#request.maindsn#">
                SELECT StateID, StateName
                  FROM tblStates
             </cfquery>

(if you had other queries you wanted cached like this they'd get their own
cfif sections within the lock)

Now you've got your query (actually a recordset) cached as an application
variable.

Lo and behold one day we actually get a new state so in your admin section
you've written with the form you use to add new states to the tblStates
you include at the bottom of you act_InsertState.cfm where your insert query
is all you have to do is:

    <cflock name="application.States" timeout="30" type="exclusive">
            <cfinclude template="../queries/qry_States.cfm">
    </cflock>

Now you've just refreshed your application scoped recordset of states.


Fred T. Sanders
Charlottesville, VA
-------------------------------------------
Programmers don't lie...
They just can't tell time.


----- Original Message -----
From: "Linda Burchard" <[EMAIL PROTECTED]>
To: "Fusebox" <[EMAIL PROTECTED]>
Sent: Monday, October 30, 2000 3:40 PM
Subject: refreshing cached queries


> Hi -
>    I am reading the ebook, and it mentions that more information about
> refreshing cached queries is available on www.fusebox.org.  However, all I
> could find were some suggestions asking what happened to the
cf_queryrefresh
> tag.  Can anyone give me some information about how to refresh cached
> queries, or tell me where to get it?
>
> Thanks -
> Linda Burchard
> [EMAIL PROTECTED]
> DOMAIN technologies, inc.
> --------------------------------------------------------------------------
----
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>

------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to