Is it possible to have dynamically generated query names in ColdFusion?
问题 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