Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!drn.maxwell.syr.edu!news.maxwell.syr.edu!postnews.google.com!l41g2000cwc.googlegroups.com!not-for-mail
From: "Rauf Sarwar" <rs_arwar@hotmail.com>
Newsgroups: comp.databases.oracle.server
Subject: Re: why cant I spool <filename> with a variable?
Date: 4 Apr 2005 16:08:47 -0700
Organization: http://groups.google.com
Lines: 71
Message-ID: <1112656127.219048.232820@l41g2000cwc.googlegroups.com>
References: <TDi4e.171362$fc4.61690@edtnps89>
   <1112653555.623254.118210@f14g2000cwb.googlegroups.com>
   <Quj4e.155410$gJ3.146068@clgrps13>
NNTP-Posting-Host: 195.92.67.76
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1112656131 18587 127.0.0.1 (4 Apr 2005 23:08:51 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 4 Apr 2005 23:08:51 +0000 (UTC)
In-Reply-To: <Quj4e.155410$gJ3.146068@clgrps13>
User-Agent: G2/0.2
Complaints-To: groups-abuse@google.com
Injection-Info: l41g2000cwc.googlegroups.com; posting-host=195.92.67.76;
   posting-account=3xsT9QwAAAC3x7TJbwl3Hj0DXQs_bISq
Xref: dp-news.maxwell.syr.edu comp.databases.oracle.server:239628


GS wrote:
> Rauf Sarwar wrote:
> > GS wrote:
> >
> >>I know I have done this before, but I dont know why this is not
> >
> > working
> >
> >>and I cant find my old script where I did this, perhaps someone
here
> >
> > can
> >
> >>point out the obvious for me...
> >>
> >>I want to run a script every X minutes for awhile tomorrow morning
> >
> > for
> >
> >>about 1 hour, and I want the output spooled to a file with a
> >
> > timestamp,
> >
> >>simple enough so I write the following script called log_usage.sql:
> >>
> >>====================================================
> >>col TS noprint new_value TS
> >>select to_char(sysdate,'hh24:mi:ss') TS from DUAL;
> >>
> >>spool &TS.log;
> >>@@temp_usage.sql;
> >>spool off;
> >>====================================================
> >>
> >>I keep getting the "SP2-0332 cannot create spool" file error, not a
> >>matter of permissions etc as I can spool to a file fine without the
> >>variable (this is a windows machine as well)
> >>
> >>
> >>what am I missing here?
> >>
> >>TIA
> >
> >
> > 1) You are using an illegal character ":" to name a file. Change
select
> > to,
> > select to_char(sysdate,'hh24miss') TS from DUAL;
> >
> > 2) Always put an extra . when using replacement variable with a .
like
> > &TS..log. &TS.log will work but your filename will come out as e.g.
> > 999999log.lst.
> >
> > Regards
> > /Rauf
> >
> ok, that works, but it appears I have to use my linux box in any
case,
> as a quick look at windows scheduler doesnt seem to have a setting
for a
> job to run every X minutes :(

Create your job to run daily e.g. at 10:00pm. Once the job is created,
Right Click on it and goto Properties --> Schedule --> Advanced then
choose your times in "Repeat Task".

Regards
/Rauf

