CFQUERY

Passes SQL statements for any purpose to your ODBC data source. Not limited to queries.

CFQUERY
Attribute

Description

NAME

Required. The name you assign to the query. Query names must begin with a letter and may consist of letters, numbers, and the underscore character (spaces are not allowed). The query name is used later in the template to reference the queries result set.

DATASOURCE

Required. The name of the ODBC Data Source from which this query should retrieve data.

MAXROWS

Optional. Specifies the maximum number of rows you want returned in the result set.

TIMEOUT

Optional. Lets you specify a maximum number of milliseconds for the query to execute before returning an error indicating that the query has timed-out. This attribute is not supported by most ODBC drivers. TIMEOUT is supported by the SQL Server 6.0 driver.

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.

Example

<CFQUERY NAME="GetList" DATASOURCE="Coffee Valley"> 
   SELECT * FROM Subscribers
</CFQUERY>