-- return.sql
DECLARE
  new_pay employee.pay_amount%TYPE := NULL;
BEGIN
  UPDATE employee
     SET pay_amount = pay_amount * 1.15
   WHERE id = 7881
  RETURNING pay_amount INTO new_pay;

  IF new_pay IS NOT NULL AND new_pay <= 52000 THEN
    COMMIT;
  ELSE
    ROLLBACK;
  END IF;

END;
/

