Building a SELECT Query  
 
 

SQL SELECT statements let you specify the data from which to build the recordset.

 
 
  To create a SELECT statement:  
 
  1. Open the Query Builder for the data source you want to query.
  2. When the Query Builder opens, select the first table you want to query.
  3. Right-click in the Table pane and choose Add Table or click the Add Table button in the tool bar to add additional tables to the query.
  4. Drag and drop column names between tables to create joins.
  5. Right-click on a join to delete the join or change it to an inner or outer join.
  6. Drag the columns you want to display onto the Column section of the Properties pane.
  7. Set additional query attributes in the Properties pane.
  8. Save or insert the query into your page.
 
 
  To use a CFML variable in a SQL WHERE clause:  
 
  1. Click in the Criteria column in the Properties pane for the column that you want use in the WHERE clause.
  2. Open the select box and choose CFVARIABLE.
  3. Double-click on the variable and rename it to the variable in your application.
 
 
  To save a query:  
 
  1. Click the Save Query button on the Query toolbar.
  2. Enter a name for the query in the dialog.
  3. Click Save.

Saved queries are stored on the ColdFusion Database Server. They can be edited and used by to everyone who has access to that server.

If you edit a SQL statement in the SQL pane and then save the query, the changes are saved. However, if you modify the Table pane or change any values in the Properties pane, a new SQL statement is generated, overwriting any edits you made in the SQL pane.



 
 
BackUp LevelNext
 
 

allaire     AllaireDoc@allaire.com
    Copyright © 1998, Allaire Corporation. All rights reserved.