Search code examples
coldfusioncoldfusion-9

cfoutput grouped query - seeing the result


I'd like to have a look at the query that would be inside this:

<cfoutput query="myQuery" group="ID">
   <cfdump var="#theResultingRows#" />
</cfoutput>

Is there a way of getting the internal query results other than running a QoQ with matching id?


Solution

  • Yes, you can use nested cfoutput tags as described in the documentation. You can also use a loop and array notation to save typing.

    <cfoutput query="x" group="id">
     id is #id#<hr>
     <cfoutput>
        <cfloop list="#x.columnlist#" index="field">
          #field# is #x[field][currentrow]#
        </cfloop>
        <br>
      </cfoutput>
    </cfoutput>