Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started
by Ben Forta, Raymond Camden, Charlie Arehart
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access