遇到以下符号之一时遇到符号 "end-of-file"

Encountered the symbol "end-of-file" when expecting one of the following

我正在尝试在 plsql

中打印斐波那契数列

这是程序

CREATE OR REPLACE PROCEDURE fibos(n IN number) IS
DECLARE  
first number := 0; 
second number := 1; 
temp number;   
i number; 
BEGIN
dbms_output.put_line('Series:'); 
dbms_output.put_line(first); 
dbms_output.put_line(second); 
for i in 2..n 
loop 
temp:=first+second; 
first := second; 
second := temp; 
dbms_output.put_line(temp); 
END loop; 
END; 
/

Warning: Procedure created with compilation errors.

这是我调用程序的地方:

DECLARE
a number := &a;
BEGIN
fibos(a);
/

这是我遇到的错误

fibos(a); * 第 4 行的错误: ORA-06550:第 4 行,第 9 列: PLS-00103: 在期待其中一个时遇到符号 "end-of-file" 下列的: begin case declare end exception exit for goto if loop mod null pragma raise return select update while with << 关闭当前删除获取锁定插入 打开回滚保存点集 sql 为所有合并执行提交 管道

删除 CREATE PROCEDURE 语句中的 DECLARE 并在调用它的匿名块中添加 END;

CREATE OR REPLACE PROCEDURE fibos(n IN number) IS
first number := 0; 
second number := 1; 
temp number;   
i number; 
BEGIN
dbms_output.put_line('Series:'); 
dbms_output.put_line(first); 
dbms_output.put_line(second); 
for i in 2..n 
loop 
temp:=first+second; 
first := second; 
second := temp; 
dbms_output.put_line(temp); 
END loop; 
END; 
/

DECLARE
a number := &a;
BEGIN
fibos(a);
END;
/

db<>fiddle