Writing Sql; Basic Sql Syntax Elements - MACROMEDIA COLDFUSION 5-DEVELOPING Develop Manual

Table of Contents

Advertisement

26

Writing SQL

In between the begin and end
database to execute.
For example, to retrieve data from a database:
Tip
If you are using ColdFusion Studio, you can use the Query Builder to build SQL
statements by graphically selecting the tables and records within those tables that
you want to retrieve.
When the database processes the SQL, it creates a data set (a structure containing
the requested data) that is returned to ColdFusion Server. ColdFusion places the
data set in memory and assigns it the name that you defined for the query in the
attribute of the
You can reference that data set by name using the

Basic SQL syntax elements

The following sections present brief descriptions of the main SQL command
elements.
Statements
A SQL statement always begins with a SQL verb. The following keywords identify
commonly used SQL verbs:
Keyword
SELECT
INSERT
UPDATEw
DELETE
When referencing text literals in SQL, use single quotes ('). For example,
* from mytable WHERE FirstName='Russ'
which the first name is Russ.
Write a SELECT statement that lists the fields or columns that you want to select
for the query.
Follow the SELECT statement with a FROM clause that specifies the database
tables that contain the columns.
cfquery
Description
Retrieves the specified records
Adds a new row
Changes values in the specified rows
Removes the specified rows
tags, write the SQL that you want the
cfquery
tag.
Chapter 3 Querying a Database
selects every record from mytable in
tag later on the page.
cfoutput
Select
name

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 5

Table of Contents