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

Home -> Community -> Usenet -> c.d.o.server -> Re: spool file name question

Re: spool file name question

From: <oratune_at_aol.com>
Date: Thu, 28 Sep 2000 22:31:37 GMT
Message-ID: <8r0gsa$sid$1@nnrp1.deja.com>

In article <8r0g8p$s2e$1_at_nnrp1.deja.com>,   kal121_at_my-deja.com wrote:
> Have you actually tried this? This was my first guess, but
> concatenating &1 to the spool file name does not work. It's a little
> tricker than that.
>
> In article <8r0f6h$r2g$1_at_nnrp1.deja.com>,
> oratune_at_aol.com wrote:
> > In article <8r0asc$n70$1_at_nnrp1.deja.com>,
> > kal121_at_my-deja.com wrote:
> > > Nope, that doesn't work either. It still prompts for user input.
> > >
> > > In article <8qvuib$bm4$1_at_nnrp1.deja.com>,
> > > kal121_at_my-deja.com wrote:
> > > > define fnam = $SCRIPTS/ddl/'&1'_utl_recreate.sql
> > > > spool &fnam
> > > >
> > > > Still results in the same problem. The output file is still
 named:
> > > >
> > > > 'dev1'_utl_recreate.sql
> > > >
> > > > And if you take the ' ' off, it prompts you for user input.
> > > >
> > > > In article <970120306.14621.2.pluto.d4ee154e_at_news.demon.nl>,
> > > > "Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote:
> > > > > Contrary to the other post,
> > > > >
> > > > > the best method to do this
> > > > > is to include
> > > > > define fnam = '&1'
> > > > > spool &fnam
> > > > >
> > > > > This will also make your code more readable.
> > > > >
> > > > > Regards,
> > > > >
> > > > > Sybrand Bakker, Oracle DBA
> > > > >
> > > > > <kal121_at_my-deja.com> wrote in message news:8qu2c1$t14
 $1_at_nnrp1.deja.com...
> > > > > > I'm trying to create a name for a spool file on the fly. &1
 is a
> > > > > > parameter I pass to this script. In the script, I build up
 the
 spool
> > > > > > file name as follows:
> > > > > >
> > > > > > spool $SCRIPTS/ddl/'&1'_utl_recreate.sql
> > > > > >
> > > > > > This works ok, the file name ends up looking like this:
> > > > > >
> > > > > > 'dev1'_utl_create.sql
> > > > > >
> > > > > > If I don't put the single quotes around &1, it assumes it is
> > > > > > interactive waits for user input. This I don't want. Is
 there
 a
 better
> > > > > > way of doing this?
> > > > > >
> > > > > >
> > > > > > Sent via Deja.com http://www.deja.com/
> > > > > > Before you buy.
> > > > >
> > > > >
> > > >
> > > > Sent via Deja.com http://www.deja.com/
> > > > Before you buy.
> > > >
> > >
> > > Sent via Deja.com http://www.deja.com/
> > > Before you buy.
> > >
> >
> > The statement
> >
> > spool $SCRIPTS/ddl/'&1'_utl_recreate.sql
> >
> > should be
> >
> > spool $SCRIPTS/ddl/&1._utl_recreate.sql
> >
> > presuming that '.' is your concatenation character. This will solve
> > your problem.
> >
> > --
> > David Fitzjarrell
> > Oracle Certified DBA
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

Yes, I have actually tried this and it works. Use the concat character to accomplish this.

--
David Fitzjarrell
Oracle Certified DBA


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Sep 28 2000 - 17:31:37 CDT

Original text of this message

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