Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to spool to file with date in name
"Sybrand Bakker" <gooiditweg_at_sybrandb.verwijderdit.demon.nl> wrote in
message news:oq9lj0hba32hgtfccoagpimcbid0j2fq26_at_4ax.com...
| On Sun, 05 Sep 2004 04:38:30 GMT, "Randy Harris" <randy_at_SpamFree.com>
| wrote:
|
| >I'd like to run a SQL from a cron and spool the output to a file with the
| >sysdate in the name to make it unique. Someone please tell me how to do
| >that.
| >
|
|
| column dt new_value _dt
| select to_char(sysdate,'yymmdd') dt
| from dual
| /
| spool file&_dt
|
|
| --
| Sybrand Bakker, Senior Oracle DBA
or use UNIX scripting to generate the file name and pass it as a SQL script parameter, or pass the entire script as a UNIX shell 'here' document
++ mcs Received on Sun Sep 05 2004 - 08:22:56 CDT
![]() |
![]() |