Writing Sql And Cfml Statements To Interact With A Data Source; Cfml Tags That Interact With A Database - MACROMEDIA COLDFUSION MX 61-GETTING STARTED BUILDING COLDFUSION MX Getting Started

Building coldfusion mx applications
Table of Contents

Advertisement

Writing SQL and CFML statements to interact with a data source

After ColdFusion makes a connection to the data source, you can interact with that database by
using SQL and ColdFusion.
To interact with an established data source, you need to include SQL statements in your CFML
statements; for example:
<cfquery name="queryname" datasource="namedbfile">
SELECT FirstName, LastName, DepartmentID
From Employee
</cfquery>
In the previous example, the first attribute of
attribute of
cfquery
(columns) to be retrieved from a tabled named

CFML tags that interact with a database

The following table lists the CFML tags you can use to interact with a database:
Command
Description
cfquery
To retrieve (query) information in a database.
cfinsert
To add records to a database.
cfupdate
To update information in a database.
In Part II of this book, you will be introduced to these tags when you use them to interact with
the sample database. For more information about interacting with a database, see Developing
ColdFusion MX Applications or CFML Reference.
defines the name of the data source. The
is the name of the query. The second
cfquery
SELECT
.
Employee
Using SQL with ColdFusion
statement defines the fields
35

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION MX 61-GETTING STARTED BUILDING COLDFUSION MX and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion mx

Table of Contents