want to run multiple SQL script file in one go with in SQLPLUS

后端 未结 8 764
陌清茗
陌清茗 2021-02-05 23:14

I have to run multiple SQL script file in one go.

Like every time i have to write command in SQLPLUS

SQL>@d:\\a.txt 
SQL>@d:\\a2.txt
SQL>@d:\\a3.txt
SQL>@d:\\         


        
8条回答
  •  半阙折子戏
    2021-02-06 00:02

    Some tricks and command can help you to generate master.sql file and you can run from that location.

     c:\direcotory_location\dir *.sql /-t /b >master.sql
    

    Go to the parent directory open master.sql open using notepad++ remove master.sql line and use regular expression to replace

       \n  with \n @
    

    go to cmd From cmd

        C:\root_directory\sqlplus user/password @master.sql
    

    I find this process very convenient if i have 30 to 40 scripts placed in a single directory.

提交回复
热议问题