Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: sqlplus question
Hi,
Here is a script that you can modify to suit your needs:
REM
REM Author : Suresh N. Bhat REM DATE : 10/03/94 REM File Name : sql_dated_spool_name.sql REM Usage : On sqlplus prompt enter: REM @sql_dated_spool_name REM Description: Creates a variable file name from Oracle date functions REM to which the output from SQL*Plus script is spooled.REM
'define YEAR ='||lpad((to_char(sysdate,'yy')),2,'0') year
from dual;
spool off
set heading on feedback on verify on pause on
rem
rem Start the temporary file so that defines can be used in the rem spool command below.
rem The first period(.) below signifies end of define MONTH variable. rem The second period(.) below is the dot(.) between the file name rem and its extention.
Later !!!
Suresh Bhat
Oracleguru
www.oracleguru.net
GreyWolf_69 <GreyWolf_69_at_alloymail.com> wrote in article
<3832FCAD.110D8512_at_alloymail.com>...
> Hi
> I have a sql script that is ran from win98 and out puts a report. I
> want to use a vairablie to set the the month. I then want to use this
> vairable in the spool command to include the month in the file name.
>
> What is the syntax? I've tried a hunder different ways but it doesn't
> work right. I can get the value of the varibale in the file name but I
> end up with the ' marks in the file name. Any help would be great.
>
> Thanks,
>
> Wolf
>
>
Received on Wed Nov 17 1999 - 15:54:37 CST