Home » SQL & PL/SQL » SQL & PL/SQL » spool without overwrite
spool without overwrite [message #7511] Wed, 18 June 2003 17:09 Go to next message
Joe
Messages: 138
Registered: November 1999
Senior Member
is there a way to spool to a file without overwriting the pre-existing data in the spool file.

I have a script that runs every day, but would like to use something like the unix version of >>.
Thanks.
Re: spool without overwrite [message #7512 is a reply to message #7511] Wed, 18 June 2003 17:41 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
You could spool each day to a temp file and then use the HOST command to concatenate the temp file to the real spool file.

So, if I just spooled to a tempfile call c:temp.sql, the next command will add that to the end of the real file c:log.sql:

host copy c:log.sql + c:temp.sql c:log.sql
Re: spool without overwrite [message #7513 is a reply to message #7512] Wed, 18 June 2003 17:53 Go to previous messageGo to next message
Joe
Messages: 138
Registered: November 1999
Senior Member
Todd,
Actually, I am on a UNIX box, I do something like that now with:

cat file1.log file2.log >> spool.log

but was wondering if there was a better way withing sql*plus.

Thanks.
joe
Re: spool without overwrite [message #7514 is a reply to message #7513] Wed, 18 June 2003 18:10 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Well, the HOST command is inside SQL*Plus - not sure what you mean...
Previous Topic: Database Triggers
Next Topic: PL/SQL tables - Help
Goto Forum:
  


Current Time: Fri Apr 26 18:54:36 CDT 2024