Understanding UPDATE

Now, take a closer look at the SQL statement you just used. The first line issued the UPDATE statement and specified the name of the table to update. As with the INSERT and DELETE statements, the table name is required.

You next specified the column you wanted to change and its new value:

SET FirstName='Ben'

This is an instruction to update the FirstName column with the text Ben. The SET keyword is required for an UPDATE operation, because updating rows without specifying what to update makes little sense.

The SET keyword can be used only once in an UPDATE statement. If you are updating multiple rows—for example, to change Benjamin to Ben and to set the LastName to Forta in one operation—the SET keyword would look like this: ...

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.