queries exist in the variables scope (unless you explicitly declare
them elsewhere).
variables['q' & dayspan][totalorders][n]
On 8/30/06, Josh Nathanson <[EMAIL PROTECTED]> wrote:
> Yup, looping over the collection if you have a structure is more elegant
> than using evaluate.
>
> Here's an interesting one though...I am dynamically generating queries/query
> names, is there any way to evaluate the query results dynamically without
> using evaluate?
>
> I would do a single query and then loop qoq's for better performance but I'm
> doing some SQL that qoq's can't do.
>
> the setter loop:
> <cfset dayslist = "0,1,7,30,90,365">
> <cfloop list="#dayslist#" index="dayspan">
> <cfquery name="q#dayspan#" datasource="#Request.DS#"
> username="#Request.user#" password="#Request.pass#">
> SELECT totalorders etc....
>
> This gives 6 queries named q0, q1, q7 etc.
>
> the evaluator:
> <cfloop list="#dayslist#" index="dayspan">
> Evaluate('q' & dayspan & '.totalorders')
>
> ???????
--
Charlie Griefer
================================================
"...All the world shall be your enemy, Prince with a Thousand Enemies,
and whenever they catch you, they will kill you. But first they must catch
you, digger, listener, runner, prince with a swift warning.
Be cunning and full of tricks and your people shall never be destroyed."
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:251508
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4