简体   繁体   中英

How to handle the execution of a set of scripts in SQLDeveloper

Sometimes I have to apply this kind of sql script that has in another folder more scripts:

PROMPT "--------------------------------------"
PROMPT "        APLICANDO Edward"
PROMPT "--------------------------------------" 

@./Packages/Edward.sql
@./Packages/Edward2.sql
.
.
.

prompt "------------------------------------------------------"
prompt " FIN DE APLICA Edward"
prompt "------------------------------------------------------"

Usually I had to put that.zip file on the server and execute it in sqlplus, but I don't know if could execute them in SQLDeveloper (in a windows environment). Is there some way to do it in that tool?

If you are not running the scripts using SQL Developer in production, I would not recommend using SQL Developer to test the scripts. You always want your testing to be as close as possible to production.

You had said that SQLPlus will be used run the scripts in production, so I would recommend installing the same version of SQLPlus on your machine to test out the scripts. Running scripts from SQL Developer runs them using SQLcl so the behavior could be slightly different than SQLPlus. Oracle says SQLcl it is 99% compatible with SQLPlus, but without knowing what is in your scripts and what version of SQLPlus/SQLcl/SQL Developer you are using, we can not know for sure.

If you are determined on running your scripts from SQL Developer, in a SQL Worksheet, you just need to change directories to where your scripts live, then execute them just like you would from the command line. If you are on an older version of SQL Developer (pre-SQLcl) this may not work so you will need to upgrade your version of SQL Developer.

SQL 工作表屏幕截图

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM