Spooling more than one file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kwartz
    New Member
    • Dec 2007
    • 35

    #1

    Spooling more than one file

    I have several .sql file that I am runing from the dos prompt using echo. I want to spool the log files of each of the .sql files into one. The way I have it now, the current log file overwrites the previous. Can somebody please help me? This is very urgent

    Thanks

    Code:
    echo spool c:\temp\oracle\script_output.txt >  c:\temp\oracle\tests.sql
    echo @c:\temp\oracle\Create_Config.sql      >> c:\temp\oracle\tests.sql
    echo spool off                              >> c:\temp\oracle\tests.sql
    echo exit;                                  >> c:\temp\oracle\tests.sql
    echo                                        >> c:\temp\oracle\tests.sql
    
    sqlplusw tryadmin/admin@trydb @c:\temp\oracle\tests.sql
    
    echo spool c:\temp\oracle\script_output.txt   > c:\temp\oracle\tests.sql
    echo @c:\temp\oracle\text.sql  >> c:\temp\oracle\tests.sql
    echo spool off                                >> c:\temp\oracle\tests.sql
    echo exit;                                    >> c:\temp\oracle\tests.sql
    echo                                          >> c:\temp\oracle\tests.sql
    
    sqlplusw tryadmin/admin@trydb @c:\temp\oracle\tests.sql
  • Dave44
    New Member
    • Feb 2007
    • 153

    #2
    Originally posted by kwartz
    I have several .sql file that I am runing from the dos prompt using echo. I want to spool the log files of each of the .sql files into one. The way I have it now, the current log file overwrites the previous. Can somebody please help me? This is very urgent

    Thanks

    Code:
    echo spool c:\temp\oracle\script_output.txt >  c:\temp\oracle\tests.sql
    echo @c:\temp\oracle\Create_Config.sql      >> c:\temp\oracle\tests.sql
    echo spool off                              >> c:\temp\oracle\tests.sql
    echo exit;                                  >> c:\temp\oracle\tests.sql
    echo                                        >> c:\temp\oracle\tests.sql
    
    sqlplusw tryadmin/admin@trydb @c:\temp\oracle\tests.sql
    
    echo spool c:\temp\oracle\script_output.txt   > c:\temp\oracle\tests.sql
    echo @c:\temp\oracle\text.sql  >> c:\temp\oracle\tests.sql
    echo spool off                                >> c:\temp\oracle\tests.sql
    echo exit;                                    >> c:\temp\oracle\tests.sql
    echo                                          >> c:\temp\oracle\tests.sql
    
    sqlplusw tryadmin/admin@trydb @c:\temp\oracle\tests.sql
    can you create one file which starts the spool, setting echo on and have that script call all the others that you need to run?

    so have like control.sql and within it call all the other scripts that need to be run. as long as none of the others have exit in them they should run through sqlplus as one large script. I use a similar technique.

    Comment

    • kwartz
      New Member
      • Dec 2007
      • 35

      #3
      Thanks for the help, I first used append but then changed to what you suggested and it worked perfectly, I really appreciate your help.

      Comment

      • kwartz
        New Member
        • Dec 2007
        • 35

        #4
        Help Needed

        I have a log file that is generated from numerous .sql file. I am trying to add a line in the .cmd file that runs these .sql should there be an error in in the log file. This is what I have so far

        Code:
        echo spool c:\temp\script_output.txt           > c:\temp\Initialize.sql 
        echo @c:\temp\tst1.sql                             >>c:\temp\Initialize.sql 
        echo @c:\temp\tst2.sql                             >>c:\temp\Initialize.sql
        echo spool off                                           >>c:\temp\initialize.sql 
        echo exit;                                                >>c:\temp\Initialize.sql 
        echo                                                      >>c:\temp\Initialize.sql
        
        
        sqlplusw aduser/admin@tstdb @c:\temp\Initialize.sql
        
        FIND "ORA-" "C:\Program Files\DRS\MDIG3\db\script_output.txt"
        This displays all errors in the log file, however I just want to "echo" errors found .
        Can someone please help me with this? This is quite urget need to get it done by cob.
        Thanks

        Comment

        • amitpatel66
          Recognized Expert Top Contributor
          • Mar 2007
          • 2358

          #5
          Duplicate Threads merged for better management of forum

          MODERATOR

          Comment

          Working...