|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Building a SELECT Query
|
|
|
|
SQL SELECT statements let you specify the data from which to build the recordset.
|
|
|
|
To create a SELECT statement:
|
|
|
- Open the Query Builder for the data source you want to query.
- When the Query Builder opens, select the first table you want to query.
- 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.
- Drag and drop column names between tables to create joins.
- Right-click on a join to delete the join or change it to an inner or outer join.
- Drag the columns you want to display onto the Column section of the Properties pane.
- Set additional query attributes in the Properties pane.
- Save or insert the query into your page.
|
|
|
|
To use a CFML variable in a SQL WHERE clause:
|
|
|
- Click in the Criteria column in the Properties pane for the column that you want use in the WHERE clause.
- Open the select box and choose CFVARIABLE.
- Double-click on the variable and rename it to the variable in your application.
|
|
|
|
To save a query:
|
|
|
- Click the Save Query button on the Query toolbar.
- Enter a name for the query in the dialog.
- 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.
|
|
|
  
|
|
|
AllaireDoc@allaire.com
Copyright © 1998, Allaire Corporation. All rights reserved.
|