
422
Chapter 19: Introduction to Databases and SQL
Deleting data from a database
The DELETE statement removes rows from a table. The DELETE statement has the following
syntax:
DELETE FROM table_name
[ WHERE
search_condition
]
Note:
There are additional options to DELETE depending on your database. For a complete syntax
description for DELETE, see the product documentation.
You can remove all rows from a table using a statement in the form:
DELETE FROM employees
Typically, you specify a WHERE clause to the DELETE statement to delete specific rows of the
table. For example, the following statement deletes John Smith from the table:
DELETE FROM employees WHERE EmpID=51
Updating multiple tables
The examples in this section all describe how to modify a single database table. However, you
might have a database that uses multiple tables to represent information.
One way to update multiple tables is to use one INSERT statement per table and to wrap all
INSERT statements within a database transaction. A transaction contains one or more SQL
statements that can be rolled back or committed as a unit. If any single statement in the
transaction fails, you can roll back the entire transaction, cancelling any previous writes that
occurred within the transaction. You can use the same technique for updates and deletes.
Writing queries using an editor
Dreamweaver MX and H provide a GUI for writing and executing queries. A GUI is
useful for developing and testing your queries before you insert them into a ColdFusion
application.
This section contains a brief description of these GUIs. For more information, see the
documentation on your specific tool.
Writing queries using Dreamweaver MX
This section describes how to define a query using the Dreamweaver MX Recordset dialog box,
which allows you to create a record set without having to manually enter SQL statements.
Defining a record set using this method can be as easy as selecting a database connection and table
from the pop-up menus.
To define a record set without writing SQL:
1
In the Dreamweaver Document window, open the page that will use the record set.
2
To open the Data Bindings panel, select
Window > Data Bindings
.
3
In the Data Bindings panel, click the Plus (+) button and choose Recordset (Query) from the
pop-up menu.
Содержание ColdFusion MX
Страница 1: ...Developing ColdFusion MX Applications...
Страница 22: ...22 Contents...
Страница 38: ......
Страница 52: ...52 Chapter 2 Elements of CFML...
Страница 162: ......
Страница 218: ...218 Chapter 10 Writing and Calling User Defined Functions...
Страница 250: ...250 Chapter 11 Building and Using ColdFusion Components...
Страница 264: ...264 Chapter 12 Building Custom CFXAPI Tags...
Страница 266: ......
Страница 314: ...314 Chapter 14 Handling Errors...
Страница 344: ...344 Chapter 15 Using Persistent Data and Locking...
Страница 349: ...About user security 349...
Страница 357: ...Security scenarios 357...
Страница 370: ...370 Chapter 16 Securing Applications...
Страница 388: ...388 Chapter 17 Developing Globalized Applications...
Страница 408: ...408 Chapter 18 Debugging and Troubleshooting Applications...
Страница 410: ......
Страница 426: ...426 Chapter 19 Introduction to Databases and SQL...
Страница 476: ...476 Chapter 22 Using Query of Queries...
Страница 534: ...534 Chapter 24 Building a Search Interface...
Страница 556: ...556 Chapter 25 Using Verity Search Expressions...
Страница 558: ......
Страница 582: ...582 Chapter 26 Retrieving and Formatting Data...
Страница 668: ......
Страница 734: ...734 Chapter 32 Using Web Services...
Страница 760: ...760 Chapter 33 Integrating J2EE and Java Elements in CFML Applications...
Страница 786: ...786 Chapter 34 Integrating COM and CORBA Objects in CFML Applications...
Страница 788: ......
Страница 806: ...806 Chapter 35 Sending and Receiving E Mail...