SQL support / Positioned updates/deletes |
Updates the current row in a result set of a database cursor declared for update.
UPDATE table-specification SET column = { variable | sql-expression } [,...] WHERE CURRENT OF cid
Use UPDATE ... WHERE CURRENT OF to modify the values of the row currently pointed by the associated FOR UPDATE cursor.
The UPDATE statement does not advance the cursor to the next row, so the current row position remains unchanged.
The scope of reference of the cid cursor identifier is local to the module where it is declared. Therefore, you must execute the DECLARE,UPDATE or DELETE instructions in the same module.
There must be a current row in the result set. Make sure that the SQL status returned by the last FETCH is equal to zero.
If the DECLARE statement that created the cursor specified one or more columns in the FOR UPDATE clause, you are restricted to updating only those columns in a subsequent UPDATE ... WHERE CURRENT OF statement.