4 Replies Latest reply on Mar 8, 2010 7:22 AM by dujsu

    Issue with CFQUERY results




      Im building a data export and trying to build the columns in the export file dynamically by storing and pulling them out of a seperate database table.  My issue is with a column called "COL-1".  Im building the data export as using the method below, then putting the two variables together to create the export..


      <cfsavecontent variable="dataheader"><cfoutput query="getColumns">#getColumns.column_nm#|</cfoutput><cfoutput>#chr(13)##chr(10)#</cfoutput></cfsavecontent>
      <cfsavecontent variable="datarecords">
           <cfoutput query="getData">
                <cfloop query="getColumns">
                     <!---  below line is where error occurs --->
                     <cfset variables.col_value = '#evaluate("getData." & getColumns.column_nm)#|'>
      <cfset variables.data_export = dataheader & datarecords>



      Error Occurred While Processing Request

      Element COL is undefined in GETDATA.

      How do I get CF to evaluate() the entire column name (COL-1)??


      Message was edited by: BigFeetBigShoes - reformatted code example.