sqlplus call sub-scripts from the same dir as the calling script with @@

ls /home/oracle/scripts/sql
build.sql
pk1.sql
pk2.sql
cd /home/oracle/scripts
sqlplus scott/tiger
@/home/oracle/scripts/sql/build.sql

The @@ command. The double at sign is designed to allow scripts that are accessed from non-default (not the current) directory – to call scripts – from that directory – as if it were the current dir.

cat /home/oracle/scripts/sql/build.sql
@@pk1.sql
@@pk2.sql

For more Oracle related articles on this blog:
LonzoDB Oracle Related Blog Posts

Leave a Comment

Scroll to Top