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!

Spool file with formatted sysdate

user11070698Jan 6 2015 — edited Jan 7 2015

Hello All,

I am trying to spool my filename with sysdate in a specific format but when I run the commands below, my file name is f.csv . And when I run spool c:\&f.csv with &, i get prompted. I do not want to get prompted. I want my filename to be YYYY_MMDDYYYY_HO15SL.csv. Any ideas?

SET SERVEROUTPUT ON size unlimited;

COLUMN f new_value f;

SELECT TO_CHAR(SYSDATE,'YYYY')||'_'||TO_CHAR(SYSDATE,'MMDDYYYY')||'_'||'HO15SL FROM dual;

spool c:\f.csv;

select ;

spool off;

Thanks,

KJ

This post has been answered by BluShadow on Jan 7 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 4 2015
Added on Jan 6 2015
11 comments
784 views