views:

479

answers:

2

I have a number of scripts used to build a database. These need to be executed in a certain order. Is it possible to create a script to run other scripts in SQL Developer (1.5.3)?

I know I can do this with sqlplus, but I was hoping there's a similar ability I just don't know about.

A: 

SqlDeveloper should be able to use the same syntax as SqlPlus, i.e.

@@ script1
@@ script2
@@ script3

This will execute script1.sql, script2.sql and script3.sql in order.

skaffman
A: 

The SQL*Plus synthax works (with run script):

@script arg1 arg2 ... argn

or

@"/path/to/directory/script" arg1 arg2 ... argn
Vincent Malgrat
That works - thanks. Both answers seem to work - I'm not sure what the difference is between @ and @@ - but gave this one the check for mentioning the path, which is required if the script isn't in the default directory.
chris
@subdir/script.sql looks for the file in a sub-directory under the current working directory whereas @@ssubdir/script.sql looks for the file in a subdirectory under the directory where the calling script is located.
APC