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"
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"
set serveroutput on;
declare
counter integer :=1;
begin
loop
counter :=counter + 1;
dbms_output.put_line(counter);
exit when counter=5;
end loop;
end;
counter INTEGER :=1;
BEGIN
LOOP
counter := counter + 1;
EXIT WHEN counter = 5;
DBMS_OUTPUT.PUT_LINE(counter);
END LOOP;
END;
结果:
兰兰姐是不是专门在CSDN上解决问题的,怎么每次发帖你都能赐教,真是谢谢你了