Home » SQL & PL/SQL » SQL & PL/SQL » How to read CSV file and insert the same into a oracle table?
How to read CSV file and insert the same into a oracle table? [message #248448] Fri, 29 June 2007 01:48 Go to next message
fortunethiyagu
Messages: 94
Registered: December 2006
Member

How to read CSV file and insert the same into a oracle table?

Recommended not to use SQLLDR.

Have to use only UTL_FILE & PL/SQL....

Iam having 5 columns which have to insert into an oracle table.

can anyone provide the coding?

Thanks in advance. Embarassed
Re: How to read CSV file and insert the same into a oracle table? [message #248454 is a reply to message #248448] Fri, 29 June 2007 02:06 Go to previous messageGo to next message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
External table.

Regards
Michel
icon10.gif  Re: How to read CSV file and insert the same into a oracle table? [message #248458 is a reply to message #248448] Fri, 29 June 2007 02:10 Go to previous messageGo to next message
fortunethiyagu
Messages: 94
Registered: December 2006
Member

sorry i couldnt get you. really i dont know what is external table.

I need UTL_FILE - pl/sql coding sample to insert excel values into an oracle table. Does external table helps me in this regards?

I am not supose to use such external things i hope.
Re: How to read CSV file and insert the same into a oracle table? [message #248467 is a reply to message #248458] Fri, 29 June 2007 02:32 Go to previous messageGo to next message
pablolee
Messages: 2834
Registered: May 2007
Location: Scotland
Senior Member
Hi, If you do a google search on 'Oracle' + 'External Table' you might just find 1 or 2 links to the topics that you need. Alternatively you could download the excellent documentation that Oracle provides free of charge and search those documents (you can even do it online if you prefer not to download the docs)

[Updated on: Fri, 29 June 2007 02:32]

Report message to a moderator

Re: How to read CSV file and insert the same into a oracle table? [message #248480 is a reply to message #248458] Fri, 29 June 2007 02:53 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
fortunethiyagu wrote on Fri, 29 June 2007 09:10
sorry i couldnt get you. really i dont know what is external table.

I need UTL_FILE - pl/sql coding sample to insert excel values into an oracle table. Does external table helps me in this regards?

I am not supose to use such external things i hope.


Is this a homework assignment?
If not, why do you _need_ to use utl_file?
icon10.gif  Re: How to read CSV file and insert the same into a oracle table? [message #248486 is a reply to message #248448] Fri, 29 June 2007 03:19 Go to previous messageGo to next message
fortunethiyagu
Messages: 94
Registered: December 2006
Member

In actual case i need to import data from excel to oracle table.

The process which i have to make are

1) Load excel data into oracle table A.
2) validate the records from table A and
insert the same into table B.

Everything(above mentioned 2 process)should be done with in a single SP.

First time i was using SQLLOADER to load table A. But inside the PL/SQL i couldnt call SQLLOADER. so i thought of using UTL_FILE to import the data. Because i dont have permission to use any other 3rd party tool. Embarassed

Can any one help me inthis regard?

How to call sqlloader inside the SP? Any suggestion?

[Updated on: Fri, 29 June 2007 03:40]

Report message to a moderator

Re: How to read CSV file and insert the same into a oracle table? [message #248491 is a reply to message #248486] Fri, 29 June 2007 03:32 Go to previous messageGo to next message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
external tables.

Regards
Michel
Re: How to read CSV file and insert the same into a oracle table? [message #248611 is a reply to message #248448] Fri, 29 June 2007 13:35 Go to previous messageGo to next message
Bill B
Messages: 1484
Registered: December 2004
Senior Member
Give the guy a break... He might not know about tahiti. See the following link.

http://download.oracle.com/docs/cd/B10501_01/server.920/a96524/c11schem.htm#24433
Re: How to read CSV file and insert the same into a oracle table? [message #248614 is a reply to message #248611] Fri, 29 June 2007 13:53 Go to previous messageGo to next message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Of course he knows it as he has read the sticky. Very Happy

Regards
Michel
icon13.gif  Re: How to read CSV file and insert the same into a oracle table? [message #248615 is a reply to message #248614] Fri, 29 June 2007 14:01 Go to previous messageGo to next message
Bill B
Messages: 1484
Registered: December 2004
Senior Member
Michel Cadot wrote on Fri, 29 June 2007 13:53
Of course he knows it as he has read the sticky. Very Happy

Regards
Michel



Your right as always, he must have read it first. The web site tells you to. Laughing
Re: How to read CSV file and insert the same into a oracle table? [message #248658 is a reply to message #248448] Fri, 29 June 2007 23:55 Go to previous messageGo to next message
fortunethiyagu
Messages: 94
Registered: December 2006
Member

thanks a lot guys.. Embarassed

got it.. just went through external tables... have created such and imported excel data.

thanks michel... Razz

SQL LOADER,
FILE READING-UTL_FILE,
EXTERNAL TABLES
are the only solutions to this kind of problem-a?

-thiyagu





Re: How to read CSV file and insert the same into a oracle table? [message #248660 is a reply to message #248658] Sat, 30 June 2007 01:23 Go to previous message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You can also create your own program with your favorite language.

Regards
Michel

[Updated on: Sat, 30 June 2007 01:24]

Report message to a moderator

Previous Topic: nested if
Next Topic: "smart" Alpha-Numeric Sorting
Goto Forum:
  


Current Time: Tue Dec 06 16:27:32 CST 2016

Total time taken to generate the page: 0.11243 seconds