在查询查询中使用电子表格

时间:2016-01-22 19:30:11

标签: coldfusion cfspreadsheet qoq

我正在阅读电子表格,试图在查询或查询

中运行它
<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

我是否必须一块一块地敲桌子?

1 个答案:

答案 0 :(得分:2)

要让CF将内容填充到查询中,您需要使用“query”属性,而不是“name”属性

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