Because you SET SERVEROUTPUT ON between executing those PL/SQL blocks.
SQL> -- no output, whichever PL/SQL block you execute:
SQL> declare
2 begin
3 dbms_output.put_line('Loops Starts here....');
4 for i in 1..9 loop
5 dbms_output.put(lpad(i,4,' '));
6 end loop;
7 end;
8 /
PL/SQL procedure successfully completed.
SQL> declare
2 begin
3 dbms_output.put_line('Loops Starts here....');
4 for i in 1..9 loop
5 dbms_output.put(lpad(i,4,' '));
6 end loop;
7 dbms_output.put_line(' ');
8 end;
9 /
PL/SQL procedure successfully completed.
Now, enable the output:SQL> set serveroutput on
SQL> -- the first PL/SQL block again:
SQL> declare
2 begin
3 dbms_output.put_line('Loops Starts here....');
4 for i in 1..9 loop
5 dbms_output.put(lpad(i,4,' '));
6 end loop;
7 end;
8 /
Loops Starts here....
PL/SQL procedure successfully completed.
By the way, did you use DBMS_OUTPUT.PUT on purpose?SQL> l5
5* dbms_output.put(lpad(i,4,' '));
SQL> c/.put/.put_line/
5* dbms_output.put_line(lpad(i,4,' '));
SQL> /
Loops Starts here....
1
2
3
4
5
6
7
8
9
PL/SQL procedure successfully completed.
SQL>