Cfquery result structs
In old Coldfusion 6, you could access the number of rows returned for a select query by going queryName.recordcount.
In CF8, cfquery now has a result attribute, which is used for naming a struct containing additional information about the query executed. So now for the query:
<cfquery name="a" result="aRes" datasource="uid"> ... </cfquery>
You can do both a.recordcount and aRes.recordcount, but only the latter works for update or delete queries!
Another useful thing that's new and that's in the named result struct is the full executed query, which is accessed like aRes.sql and can be useful for debugging purposes, instead of first building the query as a string which you insert into the query and then output.

Add new comment