update-clause

The UPDATE clause identifies the columns that can appear as targets in an assignment clause 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. The clause must not be specified if the result table of the fullselect is read-only.

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

If an UPDATE clause is specified with a column-name list, and extended indicator variables are not enabled, then column-name must be an updatable column.

If the UPDATE clause is specified without column-name list, then the implicit column-name list is determined as follows:
  • If extended indicator variables are enabled, all the columns of the table or view identified in the first FROM clause of the fullselect.
  • Otherwise, all the updatable columns of the table or view identified in the first FROM clause of the fullselect.
If the UPDATE clause is not specified in a select-statement and its result table is not read-only, then an implicit UPDATE clause will result. The implicit column-name list is determined as follows:
  • If extended indicator variables are enabled, all the columns of the table or view identified in the first FROM clause of the fullselect are included.
  • Otherwise, all the updatable columns of the table or view identified in the first FROM clause of the fullselect are included.

The UPDATE 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.

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