The loop uses PL / SQL. Try wrapping PL / SQL in a BEGIN / END block.
If you need to declare variables, start with DECLARE. Something like that:
set serveroutput on begin for a in 1..10 loop dbms_output.put_line('a='||to_char(a)); end loop; end; /
Hope this helps.
PS Note that set serveroutput on is an SQL * Plus command, not a part of PL / SQL. It just includes the output, so you will see the result of the dbms_output.put_line () function.
Mark J. Bobak
source share