It will also work if you just evaluate the timespan first:

<cfset cache = "#CreateTimeSpan(0,2,0,0)#">
<cfquery name="test" datasource="#datasource#" cachedWithin="#cache#">

Rick

-----Original Message-----
From: Bob Silverberg [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 14, 2000 5:49 PM
To: CF-Talk
Subject: RE: Problem with cachedwithin



This works:

<cfset cache = "CreateTimeSpan(0,2,0,0)">

<cfquery name="#qryName#"
         datasource="#DSN#"
         cachedwithin="#Evaluate(cache)#">

Bob

-----Original Message-----
From: Dan Haley [mailto:[EMAIL PROTECTED]]
Sent: December 14, 2000 4:20 PM
To: CF-Talk
Subject: Problem with cachedwithin


The following works:
<cfquery        datasource="#request.dsn.name#"
                username="#request.dsn.user#" password="#request.dsn.pwd#"
                name="variables.getObjectList"
                cachedwithin="#createtimespan(0,2,0,0)#">

while the following two do not:
<cfset variables.timeSpan = createtimespan(0,2,0,0)>
<cfquery        datasource="#request.dsn.name#"
                username="#request.dsn.user#" password="#request.dsn.pwd#"
                name="variables.getObjectList"
                cachedwithin="#variables.timeSpan#">

<cfset variables.timeSpan = 2>
<cfquery        datasource="#request.dsn.name#"
                username="#request.dsn.user#" password="#request.dsn.pwd#"
                name="variables.getObjectList"
                cachedwithin="#createtimespan(0,variables.timeSpan,0,0)#">


Testing with simple outputs of #createtimespan(0,variables.timespan,0,0)#,
etc. all seem to provide the same result, so why won't it work in the
<cfquery>.  I'm basing my assumption that it isn't working by the debug
output that will change from saying "Cached Query" to giving a time in
milliseconds.  If this won't work, how else do you dynamically refresh a
cached query whenever you want to?

Thanks,
Dan


The information contained in this message is privileged and confidential.
It is intended solely for the use of the named recipient.  If you are not
the intended recipient, you are hereby notified that any disclosure,
copying, distribution, or use of the contents of this transmission is
strictly prohibited.  If you receive this message in error, please notify
the sender immediately.  Thank you.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to