Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: spool file naming
Hi,
Below are two SQL scripts. Choose the one that suits you and modify.
REM
REM Author : Suresh N. Bhat REM Date : 10/03/94 REM File Name : unix_dated_spool_name.sql REM Usage : On sqlplus prompt enter: REM @unix_dated_spool_name REM Description: Creates a variable file name from Unix date command REM to which the output from sqlplus script is spooled.REM
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.
Suresh Bhat
Oracleguru
www.oracleguru.net
kal121_at_yahoo.com wrote in article <80skjo$mdb$1_at_nnrp1.deja.com>...
> Is there an easy way to append the sysdate to the spool file name?
>
> SPOOL c:\myfolder\file||SYSDATE||.log -- sort of like this?
>
>
> Thanks!
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Received on Thu Nov 18 1999 - 10:40:06 CST