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!

spool to a file in append mode ?

Status
Not open for further replies.

Muskaan

Programmer
Oct 21, 2002
47
US
Hi all,

I wanted to know if there was a way to spool to a single file in append mode ?

Say, my sql looks like:
---snip---
spool a
<do something1>
spool off

<do something, the output of which i do not want in file a>

spool a
<do something2>
spool off
---snip---

so the results of &quot;do something1&quot; and &quot;do something2&quot; are all there in my file a . Can this be done ?

I am sure my question proves I am a novice at this. Please help!

Thanks in advance,
Muskaan

***Most problems are nothing but lack of ideas***
 
Strange, but true...SPOOL does not have an append mode. But here are a couple of alternatives:

1) spool to a second file name (&quot;spool b&quot;), then merge the two files: &quot;SQL> host copy a+b a&quot; (Copy a and b together into a.)

2) use PL/SQL's UTL_FILE mechanism with does support &quot;append&quot; mode to an existing file.

Dave
 
Thanks for your response Dave, I suppose I will try the other two options. The spooling option (if it had been possible) was far more simple though!
Thanks for your time!
Muskaan :)

***Most problems are nothing but lack of ideas***
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top