简体   繁体   中英

How to create tables in Oracle DB from the set of *.sql files

I have the set of *.sql files (>200) which contains scripts of tables creation. How can I apply all of them automatically to Oracle DB?

I use Oracle SQL Developer environment

Just create a "driver" sql file, and call that from sqlplus - example, if you have script1.sql, script2.sql, create a file, "driver.sql" and include:

@script1.sql
@script2.sql
...etc...

In which enviroment are you working? Give a bit more information please.

If u use SQLPLUS try this

SQL > @{path}{file}

For Example

SQL > @/usr/bin/script.sql

Executing them with SQL*Plus.

From command line:

sqlplus @script1.sql @script2.sql

Since you are using SQL Developer, just open the script file and run it as a script (F5).

Or in a SQL Worksheet use an at reference to the script file:

@[drive:]\path\to\script1.sql
@[drive:]\path\to\script2.sql
...
@[drive:]\path\to\scriptn.sql

then just run that line (F9) or the entire SQL Worksheet as a script (F5).

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