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:\a4.txt
is there any way put all file in one folder & run all script file in one go without missing any single file like @d:\final.txt
or @d\final.bat
Answer: To execute a script file in SQLPlus, type @ and then the file name. The above command assumes that the file is in the current directory. (ie: the current directory is usually the directory that you were located in before you launched SQLPlus.) This command would run a script file called script.
You can include multiple SQL statements on the SQL query panel. The exceptions are CALL and CREATE PROCEDURE statements. These statements must be used alone in a query.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With