Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

logging dbms_output to a file

Status
Not open for further replies.

Delphiwhat

Programmer
Apr 1, 2003
74
EU
Hi all

Does anyone know how I cam log the ddms_output to a file ( I need to be able to save the file for debug purposes.

unfortunately the UTL_FILE package is not installed on the oracle server.


Thanks!!

jscter
 
In the absence of UTL_FILE, you can (before the beginning of your PL/SQL block) issue the SQL*Plus command:
Code:
spool MyFile.txt
set serveroutput on format wrap
Then, to offer added enhancement to your outputting pleasure, early in your BEGIN section, issue this command:
Code:
DBMS_OUTPUT.ENABLE(1000000);
This increases the DBMS_OUTPUT buffer from its 2K default to 1 million bytes (the maximum).

Following the completion of your PL/SQL block's output, you then issue the command:
Code:
spool off
...which closes the MyFile.txt file.

I also like to issue these informational commands from SQL*Plus, following the completion of my PL/SQL block:
Code:
prompt
prompt Wrote to file "MyFile.txt"
prompt
This gives a heads-up to the user of what file name to look for on disk.

Let us know how all this works for you.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[ Providing low-cost remote Database Admin services]
Click here to join Utah Oracle Users Group on Tek-Tips if you use Oracle in Utah USA.
 
Cheers Mufasa for your help - worked a treat

Your a life saver!!


You don't by chance know how to send an email notification without UTL_SMTP?

Thanks

jscter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top