Using the OUT Mode
DECLARE
emp_num NUMBER(6) := 120;
bonus NUMBER(6) := 50;
emp_last_name VARCHAR2(25);
PROCEDURE Raise_salary
(emp_id IN NUMBER,
amount IN NUMBER,
emp_name OUT VARCHAR2)
IS
BEGIN
UPDATE employees
SET salary = salary + amount
WHERE employee_id = emp_id;
SELECT last_name
INTO emp_name
FROM employees
WHERE employee_id = emp_id;
END raise_salary;
BEGIN
Raise_salary(emp_num,bonus,emp_last_name);
dbms_output.Put_line('Salary has been updated for: '
||emp_last_name);
END;
/
OUTPUT :-
Salary has been updated for: Weiss
PL/SQL procedure successfully completed.
0 comments:
Post a Comment