User Guide

cfquery 283
Attributes
Usage
Because the timeout parameter only the maximum time for each sub-operation of a query, the
cumulative time may exceed its value. To set a timeout for a page that might get a very large result
set, set the Administrator > Server Settings > Timeout Requests option to an appropriate value.
This tag returns data and query information from a ColdFusion data source. The cumulative
query execution time, in seconds, is returned in the variable
cfquery.ExecutionTime.
Attribute Req/Opt Default Description
name Required Name of query. Used in page to reference query record set.
Must begin with a letter. Can include letters, numbers, and
underscores.
dataSource Required Name of data source from which query gets data.
dbtype Optional query query. Use this value to specify the results of a query as
input.
username Optional Overrides username in data source setup.
password Optional Overrides password in data source setup.
maxRows Optional -1 (All) Maximum number of rows to return in record set.
blockFactor Optional 1 Maximum rows to get at a time from server. Range: 1 - 100.
Might not be supported by some database systems.
timeout Maximum number of seconds that each action of a query is
permitted to execute before returning an error. The
cumulative time may exceed this value.
For JDBC statements, ColdFusion sets this attribute. For
other drivers, check driver documentation.
cachedAfter Optional Date value (for example, April 16, 1999, 4-16-99). If date of
original query is after this date, ColdFusion uses cached
query data. To use cached data, current query must use
same SQL statement, data source, query name, user name,
password.
A date/time object is in the range 100 AD–9999 AD.
When specifying a date value as a string, you must enclose
it in quotation marks.
cachedWithin Optional Timespan, using the CreateTimeSpan function. If original
query date falls within the time span, cached query data is
used.
CreateTimeSpan defines a period from the present,
back. Takes effect only if query caching is enabled in the
Administrator.
To use cached data, the current query must use the same
SQL statement, data source, query name, user name, and
password.
debug Optional;
value and
equals sign
may be
omitted
Yes, or if omitted: If debugging is enabled, but the
Administrator Database Activity option is not enabled,
displays SQL submitted to datasource and number of
records returned by query.
No: If the Administrator Database Activity option is
enabled, suppresses display.