Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How2 Generate current date in spool-filename in SQL+
Hi
Try this
spool tmp7_spool.sql
select 'spool a:\'||name||'_'||to_char(sysdate,'ddMonyy')||'.txt'
from sys.v_$database;
spool off
/* Run dynamic spool output name */
@tmp7_spool.sql
set feedback off
set heading off
select 'Report Date: '||to_char(sysdate,'Monthdd, yyyy hh:mi')
from dual;
prompt End of Report
spool off
Alistair
<mlouwes_at_yahoo.com> wrote in message
news:41434413.0301150351.1640818e_at_posting.google.com...
> I use sql+ and I want the results of my query in a spool file.
> I need to run this query everyday from the Scheduler and want a new
> file everyday, so I need to generate a unique filename in sql+
> preferable with the current date in the name of the file.
> How can I do this ??
>
> Thanks for your help
>
> Marcel
Received on Wed Jan 15 2003 - 09:59:40 CST
![]() |
![]() |