I have a group of scripts that I want to run in sequence from a master script. I have created a file referencing those scripts as follows below. My problem is that when I run this script (using either F5 or another script referencing this one), it only runs the first line and stops. I have ruled out issues with my file references by changing the order - it always runs the first one and stops. I have tried as displayed below as well as using a semi-colon ; to separate each command. I have scoured the web and can't find any reason why this isn't working. Each of the scripts referenced below contains multiple statements separated with a ; that spools a file to a NAS where it is picked up by our external file transfer program. All of that works correctly - the only thing I'm having issues with is using 1 script to call multiple files and execute them in sequence.
Any help is greatly appreciated!!
What version of SQL Developer? It is working for me in 4 EA2.
All scripts are in the same directory.
Putting the cursor on @multiscript and hitting either f5 or f9 will run both contained scripts.
I've tried with an exit in the first script and without. Works either way.
Try experimenting with simpler scripts to eliminate
If you are planning to turn this into a production system you should probably use sqlplus rather than sqldeveloper. SQLDeveloper's sqlplus compatibility isn't perfect yet, so try testing with sqlplus as well.
I have version 3.1.07. I do not have access to sqlplus and will not be running this on a server. It will be a process my team runs monthly using SQLDeveloper and I'm trying to simplify it as much as possible so that each individual script doesn't have to be kicked off separately (there are 17 in the sequence).
I have all scripts in the same directory. When I try what you described above and run the command @multiscript, it throws an error for each command on my multiscript.sql file saying it can't open the file referenced. So it is running through every line now, but it says it can't open the files. However, if I run it directly from within the multiscript.sql file by pressing F5, it runs the first command and then stops. So it can find the file there and execute it, but it won't go past the first line.
I upgraded and now my worksheet referring to the multiscript.sql file no longer throws the error indicating it can't open the files. However, it is now giving me the same issue as when I try to run it from the multiscript.sql file itself - it runs the first command and stops!
Note you can put a path in: Tools->Preferences->Database->Worksheet->'Select default path to look for scripts'
I tried the following:
set echo on
select 'finished' from dual;
select 'one' from dual;
select 'two' from sql;
in a worksheet run:
> select 'one' from dual
> select 'two' from dual
> select 'finished' from dual
Things that could go wrong:
Your scripts could end with 'exit'.
The paths could get mixed up: try @ (not @@) and full paths.
You could have hit a code issue which the worksheet does not recover from - in which case you should get output on the command line and or Logging Page in view messages.