title: cfquery inside of cfoutput query results
body: <p>Looking for a more efficient way to insert records based on query results.</p>
  
  <p>Example:</p>
  
  <pre><code>&lt;cfoutput query="actionInfo"&gt;
  &lt;cfquery datasource="cfdev"&gt;
  insert into dbo.buttonActions
  (fID, bID, fieldID, aClear, aPress, aCheck, aUncheck, aCheckAll, aUncheckAll, tID)
  values
  ('#newID#', '#bID#', '#fieldID#', '#aClear#', '#aPress#', '#aCheck#', '#aUncheck#', '#aCheckAll#', '#aUncheckAll#', '#tID#')
  &lt;/cfquery&gt;
  &lt;/cfoutput&gt;
  </code></pre>
  
  <p>This will run through and make a new insert into the database for each loop through the cfoutput. I've tried placing the cfoutput inside of the cfquery, but run into errors each time.</p>
  
  <p>UPDATE: </p>
  
  <p>This is what ended up working for me, based on Dan's example:</p>
  
  <pre><code>&lt;cfquery datasource = "dsn"&gt;
  insert into newTable
  (fID, field1, field2, etc)
  select '#newID#', field1, field2, etc -- the sql from q1
  &lt;/cfquery&gt;
  </code></pre>