PLS-00103 怎么解决

techshinocom 2012-03-22 02:46:31
declare counter integer :=1;
loop
counter :=counter + 1;
exit when counter=5;
end loop;

上面的是Plsql代码,下面是出错信息,望各位帮忙看看是什么问题



ORA-06550: line 4, column 8:
PLS-00103: Encountered the symbol "WHEN" when expecting one of the following:

constant exception <an identifier>
<a double-quoted delimited-identifier> table LONG_ double ref
char time timestamp interval date binary national character
nchar
ORA-06550: line 5, column 3:
PLS-00103: Encountered the symbol "END"
...全文
8114 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
techshinocom 2012-03-22
  • 打赏
  • 举报
回复
啊,天哪,如此不小心,多谢了!!嘿嘿 兰兰姐好牛啊!
兰兰姐是不是专门在CSDN上解决问题的,怎么每次发帖你都能赐教,真是谢谢你了
我心飞翔 2012-03-22
  • 打赏
  • 举报
回复
修改:

DECLARE
counter INTEGER :=1;
BEGIN
LOOP
counter := counter + 1;
EXIT WHEN counter = 5;
DBMS_OUTPUT.PUT_LINE(counter);
END LOOP;
END;


结果:
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 yixilan 的回复:]

少了being,end关键字:
SQL code
set serveroutput on;
declare
counter integer :=1;
begin
loop
counter :=counter + 1;
dbms_output.put_line(counter);
exit when counter=5;
end loop;
end;
[/Quote]

貌似好久木见兰姐咯
yixilan 2012-03-22
  • 打赏
  • 举报
回复
少了being,end关键字:
set serveroutput on;
declare
counter integer :=1;
begin
loop
counter :=counter + 1;
dbms_output.put_line(counter);
exit when counter=5;
end loop;
end;

17,377

社区成员

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

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