帮忙看下这个存储过程。。。

[复制链接]
查看11 | 回复2 | 2005-10-30 17:05:33 | 显示全部楼层 |阅读模式
create or replace procedure pro_1(sum0 number,rote0 number) is
cursor cur_1 is select * from emp_sal order by sal for update of sal;
sum1 number;
sum number;
rote number;
begin
sum:=sum0;
rote:=rote0;
for i in cur_1 loop
select sum(sal) into sum1 from emp_sal;
if (sum1+i.sal+i.sal*rote) > sum then
exit;
end if;
sum:=sum1+i.sal*(1+rote);
update emp_sal set sal=sal*(1+rote) where current of cur_1;
end loop;
end;
/

错误:
PLS-00103: 出现符号 "THEN"在需要下列之一时:
(
如果去掉if判断里面的局部变量 rote和sum
执行就没问题,没什么啊???
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
sum是关键字,不要做变量名
回复

使用道具 举报

千问 | 2005-10-30 17:05:33 | 显示全部楼层
有道理
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行