SQL> DECLARE
2 salary NUMBER := 20000;
3 employee_id NUMBER := 36325;
4
5 PROCEDURE give_bonus (emp_id IN NUMBER, bonus_amt IN NUMBER) IS
6 BEGIN
7 DBMS_OUTPUT.PUT_LINE(emp_id);
8 DBMS_OUTPUT.PUT_LINE(bonus_amt);
9 END;
10
11 BEGIN
12 give_bonus(employee_id,
13 CASE
14 WHEN salary >= 10000 AND salary <=20000 THEN 1500
15 WHEN salary > 20000 AND salary <= 40000 THEN 1000
16 WHEN salary > 40000 THEN 500
17 ELSE 0
18 END);
19 END;
20 /
PL/SQL procedure successfully completed.
SQL>
SQL>
|