Home > Articles

  • Print
  • + Share This
This chapter is from the book

SQL Builder

A useful feature that ColdFusion Studio has built in is the SQL Builder, which allows you to view the table layouts and make queries on the fly.

To do this, click on Tools > SQL Builder.

Figure 1-15FIGURE 1–15 ColdFusion's built-in SQL Builder.

When you see this screen, you'll have to have an RDS connection to the source with which you will be working. If you are going to be using a datasource on your own machine, make sure you have RDS services running. (Check in your ColdFusion Server folder, and run the "ColdFusion RDS Services.") Drill into the Customers table, and click on New Query.

Choose the shelleyCatalog datasource, and select New Query. Now you will be able to choose which table from the shelleyCatalog you would like to use. If you would like to use another table when building a query, right-click and choose Add Table. You will be able to select from a list of all the other tables available from the datasource in which you are working. For this example, we will just be using the Customers table.

Figure 1-16FIGURE 1–16 As you choose your fields, the query statement is automatically built for you.

By double-clicking on the wildcard * you will choose all fields in the table. As you will notice in the bottom window, the SQL statement is built for you. After the query statement is built, select the RUN Query button and the query will execute. This is used to validate the query.

Figure 1-17FIGURE 1–17 The results from running the SQL Builder.

This can also be helpful when working with several tables at once. With a little investigation, it can really save you some time!

  • + Share This
  • 🔖 Save To Your Account