title: Coldfusion dynamic query output
body: <p>Not sure if this is possible or not. What I am trying to do is build an output string via queries. I am concatenating the output "name" and appending the "value" to the end. Then outputting the string. I don't think this is possible. But I am looking for any alternatives.</p>
  
  <p>So this is what I have:</p>
  
  <p><code>qry1</code> is the main query. <code>qry2</code> gets the value to append to the end of the string.
  So the value of variable <code>test</code> would look like this: <code>"variables.qry1.100"</code></p>
  
  <p>Which would make sense to <code>qry1</code> as this is part of the query object. So then this string would return a correct value from the database as there is a subquery called 100</p>
  
  <pre><code>&lt;cfoutput&gt;
  &lt;cfloop query="variables.qry2"&gt;
      &lt;cfset test = variables.qry1. &amp; variables.qry2.#valueID#&gt;
  &lt;td&gt;#test#&lt;/td&gt; 
  &lt;/cfloop&gt;
  &lt;/cfoutput&gt;
  </code></pre>
  
  <p>Many thanks.</p>
  
  <p>JC</p>