> I'm trying to cache a query that receives parameters via 
> cfqueryparam. I'm getting the message that this is not 
> allowed. I have some questions:
> 
> 1) Why in a million years this is not allowed? I'm sure 
> there must be a good reason for that

Honestly, I don't really know. I assume that it has something to do with how
CF stores the string of SQL that is generated within a CFQUERY. When you use
CFQUERYPARAM, the values aren't placed within the SQL statement sent to the
database, but are instead sent separately. When you use
CACHEDWITHIN/CACHEDAFTER, CF will only reuse the cached query if it can
guarantee that the SQL statement and connection information in the query to
be rerun are identical to those of the query that was cached.

> 2) How can i cache my query and still "protect" the 
> parameters? (maybe val() ? )

I'd recommend instead that you simply store your queries within persistent
memory variables (Session, Application, Server). It's not as easy in some
respects, but I find it to be more flexible, overall.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to