Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Newbie:Spool file
Dmitry E. Loginov wrote:
> "Generic Account 1209" <masc1209_at_rohan.sdsu.edu> wrote in message
> news:d8qnj4$ivg$1_at_gondor.sdsu.edu...
> >
> > Hello Everyone,
> > I am learning SqlPlus and I wonder if there's a way
> > to append the some of my SQL practice into the same
> > file?
> > I mean, I would like to something like the following
> >
> > SQL>spool prac.txt
> > SQL>select * from empbb02;
> > .....
> > SQL>spool off
> > SQL>do something else
> > .....
> > SQL>spool prac.txt
> > SQL>alter table empbb02....
> > .....
> > SQL>spool off
> > ....
> >
> > I would like to capture only some of my practice into the
> > same file.
> > Is there a way to do it?
>
>
> Unfortunately you can't append spool to a existing file, nevertheless you
> can spool your output to set of files (prac1.txt, prac2.txt, etc) and
> concatenate ones later by the OS coman (f.e. copy) using HOST command in
> SQLPlus.
> Yet another way - If there is not necessary to see results on the terminal
> while script running, You can redirect output of the SQLPlus to file in the
> command line (f.e. sqlplus u/p_at_db @sript.sql > prac.txt) and use SET TERMOUT
> command to turn output on and off.
> > Thank you very much.
> >
> > Dean
>
> Dmitry
Slightly different version would be to keep spooling to e.g. prac.txt but right after each spool off command copy the contents to another file,
SQL> spool prac.txt SQL> bunch of stuff SQL> spool off SQL> host more prac.txt>>combinedprac.txt...
Regards
/Rauf
Received on Thu Jun 16 2005 - 03:49:54 CDT
![]() |
![]() |