-- check_emp.sql

DECLARE
   pay_type employee.pay_type_code%TYPE;
   FUNCTION permanent_employee(ptc employee.pay_type_code%TYPE)
            RETURN BOOLEAN
   IS
   BEGIN
      IF ptc IN ('S','H') THEN
         return true;
      ELSE
         return false;
      END IF;
   END permanent_employee;
BEGIN
   SELECT pay_type_code INTO pay_type
   FROM employee
   WHERE id = 7881;
   IF permanent_employee(pay_type) THEN
      UPDATE employee
         SET pay_amount = pay_amount * 1.15
       WHERE id = 7881;
   END IF;
END;
/
