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:
...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] [santa] [santa]](/data/assets/smilies/santa.gif)
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.