The output of DBMS_OUTPUT (ie. the results of PUT and PUT_LINES) is written to a buffer stored in the SGA. The contents of the buffer are only accessible using DBMS_OUTPUT.GET_LINE and DBMS_OUTPUT.GET_LINES - which is effectively what both TOAD and SQL-PLUS use (assuming you SET SERVEROUTPUT ON - TOAD internally does the same thing) to display the contents once execution of the procedure / package that you have invoked completes. This also explains why the output of DBMS_OUTPUT is only available when the procedure / package execution completes.
You can programmatically clear the buffer by calling DBMS_OUTPUT.DISABLE in your procedure / package.
You can also programmatically access the contents of the buffer yourself by coding DBMS_OUTPUT.GET_LINES in a procedure / package (and then saving the results into a table).
Package and procedure execution is stateless, meaning that there is no direct access to an output device while the procedure / package is running - the only way to get information to the outside world is to write it into a buffer like what DBMS_OUTPUT does. This also means that there is no access to a clipboard buffer (which exists only on the client side anyway and procedures / packages run on the server side).
The only way to save the contents of the DBMS_OUTPUT buffer is to turn SPOOLing on in SQL-PLUS (or save the contents of TOAD's output window to a file).
Stephen Miller - email: miller_stephen at usa.net
------ Original Message ------
Received: 09:56 AM EDT, 06/28/2017
From: christophe.wirtz bounce-christophewirtz@toadworld.com
To: toadoracle@toadworld.com
Subject: [Toad for Oracle - Discussion Forum] DBMS OUTPUT : new feature
DBMS_OUTPUT : new feature
Thread created by christophe.wirtz
Hello,
it could be nice, to trigger DBMS_OUTPUT in a script with pseudo instructions like :
/DBMS_CLEAR/ --clear the dbms_output window
/*DBMS_SAVE */ -- save dbms content to a file
/*DBMS_COPY */ __ copy to clipboard
...
Thank you for reading.
Best regards,
Christophe Wirtz
senior PLSQL developper
To reply, please reply-all to this email.
Stop receiving emails on this subject.
Or Unsubscribe from Toad for Oracle Forum notifications altogether.
Toad for Oracle - Discussion Forum
Flag this post as spam/abuse.