![]() ![]() ![]() |
Any ColdFusion application can make use of any available supported data source. Once a data source has been made available to ColdFusion using the ColdFusion Administrator, interacting with that data source is a simple matter of naming the data source and telling ColdFusion what you want to do. Often, this interaction employs the CFQUERY tag , as the following example shows:
<CFQUERY NAME="EmployeeName" DATASOURCE="BigCompany"> SELECT FirstName + " " + LastName FROM Employees AS FullName </CFQUERY>
This example is saying: "Give me the list of names from the BigCompany database that are in the FirstName and LastName columns of the Employees table. And while you're at it, combine the FirstName and LastName columns into a new column called FullName." Here, the script passed by CFQUERY is an example of a simple SQL (Structured Query Language) statement. For a quick introduction to SQL, see Chapter 11, Inserting, Updating, and Deleting Data.
In addition to traditional ODBC data sources (which can include spreadsheet and text files) your ColdFusion application pages can also retrieve data from a variety of Web data sources:
![]() ![]() ![]() |
AllaireDoc@allaire.com
Copyright © 1998, Allaire Corporation. All rights reserved.