Making Global Updates

Occasionally, you will want to update all rows in a table. To do this, you use UPDATE, too—you just omit the WHERE clause, or specify a WHERE clause that matches multiple rows.

When updating multiple rows using a WHERE clause, always be sure to test that WHERE clause with a simple SELECT statement before executing the UPDATE. If the SELECT returns the correct data (i.e., the data you want updated), you’ll know that it is safe to use with UPDATE. If you don’t, you might update the wrong data!

Tip

Before executing INSERT, UPDATE, or DELETE operations that contain complex statements or WHERE conditions, you should test the statement or condition by using it in a SELECT statement. If SELECT returns incorrect statement results ...

Get Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.