How to redirect the output of DBMS_OUTPUT.PUT_LINE to a file?
DBMS_OUTPUT is not the best tool to debug, since most environments don’t use it natively. If you want to capture the output of DBMS_OUTPUT however, you would simply use the DBMS_OUTPUT.get_line procedure. Here is a small example: SQL> create directory tmp as ‘/tmp/’; Directory created SQL> CREATE OR REPLACE PROCEDURE write_log AS 2 l_line VARCHAR2(255); … Read more