When I run a procedure in Toad that produces output via DBMS_OUTPUT calls, my output is out of order. What I see most often is the first 100 lines of output are returned at the very end of the output instead of at the beginning.
Example:
Steps:
1. In the Editor | DBMS Output | click on 'Turn output on'
2. Execute below example via F5
begin
DBMS_OUTPUT.PUT_LINE('This is the beginning');
for i in 1..9999 loop
DBMS_OUTPUT.PUT_LINE('Loop number ' || to_char(i, '9990'));
end loop;
DBMS_OUTPUT.PUT_LINE('This is the end');
end;
/
3. The results will return 1 thru 99 at the very end of the entire results instead of 1 thru 9999, where 9999 is the very last result.
WORKAROUND:
In the Editor | DBMS Output tab | turn off output. The output will still show and in the correct order when output is turned off.
STATUS:
Waiting for fix in a future release of Toad for Oracle.