How do I put the current date in a spool file name?

column dcol new_value mydate noprint

select to_char(sysdate,'YYYYMMDD') dcol from dual;

spool &mydate._report.txt
-- my report goes here

select * from mytable;

spool off

Comments

  1. Thanks. Exactly what I was looking for.

    ReplyDelete
  2. how can i append sysdate without substution??can you please help me?

    ReplyDelete

Post a Comment

Popular posts from this blog

Reports Builder wont open in Windows 10 64bit - [SOLVED]

csv Data to Rows - SQL

Your session has expired - For Custom Apps after Oracle Apex Upgrade from 5 to 20