> -----Original Message-----
> From: Jim Davis [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 29, 2005 12:12 PM
> To: CF-Talk
> Subject: RE: ways to cache a query other than 'cachedwithin'
> 
> Now I'm not so sure about that... but I think I'm still right.
> 
> The queryname is definitely used as part of the key to the cached data...
> but since it's not in a permanent scope I don't see how it could be
> available to be checked (using IsDefined()) until the query is run.
> 
> I think this needs some testing...

Do some testing... I think I'm correct.  Run the following code (but change
the query to actually work on your system):

<cfif IsDefined("MyQuery")>
        Is Defined!
<cfelse>
        Is NOT Defined!
</cfif>
<cfquery        datasource="..."
                name="MyQuery"
                cachedwithin="1"
                result="MyQueryInfo">
        SELECT ...
</cfquery>
<cfdump var="#MyQueryInfo#">

The first time you run it you'll see that "MyQuery" is not defined.  The
Query metadata will show that in this instance it's not been cached.

The second time you run it you'll see that "MyQuery" is still not defined...
but the metadata will show that the query was retrieved from cache.

Hope this helps,

Jim Davis




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219641
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to