Neoview SQL Reference Manual (R2.2)
WHERE search-condition
specifies a search-condition that selects rows to update. Within the search-condition,
columns being compared are also being updated in the table or view. See “Search Condition”
(page 248).
If you do not specify a search-condition, all rows in the table or view are updated.
Do not use an UPDATE statement with a WHERE clause that contains a SELECT for the same
table. Reading from and inserting into, updating in, or deleting from the same table generates
an error. Use a positioned (WHERE CURRENT OF) UPDATE instead.
[FOR] access-option ACCESS
specifies the access-option required for data used in the evaluation of a search condition.
See “Data Consistency and Access Options” (page 30).
READ COMMITTED
specifies that any data used in the evaluation of the search condition must be from
committed rows.
SERIALIZABLE | REPEATABLE READ
specifies that the UPDATE statement and any concurrent process (accessing the same
data) execute as if the statement and the other process had run serially rather than
concurrently.
SKIP CONFLICT
enables transactions to skip rows locked in a conflicting mode by another transaction.
The rows under consideration are the result of evaluating the search condition for the
UPDATE statement. SKIP CONFLICT cannot be used in a SET TRANSACTION statement.
Considerations for UPDATE
Authorization Requirements
UPDATE requires authority to read and write to the table or view being updated and authority
to read any table or view specified in subqueries used in the search condition. A column of a
view can be updated if its underlying column in the base table can be updated.
Transaction Initiation and Termination
The UPDATE statement automatically initiates a transaction if there is no active transaction.
Otherwise, you can explicitly initiate a transaction with the BEGIN WORK statement. When a
transaction is started, the SQL statements execute within that transaction until a COMMIT or
ROLLBACK is encountered or an error occurs.
Isolation Levels of Transactions and Access Options of Statements
The isolation level of a Neoview SQL transaction defines the degree to which the operations on
data within that transaction are affected by operations of concurrent transactions. When you
specify access options for the DML statements within a transaction, you override the isolation
level of the containing transaction. Each statement then executes with its individual access option.
You can explicitly set the isolation level of a transaction with the SET TRANSACTION statement.
See “SET TRANSACTION Statement” (page 166).
Conflicting Updates in Concurrent Applications
If you are using the READ COMMITTED isolation level within a transaction, your application
can read different committed values for the same data at different times. Further, two concurrent
applications can update (possibly in error) the same column in the same row.
In general, to avoid conflicting updates on a row, use the SERIALIZABLE isolation level. However,
note that when you use SERIALIZABLE, you are limiting concurrent data access.
UPDATE Statement 171