You are here:

Oracle/data transfer from CSV file to database.

Advertisement


Question
QUESTION: Hello Edson,
I want to transfer the data stored in CSV(comma seperated value) file to Oracle Database table.
Can you guide me how to do this???

ANSWER: Hi there.

There are some good ways to do it. The simplest way is to use a interface, just like PL/SQL Developer or SQL Navigator. This applications have a import suite. In PL/SQL developer it is in tools --> import file.

If you donīt have the possibility to use this applications, so you should think about SQL Loader. Itīs Oracleīs import tool.

The last tip would be to use utl_file and utl_raw. But specifically in this case you will have to create a directory in oracle. ASk your DBA the possibility of creating one.

See the best option and mail me back. So we star with the chosen.

Wait your reply

---------- FOLLOW-UP ----------

QUESTION: Thank you for the suggestions.
But, I have to write my own code that parses the CSV file and generate INSERT statements to load into your Oracle database.
Can you help??

Answer
So you must have to use the final choice, the utl_file.

Utl_file is a oracle�ackage that allows read csv files or others files by pl/sql. But as I told you, you have to create a directory.

First see the possibility of creating one, then we see the solution together.

Regards.
Wait reply

Oracle

All Answers


Answers by Expert:


Ask Experts

Volunteer


Edson

Expertise

I can answer questions about Sql (including Sql tuning), pl/Sql and a bit of oracle administration

Experience

I work as a consultant in Brazil and I face problems of all kind in oracle every day development.

Education/Credentials
INFNET, Oracle Database SQL expert

©2012 About.com, a part of The New York Times Company. All rights reserved.