Summary


A data source is needed in order for ColdFusion to communicate with a database. The data source is effectively a driver that acts as a translator for communicating SQL statements to the database back end. <cfquery> is used to prepare the SQL statements and send them through to the data source with the appropriate connection settings. <cfquery> can pass any SQL statement that the data source can handle.

A record set passed back to <cfquery> is converted into a query object. The query object can be looped over for each individual record, and the values of the various columns can be output by using <cfoutput>. <cfoutput> has a group function that provides additional output options for record sets ordered by a particular column.

Query variables can be manipulated and joined on the application server by using a subset of the SELECT SQL commands. Query of queries can be used to reduce the number of required lookups on any information resource that generates query variables. Record sets from disparate information resource types can be joined as required.

Sample Questions

1:

What variables does a <cfquery> query object contain?

  1. RecordCount

  2. ColumnList

  3. ExecutionTime

  4. DBTYPE

2:

<cfoutput> with the GROUP attribute requires which SQL clause in the SQL query?

  1. WHERE

  2. GROUP BY

  3. ORDER BY

  4. JOIN

3:

What combination of attributes in <cfquery> does a query of queries require?

  1. name and datasource

  2. dbtype and datasource

  3. name and query

  4. name and dbtype

4:

Which of the following SQL operations can be performed by using <cfquery>?

  1. SELECT

  2. INSERT

  3. UPDATE

  4. Stored procedure



Macromedia ColdFusion MX 7 Certified Developer Study Guide
Macromedia ColdFusion MX 7 Certified Developer Study Guide
ISBN: 0321330110
EAN: 2147483647
Year: 2004
Pages: 389
Authors: Ben Forta

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net