Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Spool To More than 1 File

Re: Spool To More than 1 File

From: Jared Still <jkstill_at_gmail.com>
Date: Thu, 9 Jun 2005 09:46:44 -0700
Message-ID: <bf463805060909461755574e@mail.gmail.com>


I am curious about the comment "you can't use variable here" If it refers to not being able to use the spool cmd with a substitution variable, it is incorrect.

Here is a bit from a script:

col crole noprint new_value urole
prompt Duplicate which role? :
set term off feed off
select lower('&&1') crole from dual;
set term on

define dup_file=_&&urole._grant.sql

set echo off term on feed off
set trimspool on
set verify off pages 0 line 200

spool &&dup_file

Jared

On 6/8/05, Oracle <all_about_oracle_at_hotpop.com> wrote:
>
> You got the answer?
>
> Here is what I going to do
>
>
> Spool /tmp/hardcoded_file.txt #you can't use variable here
> select sysdate from dual;
> spool off
> host /usr/bin/cp /tmp/hardcoded_file.txt /tmp/hardcoded_file2.txt
>
>
>
> ----- Original Message -----
> From: "Post, Ethan" <Ethan.Post_at_ps.net>
> To: <oracle-l_at_freelists.org>
> Sent: Tuesday, June 07, 2005 12:46 AM
> Subject: Spool To More than 1 File
>
>
> > One thing I would like to see is the ability to spool output from
> > SQL*Plus to more than one file at a time. I am writing a script in which
> > I am spooling the results of each command to "foo" and then grepping the
> > foo file for the elapsed time and putting it in a log file using "!grep
> > ...". The problem with this method is that I can't spool the results of
> > the entire script to another file in the event I want to see the detail.
> > I could use some "cat" commands to keep moving the results but this
> > seems like a pretty easy and perhaps usefull feature.
> > --
> > http://www.freelists.org/webpage/oracle-l
> >
>
>
> --
> http://www.freelists.org/webpage/oracle-l
>

-- 
Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Jun 09 2005 - 12:51:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US