|
create or replace procedure pro_mypro(v_empno in number,v_newsal out number)
is
v_oldsal number;
begin
select sal into v_oldsal from emp1 where empno=v_empno;
dbms_output.put_line(v_empno||'的原工资是:'||v_oldsal);
if v_oldsal<2000 then
update emp1 set sal=sal*1.1 where empno=v_empno;
end if;
select sal into v_newsal from emp1 where empno=v_empno;
end;
--调用存储过程
declare
v_sal number;
v_empno number:=&员工编号;
begin
pro_mypro(v_empno,v_sal);
dbms_output.put_line(v_empno||'的新工资是:'||v_sal);
end; |
|