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

类加,存储过程,大家帮忙看下错在那解决思路

2012-02-05 
类加,存储过程,大家帮忙看下错在那create procedure test(p_b in number ,p_mount in number)asl_a number

类加,存储过程,大家帮忙看下错在那
create procedure test
(p_b in number ,
 p_mount in number)
as
 l_a number(32);
cursor tes1 is
select a from test
where b=P_b;

begin
  l_b:=0;
 for j in test1 loop
if l_b<p_mount then
  l_b=l_b+j.a;
 else
DBMS_OUTPUT.PUT_LINE(l_b);
end if;
  end loop;
end;

各位帮忙看一下这个存储过程,打???号都不知道错在那。

[解决办法]
l_b=l_b+j.a; 
改成
 l_b:=l_b+j.a;
[解决办法]
游标用错了
前面定义游标
后面不能用for
这样用
open tes1 ;
loop
fetch tes1 into ???;
exit when tes1%notfound;

end loop ;

热点排行