Using the CFQUERY Tag

Use the CFQUERY tag to define a query on an application page. When ColdFusion encounters a CFQUERY tag on a page, it does the following:

The CFQUERY tag is one of the most frequently used CFML tags. You use it in conjunction with the CFOUTPUT tag so that you can retrieve and reference the data returned from a query.

Refer to the CFML Language Reference for ColdFusion Express for full CFQUERY syntax.

CFQUERY usage example

In this example, the query code tells ColdFusion to:

Note Note:The data source must exist in order to perform a successful query and that's why all examples reference HRApp; a data source delivered with the product.