当前所在位置:珠峰网资料 >> 计算机 >> Oracle认证 >> 正文
oracle用sum函数实现累加(二)
发布时间:2010/10/6 10:36:42 来源:www.xue.net 编辑:城市总裁吧
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 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