-----------------------------------------------------------------
-- PL/SQL: Updatable Cursor (Section 4.6.3)                     -
-- Chapter 4; Oracle Programming -- A Primer                    -
--            by R. Sunderraman                                 -
-----------------------------------------------------------------

DECLARE
  CURSOR c1 IS
    select * from parts
    for update;
  c1_rec c1%rowtype;

BEGIN
  for c1_rec in c1 loop
    if (c1_rec.qoh > 175) then
      update parts set price = 0.8 * price
      where current of c1;
    end if;
  end loop;
END;
/
