19PL_SQL过程之创建存储过程
来源:互联网 发布:免费tk域名注册的网站 编辑:程序博客网 时间:2024/05/24 05:34
create or replace procedure proc1
is
cursor c is
select * from emp for update;
begin
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 proc1;
begin
proc1;
end;
is
cursor c is
select * from emp for update;
begin
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 proc1;
begin
proc1;
end;
0 0
- 19PL_SQL过程之创建存储过程
- 11PL_SQL过程之创建表
- 20PL_SQL过程之带参数的存储过程
- 21PL_SQL过程之函数
- mysql存储过程之创建存储过程
- 01PL_SQL过程之输出HelloWorld
- 02PL_SQL过程之声明变量
- 03PL_SQL过程之捕获异常
- 06PL_SQL过程之复杂数据类型Table
- 08PL_SQL过程之执行select语句
- 09PL_SQL过程之执行insert语句
- 10PL_SQL过程之执行if语句
- 12PL_SQl过程之三种循环
- 15PL_SQL过程之游标的使用
- 22PL_SQL过程之建立触发器
- 23PL_SQL过程之建立触发器
- 07PL_SQL过程之复杂数据类型之Record
- oracle之存储过程2-创建存储过程
- 分页工具类分装
- Node.js Buffer学以致用
- htML+CSS3-》第4阶段:HTML5之CSS3进阶
- mock浅析
- 移动端布局方案 讲解与实例
- 19PL_SQL过程之创建存储过程
- HexToFloat和HexToDouble
- 跨域解决方案
- sql注入
- 过滤器和拦截器
- 【SQL*Loader】设置参数之ROWS、BINDSIZE和READSIZE
- Android基础学习之SharedPreferences的使用
- python编程结构(编写ArcGIS中的工具)--以我的第一个程序为例
- 送给前线码农的话 - 大牛们的经典语录