这段代码哪出错了

xej 2008-10-22 09:13:53
declare AALEVEL_ number;temp_ number;PARENT_DOP_ORDER_ID_ number;tempa_ number;
begin
select DOP_STRUCTURE_LEVEL,QTY_PER_ASSEMBLY,PARENT_DOP_ORDER_ID
into AALEVEL_,temp_,PARENT_DOP_ORDER_ID_ from X_CPWLXHQD where PART_NO='15010011' and DOP_ORDER_ID='22';
end;

WHILE AALEVEL_<>0 LOOP
begin
select DOP_STRUCTURE_LEVEL,QTY_PER_ASSEMBLY,PARENT_DOP_ORDER_ID
into AALEVEL_,tempa_,PARENT_DOP_ORDER_ID_ from X_CPWLXHQD
where DOP_ORDER_ID=21 and DOP_STRUCTURE_LEVEL=3;
temp_:=tempa_*temp_;
AALEVEL_:=AALEVEL_-1;
end loop;
这是本人在oracle的一个函数中的一段代码,在调试时出现这个错误:
ORA-06550:line 7,coumln 3:
PLS-00103:Encounttered the symbol "WHILE"
请教这个错误是什么错误,应如何解决
...全文
83 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
范佩西_11 2008-10-22
  • 打赏
  • 举报
回复
declare
AALEVEL_ number;
temp_ number;
PARENT_DOP_ORDER_ID_ number;
tempa_ number;
begin
select DOP_STRUCTURE_LEVEL, QTY_PER_ASSEMBLY, PARENT_DOP_ORDER_ID
into AALEVEL_, temp_, PARENT_DOP_ORDER_ID_
from X_CPWLXHQD
where PART_NO = '15010011'
and DOP_ORDER_ID = '22';

WHILE AALEVEL_ <> 0 LOOP

select DOP_STRUCTURE_LEVEL, QTY_PER_ASSEMBLY, PARENT_DOP_ORDER_ID
into AALEVEL_, tempa_, PARENT_DOP_ORDER_ID_
from X_CPWLXHQD
where DOP_ORDER_ID = 21
and DOP_STRUCTURE_LEVEL = 3;
temp_ := tempa_ * temp_;
AALEVEL_ := AALEVEL_ - 1;
end loop;
end;
xiayuxue 2008-10-22
  • 打赏
  • 举报
回复
ORA-06550:line 7,coumln 3:
PLS-00103:Encounttered the symbol "WHILE"

应该没问题啊,检查下拼写标点呢
chensi05 2008-10-22
  • 打赏
  • 举报
回复
loop

end loop;
是一对啊,期间写不循环的判断
hebo2005 2008-10-22
  • 打赏
  • 举报
回复
loop
exit while AALEVEL_ =0;
eviler 2008-10-22
  • 打赏
  • 举报
回复
应该就是 begin 和end 的原因 ,典型的 SQLserver 的写法
codearts 2008-10-22
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 mosaic 的回复:]
前面begin...end表示代码已经结束了吧。为什么在while前面有end呢?应该放在最后吧?
[/Quote]

是这个原因
mosaic 2008-10-22
  • 打赏
  • 举报
回复
前面begin...end表示代码已经结束了吧。为什么在while前面有end呢?应该放在最后吧?

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧