how to show results from dbms_out.put_line while the procedure is running
Hallo!
I created the following procedure:
create or replace procedure gerhard1 (n in number default 1) is
begin
dbms_output.put_line ('Initial time: ' || to_char(sysdate, 'HH:MI:SS'));
FOR i IN 1..3 LOOP
dbms_output.put_line ('('|| i ||'): ' || n);
dbms_lock.sleep(n);
END LOOP;
dbms_output.put_line ('Final time: ' || to_char(sysdate, 'HH:MI:SS'));
end;
And when I execute the procedure in SQLPLUS with:
SQL> execute gerhard1(3);
... I get after 9 seconds (the time, the procedure needs for executing) the following result:
Initial time: 04:12:42
(1): 3
(2): 3
(3): 3
Final time: 04:12:51
PL/SQL procedure successfully completed.
But SqlPLUS should show immediate:
Initial time: 04:12:42
(1): 3
Than after 3 seconds:
Initial time: 04:12:42
(1): 3
(2): 3
And after another 3 seconds:
Initial time: 04:12:42
(1): 3
(2): 3
(3): 3
And after another 3 seconds:
Initial time: 04:12:42
(1): 3
(2): 3
(3): 3
Final time: 04:12:51
PL/SQL procedure successfully completed.
What must I change/add inside of my code to realize it?
Please, can anybody help me?
Thanks a lot!
Gerhard