for v_emp in c loop
if(v_emp.deptno = 10) then
update emp set sal = sal +10 where current of c;
elsif (v_emp.deptno = 20) then
update emp set sal = sal + 20 where current of c;
else
update emp set sal = sal + 50 where current of c;
end if ;
end loop ;
commit ;
end ;
// 执行存储过程(两种方式)
· exec p;
· begin
p;
end;
2.创建带参数的存储过程
create or replace procedure p
(v_a in number,v_b number,v_ret out number)
is
| 广告合作:400-664-0084 全国热线:400-664-0084 Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号 珠峰网 版权所有 All Rights Reserved
|