ORACLE How to use spool with dynamic spool location

后端 未结 3 1585
旧时难觅i
旧时难觅i 2020-12-19 13:58

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

3条回答
  •  忘掉有多难
    2020-12-19 14:41

    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

提交回复
热议问题