If you’re working on a legacy application or indeed a new application and your either not sure what going on in the CFQuery especially when you use CFQueryParam. Then there is a variable that is returned from CFQuery that contains some very useful information.
In your CFQuery if you set the result=”insertQueryResults” you’ll get a structure giving you information about the query which has just been run, along with the actual SQL. This can be handy if you have IF Statements in the SQL and want to see what was sent to the database, there is also the all the params sent along when using CFQueryParam.
In addition if your doing an Insert statement you can get your new ID back. The name of the variable returned will depend on your flavor of DB
SQL Server only. The ID of an inserted row.
Oracle only. The ID of an inserted row. This is not the primary key of the row, although you can retrieve rows based on this ID.
Sybase only. The ID of an inserted row.
Informix only. The ID of an inserted row.
MySQL only. The ID of an inserted row. MySQL 3 does not support this feature.
Some duplicate information is also returned that you get in the stand CFQuery Structure, but you can also get the execution times and if the query was cached or not which can again help when trying to debug an application.