首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

急 存储过程出现异常:警告创建的过程带有编译异常

2012-03-19 
急 存储过程出现错误:警告创建的过程带有编译错误cerate or replace procedure piscursor c isselect * fr

急 存储过程出现错误:警告创建的过程带有编译错误
cerate or replace procedure p
is 
  cursor c is
  select * from emp2 for update;
begin
  for v_emp in c loop
  if(v_temp.deptno = 10) then
  update emp2 set sal =sal +10 where current of c;
  elsif(v_temp.deptno = 20) then
update emp2 set sal =sal +20 where current of c;
  else
  update emp2 set sal =sal +50 where current of c;
  end if;
  end loop;
  commit;
end;


[解决办法]

SQL code
cerate or replace procedure pis    cursor c is  select * from emp2 for update;begin  for v_emp in c loop  if(v_emp.deptno = 10) then  update emp2 set sal =sal +10 where current of c;  elsif(v_emp.deptno = 20) thenupdate emp2 set sal =sal +20 where current of c;  else  update emp2 set sal =sal +50 where current of c;  end if;  end loop;  commit;end;
[解决办法]
试过了可以 你把变量都写对了 别一会v_emp 一会v_temp

热点排行