An UPDATE statement sets the value in a column.
You can update the current row of an open, updatable cursor. If there is no current row, or if the current row no longer satisfies the cursor's query, an exception is raised.
The first syntactical form is called a searched update. The second syntactical form is called a positioned update.
For searched updates, you update all rows of the table for which the WHERE clause evaluates to TRUE.
For positioned updates, you can update only columns that were
included in the
Specifying DEFAULT for the update value sets the value of the column to the default defined for that table.
A searched update statement depends on the table being updated, all of its conglomerates (units of storage such as heaps or indexes), all of its constraints, and any other table named in the WHERE clause or SET expressions. A CREATE or DROP INDEX statement or an ALTER TABLE statement for the target table of a prepared searched update statement invalidates the prepared searched update statement.
The positioned update statement depends on the cursor and any tables the cursor references. You can compile a positioned update even if the cursor has not been opened yet. However, removing the open cursor with the JDBC close method invalidates the positioned update.
A CREATE or DROP INDEX statement or an ALTER TABLE statement for the target table of a prepared positioned update invalidates the prepared positioned update statement.
Dropping an alias invalidates a prepared update statement if the latter statement uses the alias.
Dropping or adding triggers on the target table of the update invalidates the update statement.