This content has been marked as final. Show 4 replies
You can't nest cftags like this:
<cftag 1<cftag2> >
You have to loop through the columnlist.
But the easiest way would be to simply select the list you want. Most dbs have some sort of concatonation function or operator. Of course, they are different from each other.
I'm not sure what you are trying to achieve here?
For example with the following dataset:
ColA ColB ColC
1 aaa bbb ccc
2 ddd eee fff
3 ggg hhh iii
Are you looking for results like:
If the former you will need to do something like this:
<cfset aList = "">
<cfloop list="#aQuery.columnList#" item="col">
<cfset aList = listAppend(aList,aQuery[col][row]>
For the latter you could use the valueList() function.
<cfset aList = valueList(aQuery.ColA)>
> <CFSET var_name = <CFLOOP query="qname">#field#</CFLOOP>
As others have said: one cannot do that. One cannot *generate* CF
statements with other CF statements within the same template. If you stop
and think about how CF works, you'll see it's a nonsensical endeavour.
However all you need to do is this (sort of thing):
<cfset var_name = valueList(qName.field)>
valueList() did it.
Y'all are the wind beneath my wings.