Considerations For Update - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

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
(page
305).
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. See
Statement" (page
[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
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

Performance
An UPDATE of primary key columns or columns that are contained in a unique index that affects
multiple rows could perform poorly when compared to an UPDATE of non-key columns. This
is because the UPDATE operation involves moving records in disk by deleting all the records in
the before-image and then inserting the records in the after-image back into the table.
A SELECT with READ UNCOMMITTED ACCESS on a table whose primary key or unique index
key columns are being updated could catch the update operation in an intermediate stage, where
some or all of the affected rows have been deleted from the table but the altered rows have not
yet been inserted back into the table.
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
200
SQL Statements
151).
"Search Condition"
25).
"MERGE INTO

Advertisement

Table of Contents
loading

Table of Contents