Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does SQLDeveloper support executing scripts?

I was trying to follow some instructions today, and it starts with the comment

 REM  In SQLPlus I manually copy in each line and execute it. 

That's nice, I don't have SQLPlus, I have SQLDeveloper. The lines that were pasted in were of the type:

 @\\server\dir\dir\dir\commandfile1.txt; COMMIT; 

...etc.

It didn't like it when I tried that in a SQL window. I opened up and pasted in the commands by hand, and it wasn't happy with that either. (Did I mention that I'm not so good with this application nor Oracle, but that everyone else was out today?) The files there started with code like:

 rem set echo on rem execute procedure_name ('parameter1', 'parameter2'); 

A co-worker did have SQLPlus, and together we got it resolved. But, is there a way for me to do this with SQLDeveloper, so I'm not stuck if he's out too?

like image 499
thursdaysgeek Avatar asked Nov 14 '08 01:11

thursdaysgeek


People also ask

What is SQL Developer used for?

SQL Developer provides powerful editors for working with SQL, PL/SQL, Stored Java Procedures, and XML. Run queries, generate execution plans, export data to the desired format (XML, Excel, HTML, PDF, etc.), execute, debug, test, and document your database programs, and much more with SQL Developer.

How do I run multiple scripts in SQL Developer?

In SqlDeveloper preferences: Tools > Preferences > Database > Worksheet check the option for New Worksheet to use unshared connction . This will allow you to execute multiple queries at the same time, each in each tab.


1 Answers

To run scripts in SQL Developer:

@"\Path\Scriptname.sql" 

(You only need the quotes if there are any spaces)

You can set a default Path: Tools menu > Preferences > Database > Worksheet > Select default path to look for scripts

like image 70
user313218 Avatar answered Oct 05 '22 05:10

user313218