New Attribute and Object Variable in
Ever wanted to output the actual SQL from a dynamic query you are debugging? With CFMX 7 you can do it!
There is a new attribute in the tag called “result” which specifies a name for the structure in which cfquery returns the result variables.
Then you can reference #result_name.sql# to output the actual SQL statement to the page.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Variable name Description
- query_name.currentRow Current row of query that cfoutput is processing.
- query_name.columnList Comma-delimited list of the query columns.
- query_name.RecordCount Number of records (rows) returned from the query.
- result_name.sql The SQL statement that was executed.
- result_name.recordcount Number of records (rows) returned from the query.
- result_name.cached True if the query was cached; False otherwise.
- result_name.sqlparameters An ordered Array of cfqueryparam values.
- result_name.columnList Comma-delimited list of the query columns.
- result_name.ExecutionTime Cumulative time required to process the query.
There are more cool things you can do with this attribute including execution time and sqlparameters.
See the Live docs for more info