Home » SQL & PL/SQL » SQL & PL/SQL » How to read a tab delimete file and load in to table using utl_file package
How to read a tab delimete file and load in to table using utl_file package [message #413519] Thu, 16 July 2009 04:22 Go to next message
adusur
Messages: 36
Registered: June 2009
Location: Bhubaneswar
Member
Hi,
For me there is a requirement that, i need to read the dara from
a tab delimeted fileand load in to a table
using utl_file package and plsql procedures.
Each tab seperated field of the file is a column in table.
But, utl_file package is not identifying the tab to
seperate them.I have tried \t also but no use.

How can i do this through procedure.
Hoping for a quick solution.


Thanks in Advance,
Ravi
Re: How to read a tab delimete file and load in to table using utl_file package [message #413521 is a reply to message #413519] Thu, 16 July 2009 04:31 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
This has been asked many and many times, you will get a quicker solution searching by yourself.

In addition, it has been many and many times stated that using utl_file for this is the worst way to do it.

Regards
Michel
Re: How to read a tab delimete file and load in to table using utl_file package [message #413528 is a reply to message #413521] Thu, 16 July 2009 04:50 Go to previous messageGo to next message
adusur
Messages: 36
Registered: June 2009
Location: Bhubaneswar
Member
Hi Michel,
I had searched the forum, but i didn't find suitable solution.
Yes,i know that this approach is not good,
but our leader asked us to do in this way.
Re: How to read a tab delimete file and load in to table using utl_file package [message #413534 is a reply to message #413528] Thu, 16 July 2009 05:03 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
I had searched the forum, but i didn't find suitable solution.

And which unsuitable ones did you find?

Regards
Michel
Re: How to read a tab delimete file and load in to table using utl_file package [message #413549 is a reply to message #413528] Thu, 16 July 2009 06:31 Go to previous messageGo to next message
ayush_anand
Messages: 417
Registered: November 2008
Senior Member
please search Sql loader
Re: How to read a tab delimete file and load in to table using utl_file package [message #413558 is a reply to message #413549] Thu, 16 July 2009 07:23 Go to previous messageGo to next message
ThomasG
Messages: 3212
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Quote:
but our leader asked us to do in this way.


Number one rule of software development: 95% of the problems that you get are because of errors in the requirements.
Re: How to read a tab delimete file and load in to table using utl_file package [message #413574 is a reply to message #413519] Thu, 16 July 2009 08:34 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Your only hope with Utl_file would be to use GET rather than GET_LINE and manually parse the data read looking for tab chrs.

You'd be much better off using either Sql*Loader or creating an external table that pointed to the file.
Previous Topic: How to get the output of SQL%ROWCOUNT inside a procedure to the spool file.
Next Topic: Insufficient Privilege
Goto Forum:
  


Current Time: Sun Feb 09 09:59:32 CST 2025