First, this question relates to Oracle SQL Developer 3.2, not SQL*Plus or iSQL, etc. I've done a bunch of searching but haven't found a straight answer.
I have several collections of scripts that I'm trying to automate (and btw, my SQL experience is pretty basic and mostly MS-based). The trouble I'm having is executing them by a relative path. for example, assume this setup:
scripts/A/runAll.sql
| /A1.sql
| /A2.sql
|
/B/runAll.sql
/B1.sql
/B2.sql
I would like to have a file scripts/runEverything.sql
something like this:
@@/A/runAll.sql
@@/B/runAll.sql
scripts/A/runAll.sql:
@@/A1.sql
@@/A2.sql
where "@@"
, I gather, means relative path in SQL*Plus.
I've fooled around with making variables but without much luck. I have been able to do something similar using '&1'
and passing in the root directory. I.e.:
scripts/runEverything.sql:
@'&1/A/runAll.sql' '&1/A'
@'&1/B/runAll.sql' '&1/B'
and call it by executing this:
@'c:/.../scripts/runEverything.sql' 'c:/.../scripts'
But the problem here has been that B/runAll.sql
gets called with the path: c:/.../scripts/A/B
.
So, is it possible with SQL Developer to make nested calls, and how?