Thursday, March 11, 2010

How to spool to a single file in SQL Plus

The team wants my scripts to spool to one log file so it is easier to verify. I found the following from Oracle Forum.

For UNIX or Linux.

spool temp.txt
your_sql;
spool off
host cat temp.txt >> your_file.txt
host rm temp.txt

For Windows.

spool temp.txt
your_sql;
spool off
host type temp.txt >> your_file.txt
host del temp.txt

No comments:

Post a Comment

Added more to my mindmap tool

 This essay version allows you to add long essays to each topic. https://www.free-mindmap.com/Mindmap4LawSchoolEssay.html As I promised, the...