So this is my code which I executed in sqllive online ide.
declare
fac number := 1;
n number := &1;
begin
while n > 0 loop
fac := n*fac;
n := n-1;
end loop;
dbms_output.put_line(fac);
end;
Its giving me a "PLS-00103: Encountered the symbol "&" when expecting one of the following:" error
What is wrong with it?
SQL Live is not SQL*Plus. The ampersand is for SQL*Plus substitution variables and does not work in SQL Live. You need to edit your anonymous block and supply a value each time before you run it.