8.3. The UPDATE Statement
The function of the UPDATE statement in SQL is to change the values in zero or more columns of zero or more of rows of one table. SQL implementations will tell you how many rows were affected by an update operation or, at a minimum, return the SQLSTATE value for zero rows affected. There are two forms of UPDATE statements: positioned and searched. The positioned UPDATE is done with cursors; the searched UPDATE uses a WHERE that resembles the search condition in a SELECT statement.
Positioned UPDATEs will not be mentioned in this book, for several reasons. Cursors are used in a host programming language, and we are concerned with pure SQL whenever possible. Secondly, cursors in SQL are different from cursors in SQL-89 ...
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