Oracle DBMS OUTPUT.PUT LINE

From EggeWiki

Q: How do I view the output from DBMS_OUTPUT.PUT_LINE statements in a stored procedure.

A: You can have the output sent to your screen if you run the following statement before executing the stored proc:

SET SERVEROUTPUT ON

Q: Is there any other way to get the output?

A: Programatically, you can call DBMS_OUTPUT.GET_LINE, and dump the results to the screen/log. SQLPlus does this for you, but most programs don't.

http://docstore.mik.ua/orelly/oracle/bipack/ch06_01.htm You will see output from this package only after your program completes its execution. You cannot use DBMS_OUTPUT to examine the results of a program while it is running. And if your program terminates with an unhandled exception, you may not see anything at all!

http://www.cs.umbc.edu/help/oracle8/server.815/a68001/dbms_out.htm

In a separate PL/SQL procedure or anonymous block, you can display the buffered information by calling the GET_LINE procedure. If you do not call GET_LINE, or if you do not display the messages on your screen in SQL*Plus or Enterprise Manager, then the buffered messages are ignored. The DBMS_OUTPUT package is especially useful for displaying PL/SQL debugging information.