I\'m trying to print Fibonacci series in plsql
this is the procedure
CREATE OR REPLACE PROCEDURE fibos(n IN number) IS
DECLARE
first number := 0;
seco
Remove DECLARE
in the CREATE PROCEDURE
statement and add a END;
to your anonymous block calling it.
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