MACROMEDIA COLDFUSION MX 61-CFML Reference page 284

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

This tag creates a query object, providing this information in query variables:
Variable name
query_name.currentRow
query_name.columnList
query_name.RecordCount
cfquery.ExecutionTime
You can cache query results and execute stored procedures. For information about this and about
displaying
cfquery
The Caching page of the ColdFusion MX Administrator specifies the maximum number of
cached queries. Setting this value to 0 disables query caching.
You cannot use ColdFusion reserved words as query names.
You cannot use SQL reserved words as variable or column names in a Query of Queries, unless
they are escaped. The escape character is the bracket []; for example:
SELECT [count] FROM MYTABLE.
For a list of reserved keywords in ColdFusion MX, see Chapter 22, "Using Query of Queries," in
Developing ColdFusion MX Applications.
Database query results for date and time values can vary in sequence and formatting, unless you
use functions to format the results. To ensure that customers using your ColdFusion application
are not confused by the display, Macromedia recommends that you use the
functions to format values from queries. For more information and examples, see
TimeFormat
TechNote 22183, "ColdFusion Server (5 and 4.5.x) with Oracle: Formatting Date and Time Query
Results," at www.coldfusion.com/Support/KnowledgeBase/SearchForm.cfm.
Example
<!--- This example shows the use of CreateTimeSpan with CFQUERY ------>
<!--- define startrow and maxrows to facilitate 'next N' style browsing ---->
<cfparam name="MaxRows" default="10">
<cfparam name="StartRow" default="1">
<!--------------------------------------------------------------------
Query database for information if cached database information has
not been updated in the last six hours; otherwise, use cached data.
--------------------------------------------------------------------->
<cfquery
name="GetParks" datasource="cfsnippets"
cachedwithin="#CreateTimeSpan(0, 0, 6, 0)#">
SELECT PARKNAME, REGION, STATE
FROM Parks
ORDER BY ParkName, State
</cfquery>
<!---- build HTML table to display query ------------------------->
<table cellpadding="1" cellspacing="1">
<tr>
<td colspan="2" bgcolor="f0f0f0">
<b><i>Park Name</i></b>
</td>
<td bgcolor="f0f0f0">
<b><i>Region</i></b>
</td>
284
Chapter 2: ColdFusion Tags
Description
Current row of query that
Comma-delimited list of the query columns
Number of records (rows) returned from the query
Cumulative time required to process the query
output, see Developing ColdFusion MX Applications.
is processing
cfoutput
DateFormat
and

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents