Ok, so i\'m a complete newb with oracle. Now that that\'s out of the way;
I think you can get an understand of what i\'m trying to do below. For each stored procedur
I found a better solution without the need to declare/begin/end code blocks or query statements.
A sample spool filename with the date and time can be achieved by:
sql> column dt new_value _dt
sql> select to_char(sysdate,'ddMONyyyy_hh24mi') dt from dual;
sql> spool &_dt
My file name:
27JUN2011_1727.lst
You can even specify the file extension if you need to (eg .txt). Just create another variable.
source: http://oracle.ittoolbox.com/groups/technical-functional/oracle-apps-l/variable-file-name-with-spool-1508529