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 -> Using sysdate as Part of a File Name

Using sysdate as Part of a File Name

From: <paul.izzo_at_mosca-ag.com>
Date: 26 Jan 2005 04:31:59 -0800
Message-ID: <1106742719.503566.173660@f14g2000cwb.googlegroups.com>


I have a simple SQL script that simply reads a table colum and spools it to a file.

Ex. Blah_Blah_FileName.out

However I'd like to have the file name contain the sysdate information as well 'YYYYMMDD'

Ex. Blah_Blah_FileName20050126.out, Blah_Blah_FileName20050127.out etc...

My script contains the following:

CLEAR BREAKS
CLEAR COMPUTES
TIMING START ZEIT
SET HEADING OFF
SET NEWPAGE 0
SET SPACE 0
SET LINESIZE 633
SET PAGESIZE 0
SET ECHO OFF
SET FEEDBACK OFF
SET COLSEP ''
SET ARRAY 10
SET TERMOUT OFF
SET UNDERLINE ''
SPOOL varial_lag.aus
SET COLSEP '|' SELECT
to_char(sysdate,'YYYYMMDD')||'.out' filename schreib_string
from w100.varial_kore
where gelesen <> 'J';

spool &spoolfile

commit;

spool off
SET TERMOUT ON
SET FEEDBACK ON
clear columns
clear breaks
clear computes
TIMING STOP Received on Wed Jan 26 2005 - 06:31:59 CST

Original text of this message

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