Updating Data Records

So far we have looked at the INSERT statement as a method of moving data into your DB2 table. You may want to update only a column with values for a group of data records. There is an SQL UPDATE statement that can be used to specify the column and its new values. A table or a view can be referenced as the target for the UPDATE statement.

NOTE

Remember that you must have the correct privileges in order to perform the UPDATE operation.

The UPDATE statement can be used in two forms:

  • Searched update— This type of UPDATE statement is used to update one or more rows in a table. It requires a WHERE clause to establish the update condition (which rows are to be updated).

  • Positioned update— This kind of UPDATE statement is always ...

Get DB2® Universal Database™ v8 Application Development Certification Guide, 2nd Edition 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.