What I am trying to do is
<cfloop array="#LOCAL.someArray" index="LOCAL.aString">
<cfset LOCAL.queryName = "uniqueQueryName_" & LOCAL.aString />
<cfquery name="#LOCAL.queryName#" datasource="db" cachedwithin="#CreateTimeSpan(1,0,0,0)#">
SELECT count(*) AS c FROM someTable
</cfquery>
<cfdump var="#LOCAL.queryName#" />
</cfloop>
is this possible, or is there a better way to do it?
Edit
This works with <cfloop query="LOCAL.queryName">
but not when I try to do <cfset ArrayAppend(LOCAL.returnArray, LOCAL.queryName.c) />
You can dump the query, and I imagine also access it by doing something like this:
The Evaluate function is what allows you to do what you want.
There is no need to use
evaluate()
to do this, and one shouldn't (so I've down-voted that answer, sorry).All you need to do is use associative array notation:
If one wants to access a column of that query, it's:
And for a specific cell:
There are very very very few situations in which
evaluate()
is the correct answer to anything. One cannot rely on the Adobe docs because - unfortunately - an awful lot of it was not written by very experienced ColdFusion developers.