Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How2 Generate current date in spool-filename in SQL+

Re: How2 Generate current date in spool-filename in SQL+

From: Alistair Thomson <thomson_alistair_at_no.spam.yahoo.co.uk>
Date: Wed, 15 Jan 2003 15:59:40 -0000
Message-ID: <b040h8$bd7$1$8302bc10@news.demon.co.uk>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US