Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Creating a spool file with date/time appended to file name

216066Aug 16 2002 — edited Aug 16 2002
In Oracle Sql*Plus, I want to spool out a file, with the date-time stamp as part of the file name. Any idea how to do this?

Here's what I have right now:
SQL>
set serveroutput on size 200000;
rem
rem $OFSA is a UNIX alias so sql plus is talking to UNIX
rem
spool $OFSA/logs/OFSAP/common_coa_id.log;
prompt 'Enter date in mmddyyyy format, without quotes';
exec upd_common_coa_id_driver ('&date_mmddyyyy');
spool off;

As an example, I'd like to have a file with this name: common_coa_id083002.log

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 13 2002
Added on Aug 16 2002
2 comments
64,312 views