update-clause

Click to skip syntax diagram
Read syntax diagramSkip visual syntax diagram>>-FOR UPDATE--+---------------------+-------------------------><
               |     .-,-----------. |
               |     V             | |
               '-OF----column-name-+-'
 

The UPDATE clause identifies the columns that can be updated in a subsequent positioned UPDATE statement. Each column-name must be unqualified and must identify a column of the table or view identified in the first FROM clause of the fullselect. A column that is used directly or indirectly in the ORDER BY clause must not be specified. The clause must not be specified if the result table of the fullselect is read-only.

If the UPDATE clause is specified without column names, all updatable columns of the table or view identified in the first FROM clause of the fullselect are included.

The FOR UPDATE OF clause must not be specified if the result table of the fullselect is read-only (for more information see DECLARE CURSOR) or if the FOR READ ONLY clause is used.

Positioned UPDATE statements identifying the cursor associated with a select-statement can update all updatable columns, if the select-statement does not contain one of the following:

When FOR UPDATE is used, FETCH operations referencing the cursor acquire an exclusive row lock.