User Guide
Chapter 1: ColdFusion Tags 167
When specifying a date value as a string, make sure it is enclosed in quotes.
CACHEDWITHIN
Optional. Enter a timespan using the ColdFusion CreateTimeSpan function.
Cached query data will be used if the original query date falls within the time span
you define. The CreateTimeSpan function is used to define a period of time from
the present backwards. Effective only if query caching has been enabled in the
ColdFusion Administrator. To use cached data, the current query must use the
same SQL statement, data source, query name, user name, password, and
DBTYPE. Additionally, for native drivers it must have the same DBSERVER and
DBNAME (Sybase only).
PROVIDER
Optional. COM provider (OLE-DB only).
PROVIDERDSN
Optional. Data source name for the COM provider (OLE-DB only).
DEBUG
Optional. Used for debugging queries. Specifying this attribute causes the SQL
statement actually submitted to the data source and the number of records
returned from the query to be output.
Usage In addition to returning data from a ColdFusion data source, the CFQUERY tag also
returns informations about the query. CFQUERY.ExecutionTime returns the time it
took the query to execute in milliseconds.
CFQUERY creates a query object, providing you information in three query variables as
described in the following table.
You can cache query results and execute stored procedures. For information about
caching CFQUERY results, executing stored procedures, and displaying CFQUERY
output, see Developing Web Applications with ColdFusion.
CFQUERY Variables
Variable Name Description
query_name.RecordCount The total number of records returned by
the query.
query_name.CurrentRow The current row of the query being
processed by CFOUTPUT.
query_name.ColumnList Returns a comma-delimited list of the
query columns.