SQL Builder is a powerful visual tool that you can use to build, test, and save SQL statements for use in application data queries. You can copy a SQL code block directly into your application or insert it into a cfquery tag. You can also use SQL Builder to test your queries.
cfquery tag editor and click the New Query button. The New Query button looks like this:
In the Select Table dialog box (shown in the following graphic), select the table that you want to query against, and click Select.
The following graphic shows the SQL Builder user interface:
The SQL Builder is divided into these sections:
The SQL pane does not support reverse editing, so any changes that you make in this pane are not made in the Properties pane or the Table pane.
When SQL Builder opens, it displays a SELECT statement by default, since this is the most common type of query. If you have not yet selected a table for your query, you are prompted to select one.
SQL Builder supports these types of SQL statements:
For instructions, see the opening SQL Builder procedure earlier in this section.
SQL SELECT statements let you specify data from which to build a recordset.
For instructions, see the opening SQL Builder procedure earlier in this section.
For instructions, see the opening SQL Builder procedure earlier in this section.
For instructions, see the opening SQL Builder procedure earlier in this section.
Saved queries are stored on the database server. They can be edited and used by anyone who has access to the server.
|
Note ColdFusion Studio does not update the Properties and Table panes when you make changes in the SQL pane. If you edit a SQL statement in the SQL pane and save it, and then modify the Table pane or change any values in the Properties pane, a new SQL statement is generated which overwrites the changes that you made in the SQL pane. |
This section describes how to insert new and saved queries into a page in the Editor.
cfquery tag, click the Copy CFQUERY button. Close SQL Builder and paste the query into your page. ColdFusion Studio prompts you to save the query.You can also select CFQUERY from the Tag Chooser.
The query appears in the Editor.
You can refine SQL statements after constructing them.
Before inserting a query into an application, we recommend that you test it in SQL Builder. The following procedure explains how to run a query for testing.
|
Caution Only test SELECT statements. When you click the Run Query button, the SQL statement is processed. If you run an INSERT, UPDATE, or DELETE statement, the changes that you coded in the SQL statement are made in the data source. |
The Run Query button looks like this:
If you save a query, you can edit it later. However, pages containing the query are not automatically updated. To make the changes take effect, you must reinsert the query into the pages.
|
Note ColdFusion Studio does not update the Properties and Table panes when you make changes in the SQL pane. If you write a query in the SQL pane and save it, the Properties and Table panes show no changes. But the SQL pane displays the SQL generated from changes made in the Properties and Table panes. |
LiveDocs comments are not longer enabled for ColdFusion 5.0. Please use one of the following resources instead.
ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting
Version 5.0