| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: why cant I spool <filename> with a variable?
Rauf Sarwar wrote:
> GS wrote: >
> > 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
>>>
> > select >>>>
>>>to,
>>>select to_char(sysdate,'hh24miss') TS from DUAL;
> > like >>>>/Rauf
>>>&TS..log. &TS.log will work but your filename will come out as e.g.
>>>999999log.lst.
>>>
>>>Regards
> > case, >
> > for a >
> > > 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 >
![]() |
![]() |