-- return.sql

DECLARE
  old_pay employee.pay_amount%TYPE := NULL;
BEGIN
  UPDATE employee
     SET pay_amount = 52000
   WHERE id = 7881
  RETURNING pay_amount INTO old_pay;

  IF old_pay != NULL AND old_pay < (52000 * .8) THEN
    COMMIT;
  ELSE
    ROLLBACK;
  END IF;

END;
/
