0

I managed to export data from a table in an Oracle database in .csv format using SQL Plus.

I have this file locally.

Now I need to import this same .csv file into another table in another Oracle database.

The version of Oracle here at work is 11.2 and does not have the SQL Loader utility.

What can I use to perform this import?

I thought about creating a script that has a truncate and a code to take line by line from the CSV file and insert it into the database. How do I do this?

Thank you

asked Dec 19, 2024 at 16:42
0

1 Answer 1

1

The version of Oracle here ... does not have the SQL Loader utility.

That's a real shame because that's precisely the tool you need to do this job properly.

Another alternative might be to use your favourite scripting language to convert the csv into SQL insert statements that you could execute through sqlplus. YMMV.

The version of Oracle here at work is 11.2 ...

That version went out of support some four years ago now!
You really, really need to think about upgrading.

answered Dec 20, 2024 at 12:32
3
  • How can I execute this script that imports data into a table in an Oracle database? This will be included in a routine in a Linux environment, a script made in Windows would not work. Wouldn't a command only through SQL Plus solve the problem? Commented Dec 20, 2024 at 12:57
  • Have you had a look at SQLcl? You can load and unload using this tool: oracle-base.com/articles/misc/sqlcl-unload-and-load-table-data Commented Dec 21, 2024 at 7:59
  • @JoyceFerreira Use awk or perl (or whatever) to reformat the csv into Insert statements, then feed them into sqlplus the same as you would any other SQL script. sqlplus connection < script Commented Dec 23, 2024 at 7:59

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.