Hey, thanks Mike, I'd love to see the unedited version.  CFC's are new 
to me, but I've been looking for an excuse to jump in with both feet! 
You can send it to this address.

Ray

Michael Dinowitz wrote:
> Make a persisted CFC and put the query in it at a variables scope variable. 
> As long as the CFC is persisted, the query is persisted. MUCH cleaner than 
> cachedwithin/cachedafter. I have an article on it waiting to go which I can 
> send you off list (it's pre-edit)
> 
> 
> 
>>I've got a simple query that will grab all my navigational menu items.
>>pretty simple.  Now, I've added Mike D's cf_maketree script to modify
>>the query by adding another field, called maketreesortlevel, that stores
>>the tree level so that I can output the menu items in the correct order
>>and depth.  this query gets rather big, since I've got over 1300
>>categories and subcategories, so I'd like to be able to cache it.  i
>>know how to use cachedwithin as a cfquery attribute, but this won't work
>>here, since I am modifying that query.  is there another way to cache a
>>query?  here's the code, if it helps:
>>
>><cfif NOT isdefined("qry_get_topcats") or isdefined("attributes.refresh")>
>>
>><cfquery name="qry_get_topcats" datasource="#Request.DS#"
>>username="#Request.user#" password="#Request.pass#"
>>cachedwithin="#Request.Cache#">
>>SELECT Category_ID, Name, Parent_ID, ParentIDs
>>FROM Categories
>>WHERE Categories.Display = 1
>>ORDER BY Priority, Name
>></cfquery>
>>
>><!--- this script modifies the query to add 'maketreesortlevel' --->
>><cfmodule
>>template="make_tree.cfm"
>>Query="#qry_get_topcats#"
>>Result="qry_get_topcats"
>>Unique="category_ID"
>>Parent="Parent_ID">
>></cfif>
>>
>>TY
>>
>>Ray
>>
>>-- 
>>=================================================================
>>Ray Champagne - Senior Application Developer
>>CrystalVision Web Site Design and Internet Services
>>603.433.9559
>>www.crystalvision.org
>>=================================================================
>>
>>
>>
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:219632
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