ORA-06550 PL/SQL 用于简单的匿名块

问题描述 投票:0回答:1
-- Created on 1/23/2024 by VIMUKTHIWATHTHEGAMA 
declare 
  -- Local variables here
  i integer;
begin
  -- Test statements here
  
end;

我尝试了上面的代码,并生成了这个错误:

ERROR at line 7:
ORA-06550: line 7, column 1:
PLS-00103: Encountered the symbol "END" when expecting one of the following:
( begin case declare exit for goto if loop mod null pragma
raise return select update while with <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
continue close current delete fetch lock insert open rollback
savepoint set sql execute commit forall merge pipe purge
json_exists json_value json_query json_object json_array
sql oracle plsql
1个回答
0
投票

匿名块必须始终在

BEGIN
END
之间有一个执行部分,即使您不希望该块执行任何操作。下面是最简单的 PL/SQL 块:

begin
   null;
end;
/

(我不确定为什么这个问题得到了如此多的反对票。我认为OP有理由感到困惑。他试图编写一小段代码并收到一条无用的错误消息。你会认为这个问题会有之前在 Stack Overflow 上出现过,但我找不到任何重复项。)

© www.soinside.com 2019 - 2024. All rights reserved.