Q:

Write a PL/SQL procedure to calculate the incentive on a specific target otherwise a general incentive to be paid using IF-THEN-ELSE

0

Write a PL/SQL procedure to calculate the incentive on a specific target otherwise a general incentive to be paid using IF-THEN-ELSE.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

DECLARE
  PROCEDURE test1 (
    sal_achieve  NUMBER,
    target_qty  NUMBER,
    emp_id NUMBER
  )
  IS
    incentive   NUMBER := 0;

  BEGIN
    IF sal_achieve > (target_qty + 200) THEN
      incentive := (sal_achieve - target_qty)/4;
ELSE
 incentive :=75;
END IF;
DBMS_OUTPUT.PUT_LINE ('incentive = ' || incentive);
      UPDATE emp
      SET salary = salary + incentive 
      WHERE employee_id = emp_id;
   
  END test1;
BEGIN
  test1(2300, 2000, 144);
  test1(3600, 3000, 145);
END;
/

Sample Output:

incentive = 75
incentive = 150

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now