coldfusioncfspreadsheetqoq

Using Spreadsheet in Query of Queries


I am reading a spreadsheet any trying to then run it in a query or Queries

<cfspreadsheet action="read" 
     src="#request.dropfolder##arguments.DSN#" 
     name="qryFromFile" 
     excludeHeaderRow="true" 
     headerrow="true"> 


<cfquery name="qryResult" dbtype="query">
    SELECT  EID
          ,  CAST(#arguments.Config[2]# AS Decimal) AS [Value]
          , 0 AS Invalid
          , '<li><span><b>Comments:</b></span>' + Comments + ' on <time>' + [Date] + '</time></li>' AS Skyhook
    FROM    qryFromFile
    ORDER BY EID
</cfquery>

enter image description here

Do I have to beild the table piece by piece?


Solution

  • To get CF to stuff the contents into a query, you need to use the "query" attribute, not the "name" attribute

    <cfspreadsheet action="read" 
           src="#request.dropfolder##arguments.DSN#" 
           query="qryFromFile" 
           excludeHeaderRow="true" 
           ... >