7

I have a simple problem, but I can't find out how to solve it.
I have a file which contains many SQL commands, like this:

insert into .. ;
insert into .. ;
...

And now is the question - how do I import it?
I was trying to import script, but it doesn't work, I'm getting:

Your export file is not supported

When I'm copying my commands manually, it's works. But I can't copy them all, it will take too long.

I'm using Oracle DB 11g XE.

Any solutions?

2 Answers 2

8

You need a SQL interpreter for Oracle. The one that is bundled with every Oracle client installation is called SQL*Plus. And will do what you need to import a file with SQL commands.

You login with it to your Oracle server and then run your script. Let's say your Oracle connection is called mydb and your schema name is scott and your SQL script is stored in a file called myfile.sql. What you can do is:

$ sqlplus scott@mydb

To login to oracle (you will be prompted with your password). And then, once you are inside SQL*Plus, you can do:

> @myfile.sql

Done.

Sign up to request clarification or add additional context in comments.

1 Comment

You'd think this would be easier to find in the Oracle documentation. StackOverflow does it again - thx!
3

Use SQL*Plus or Oracle SQL developer.

With SQL*Plus:

sqlplus <schema>/<pw> @<your_script.sql>

With SQL Developer, open your script, and then "run as script" (F5 I think).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.