DBMS_ouput.put_line

Does the DBMS_output.put_line logs the lines to be displayed in a file which can be accessed later?

Thanks.

DBMS_OUTPUT is an oracle supplied package that simply collects and then outputs to the screen buffer. Again, this is an Oracle feature that toad merely exposes/leverages. So it has to work the way Oracle defined - which is no, does not write to a file. Could toad be made to add this extra capability - maybe. So suggest you add this idea to the toad idea pond and see if people vote on it …

Just one addition to Bert answer…

If you put in Toad:

set serveroutput on size unlimited;
spool c:\some_filename
begin
dbms_output.put_line(‘this si dbms output text’);
end;
spoo off

And run as script (F5) then if you look in created file in c:…content is:
this si dbms output text
PL/SQL procedure successfully completed.

And this is just what you are looking for.

Brg

Damir

Thanks all for your responses. The response from damir.vadas_531 is a sure help. Thank you Damir.

If you want to supress “PL/SQL procedure successfully completed.” in file

then place

SET FEEDBACK OFF

i.e.

SET FEEDBACK OFF

spool c:\some_filename

I also recommend that spooling to file include set trimout on and set trimspool on - will keep file sizes far more reasonable :slight_smile:

Valuable tips! Thank you again!