Re: Sysdate in Filename for spool Command

From: Richard Kuhler <noone_at_nowhere.com>
Date: Fri, 07 Nov 2003 17:54:03 GMT
Message-ID: <%_Qqb.118734$ZH4.8465_at_twister.socal.rr.com>


mcstock wrote:
> there is no inherent relationship between the two, and it's not at all clear
> what you're asking -- but i'll take a stab at it anyway ;-)
>
> if you mean you'd like to include the current date and/or time in the spool
> filename, then look into using the COLUMN xxx NEW_VALUE, which populates a
> SQL*Plus substitution ('define') variable based on the value of a column in
> a SELECT statement -- the variable can then be used with the SPOOL command
>
> "Thomas Kindermann" <tkinder_at_gmx.de> wrote in message
> news:3fab6530$0$41436$45beb828_at_newscene.com...
>

>>Hi,
>>another question, i hope it is the last:
>>
>>How can i use the spool command with the sysdate function ?

Working code for his explanation ...

column spool_date new_value spool_date

select to_char(sysdate, 'dd-mon-yyyy') spool_date from dual
/

spool my_file_&&spool_date..txt

--
Richard Kuhler
Received on Fri Nov 07 2003 - 18:54:03 CET

Original text of this message