Procedure with Default Parameter Values
DECLARE
emp_num NUMBER(6) := 120;
bonus NUMBER(6);
merit NUMBER(4);
PROCEDURE Raise_salary
(emp_id IN NUMBER,
amount IN NUMBER DEFAULT 100,
extra IN NUMBER DEFAULT 50)
IS
BEGIN
UPDATE employees
SET salary = salary + amount + extra
WHERE employee_id = emp_id;
END raise_salary;
BEGIN
Raise_salary(120); -- same as raise_salary(120, 100, 50)
Raise_salary(emp_num,extra => 25); -- same as raise_salary(120, 100, 25)
END;
/
0 comments:
Post a Comment