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: SQL*PLUS and placing sysdate in spool filename

Re: SQL*PLUS and placing sysdate in spool filename

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 28 Jan 1999 15:54:29 GMT
Message-ID: <36b687cb.12392549@192.86.155.100>


A copy of this was sent to clbeck_at_us.oracle.com (Christopher Beck) (if that email address didn't require changing) On Wed, 27 Jan 1999 20:03:35 GMT, you wrote:

>On 27 Jan 1999 19:36:56 GMT, "Pat Gorden-Ozgul" <gorden_at_xs.bis.bnl.gov> wrote:
>
>>We run spool files in batch mode and would like to place the actual date in
>>the stored spool filename itself for auditing purposes.
>>
>
>Add this as the first lines of the batch
>
>set heading off
>select 'Starting process '||to_char(sysdate,'DD-MON-YYYY HH24:mi:ss') from dual;
>set heading on
>
>
>>If you know how, pls email me: gorden_at_bnl.gov. Thx.

I think they meant they want the FILENAME to have the date -- not the file....

If so:



column filename new_val fn
select to_char(sysdate,'ddmmyyyy')||'.dat' filename from dual;

spool &fn
select * from dual;
spool off


(actually i know they meant this since chris just asked me how to do this....)  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Thu Jan 28 1999 - 09:54:29 CST

Original text of this message

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