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?
Open SQL Server Management Studio. Connect to an instance of the SQL Server Database Engine or localhost. Expand Databases, right-click a database (test in the example below), point to Tasks, and click Import Flat File above Import Data.
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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With