반응형

CREATE OR REPLACE PROCEDURE change_salary
(p_id IN NUMBER, p_new_sal IN NUMBER)
IS
BEGIN
UPDATE s_emp SET salary = p_new_sal WHERE id = p_id;
COMMIT;
END
change_salary;
/

 



SELECT id, salary FROM s_emp WHERE id=1;
EXEC change_salary(1,5000);
SELECT id, salary FROM s_emp WHERE id=1;

 

반응형
Posted by 공간사랑
,