This is a list of all the variables returned by a CFQuery in Coldfusion 8
- query.currentRow – The current Row. Useful when processing a loop within a loop (q_names.firstname[q_names.currentRow])
- query.columnList – Comma separated list of the query columns
- query.recordCount – The number of returned rows from a query. 0 = none
If you assign a result in the CFQuery statement, you can access additional variables regarding the query result set. (e.g. <cfquery name=”q_query” datasource=”application.dsn” result=”result_set”>)
- result_set.sql – The SQL statement that was processed
- result_set.recordCount – The number of returned rows from a query. 0 = none
- result_set.cached – Boolean. Whether the query was cached
- result_set.sqlparameters – An array of the cfqueryparam values
- result_set.columnList – Comma separated list of the returned columns
- result_set.executionTime – Time taken to execute the query. Useful for debugging slow queries and poor indexes
- result_set.identitycol – (SQL Server) – The ID of an inserted Row
- result_set.rowid – (Oracle) – The ID of an inserted Row
- result_set.sys_identity – (Sybase) – The ID of an inserted Row
- result_set.serial_col – (Informix) – The ID of an inserted Row
- result_set.generated_key – (MySQL Server) – The ID of an inserted Row
