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

Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL*Plus Spooling Question

Re: SQL*Plus Spooling Question

From: Ian Brown <browni_at_globalnet.co.uk>
Date: Mon, 23 Jul 2001 20:47:34 +0100
Message-ID: <tloveot4093766@xo.supernews.co.uk>

"Buck Turgidson" <jc_va_at_hotmail.com> wrote in message news:f98999c8.0107171054.7628ec35_at_posting.google.com...
> I have a bunch of long running scripts that I need to run, and I
> always use a standard header in each. Is there a symbolic parameter
> that I can use such that the filename will be used in the .lis file?
> E.g. I want the following (assume ALTER.SQL)
>
> SET ECHO ON
> SET SCAN OFF
> SET AUTOTRACE OFF
> SET PAUSE OFF
> SPOOL C:\LIS\ALTER.LIS
> WHENEVER SQLERROR EXIT SQL.SQLCODE;
> SELECT * FROM GLOBAL_NAME;
>
> to be
>
> SET ECHO ON
> SET SCAN OFF
> SET AUTOTRACE OFF
> SET PAUSE OFF
> SPOOL C:\LIS\%FILE.LIS < -- Symbolic for filename
> WHENEVER SQLERROR EXIT SQL.SQLCODE;
> SELECT * FROM GLOBAL_NAME;
Try this:

Create a GO.SQL file containing
START &1 Write your ALTER.SQL file as

SET ECHO ON
SET SCAN OFF
SET AUTOTRACE OFF
SET PAUSE OFF
SPOOL C:\LIS\&1..LIS < -- Note double period WHENEVER SQLERROR EXIT SQL.SQLCODE;
SELECT * FROM GLOBAL_NAME; Execute with @GO ALTER from the SQL prompt

Hth

Ian Brown Received on Mon Jul 23 2001 - 14:47:34 CDT

Original text of this message

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