I am a freelancer and looking for work

My name is Steve Cross and this blog is a collection of some of the interesting things I've found that I felt the need to share. However this blog is also intended to demonstrate my talent as a web designer and developer. If you like what you see and would like a new site, changes to an existing one or for your site to earn more money for you, then head over to my site and check me out.

 
 
 

Coldfusion – CFQuery Variables and Parameters

CFQuery database attributes and parameters

This is a list of all the variables returned by a CFQuery in Coldfusion 8

  1. query.currentRow – The current Row. Useful when processing a loop within a loop (q_names.firstname[q_names.currentRow])
  2. query.columnList – Comma separated list of the query columns
  3. 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”>)

  1. result_set.sql – The SQL statement that was processed
  2. result_set.recordCount – The number of returned rows from a query. 0 = none
  3. result_set.cached – Boolean. Whether the query was cached
  4. result_set.sqlparameters – An array of the cfqueryparam values
  5. result_set.columnList – Comma separated list of the returned columns
  6. result_set.executionTime – Time taken to execute the query. Useful for debugging slow queries and poor indexes
  7. result_set.identitycol – (SQL Server) – The ID of an inserted Row
  8. result_set.rowid – (Oracle) – The ID of an inserted Row
  9. result_set.sys_identity – (Sybase) – The ID of an inserted Row
  10. result_set.serial_col – (Informix) – The ID of an inserted Row
  11. result_set.generated_key – (MySQL Server) – The ID of an inserted Row
  • by codemonkeysteve
  • April 7, 2010
 
-->
 

Have something to say?