Using Result Variables

So far, you have displayed data retrieved using database queries. But sometimes you’ll need access to data about queries (and not just data within queries). For example, if you wanted to display the number of movies retrieved, where would you get that count from?

To simplify this type of operation, ColdFusion can return special variables with every query using the optional RESULT structure. Table 10.1 lists these variables, and as you can see, RecordCount can provide the number of rows retrieved.

Table 10.1. Query RESULT Variables
VariableDescription
CachedFlag indicating whether or not returned query is a cached copy
ColumnListNames of columns in query results (comma-delimited list)
ExecutionTimeQuery execution time (in milliseconds) ...

Get Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.