Robert: If the point of the recursion was to traverse a hierarchical structure in a database, than you might want to move that part of the code to the database. How you would accomplish this depends on the database platform that you are using. Oracle supports a CONNECT BY clause in SELECT statements that makes single-parent hierarchy traversal a snap. In SQL-Server & Sybase, you could write a stored procedure that performs the recursion for you. In Access, you can probably write a macro or something.
The benefit to this is that you make only a single call to the DB, you end up with a single query result set containing all of your data, and you offload data processing responsibilities to the server that knows how to best process data. Good luck. -- Mosh Teitelbaum evoch, LLC Tel: (301) 625-9191 Fax: (301) 933-3651 Email: [EMAIL PROTECTED] WWW: http://www.evoch.com/ > -----Original Message----- > From: Robert Polickoski [mailto:[EMAIL PROTECTED]] > Sent: Friday, September 13, 2002 1:41 PM > To: CF-Talk > Subject: RE: Recursion > > > All, > > Thank you for your responses to my inquiry. > > As it turns out, the CFSCRIPT option is not viable because the > point of the recursion was querying a database for records that > represented subordinate records which might have subordinate > records of their own. > > The cfmodule seems to take forever and therefore is not practical. > > In the end, I will have to change the design of the application. > However, that is not necessarily a bad thing. However, it does > make me appreciate the changes in CFMX. > > Again, thank you all for your responses. > > > > ---------- Original Message ---------------------------------- > From: Mosh Teitelbaum <[EMAIL PROTECTED]> > Reply-To: [EMAIL PROTECTED] > Date: Thu, 12 Sep 2002 15:45:57 -0400 > > >Or, you could rewrite the function without recursion. Just thought I'd > >mention it as another alternative. > > > >-- > >Mosh Teitelbaum > >evoch, LLC > >Tel: (301) 625-9191 > >Fax: (301) 933-3651 > >Email: [EMAIL PROTECTED] > >WWW: http://www.evoch.com/ > > > > > >> -----Original Message----- > >> From: Dave Watts [mailto:[EMAIL PROTECTED]] > >> Sent: Thursday, September 12, 2002 2:23 PM > >> To: CF-Talk > >> Subject: RE: Recursion > >> > >> > >> > I wrote this really neat recursive function using the > >> > <cffunction> tag on my development system which is running > >> > CFMX on WindowsXP Pro. When I ported to the operational host > >> > (third party), I discovered that they were running a previous > >> > version of CF (I do not know which) which does not support > >> > the new tag. Does anybody know how to do recursion without > >> > the <cffunction> tag? > >> > >> If your recursive function is relatively simple, you can > probably write it > >> as a CF 5-compliant user-defined function, using CFSCRIPT. > >> CFSCRIPT is a tag > >> in which you can write CF commands using a JavaScript-like > language, which > >> uses the same syntax and control flow structures as > JavaScript, but uses > >> CFML operators and expressions. You can't use CFML tags within > a CFSCRIPT > >> tag, though, and CFSCRIPT doesn't support all the things you > can do with > >> CFML tags, such as querying a database. Keep in mind that the > host would > >> have to be using CF 5 or higher for this to work. > >> > >> Alternatively, you could write a recursive custom tag. However, > >> this is the > >> least desirable alternative, as custom tags don't provide any built-in > >> ability to return values (you can write that ability into your > >> code, though) > >> and they tend to negatively affect performance. Nevertheless, > if you need > >> recursion and you're using a version of CF prior to 5, that's > the only way > >> you can do it within CFML. > >> > >> Dave Watts, CTO, Fig Leaf Software > >> http://www.figleaf.com/ > >> voice: (202) 797-5496 > >> fax: (202) 797-5444 > >> > >> > > > ______________________________________________________________________ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

