Home » Developer & Programmer » Forms » Import text file in oracle 9i
Import text file in oracle 9i [message #505500] Tue, 03 May 2011 06:49 Go to next message
sonia.ali
Messages: 40
Registered: April 2009
Location: Pakistan
Member
Hello All,


I want to import text from text file. Kindly guide how i can import in oracle forms ( oracle 9i)

Thanks and regards

Sonia Ali



Re: Import text file in oracle 9i [message #505625 is a reply to message #505500] Wed, 04 May 2011 05:36 Go to previous messageGo to next message
oralover2006
Messages: 144
Registered: January 2010
Location: India
Senior Member
have you used TEXT_IO.GET_LINE or CLIENT_TEXT_IO.GET_LINE to read lines from text file ??

Re: Import text file in oracle 9i [message #505637 is a reply to message #505500] Wed, 04 May 2011 06:34 Go to previous messageGo to next message
sonia.ali
Messages: 40
Registered: April 2009
Location: Pakistan
Member
Hello Friends,

Kindly make the Example in Hr Schema.How to import text .

Thanks

Sonia ALi
Re: Import text file in oracle 9i [message #505640 is a reply to message #505637] Wed, 04 May 2011 06:50 Go to previous messageGo to next message
oralover2006
Messages: 144
Registered: January 2010
Location: India
Senior Member
sonia.ali wrote on Wed, 04 May 2011 17:04
Hello Friends,

Kindly make the Example in Hr Schema.How to import text .

Thanks

Sonia ALi


here is an example, not of HR Schema, its simple to understand...

PROCEDURE test_file_contents IS
   input_file Text_IO.File_Type;
   linebuffer VARCHAR2(200);
BEGIN
   input_file := Text_IO.Fopen('test.txt','r');  -- notice 'r' for Read file
   Loop
      Text_IO.Get_Line ( input_file, linebuffer );
      Text_IO.Put ( Linebuffer );
      Text_IO.New_LIne;
   End Loop;
EXCEPTION
   WHEN no_data_found THEN
        Text_IO.Put_Line('Closing file...');
        Text_IO.Fclose( input_file );
END;


i think it will help.
Re: Import text file in oracle 9i [message #505811 is a reply to message #505640] Thu, 05 May 2011 02:18 Go to previous messageGo to next message
sonia.ali
Messages: 40
Registered: April 2009
Location: Pakistan
Member
Hello Friend,


Thank you very much to your reply. Dear Sorry to say you. I new comer in oracle. I have been read text_io package in oracle 10g .Its working in oracle 10g.
But I could not understand in oracle 9i. So kindly completely guide me how I can run in oracle 9i.

Thanking you.

Sonia ALi
Re: Import text file in oracle 9i [message #505819 is a reply to message #505811] Thu, 05 May 2011 03:00 Go to previous messageGo to next message
athar.fitfd@hotmail.com
Messages: 193
Registered: October 2007
Location: pakistan
Senior Member
convert text file into csv and
user sql loader to import data into oracle table
Re: Import text file in oracle 9i [message #505825 is a reply to message #505819] Thu, 05 May 2011 03:32 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
text_io works in oracle 9. In fact it works with oracle 8. It's a forms package not a DB one so the DB version doesn't matter.
If you want to do it with a DB package use utl_file or sqlloader.
Re: Import text file in oracle 9i [message #505900 is a reply to message #505825] Thu, 05 May 2011 09:36 Go to previous message
oralover2006
Messages: 144
Registered: January 2010
Location: India
Senior Member
cookiemonster wrote on Thu, 05 May 2011 14:02
text_io works in oracle 9. In fact it works with oracle 8. It's a forms package not a DB one so the DB version doesn't matter.
If you want to do it with a DB package use utl_file or sqlloader.


as she ask to import with oracle forms 9i, it works, if not try using CLIENT_TEXT_IO instead TEXT_IO.

sonia ali, please clarify your problem/need in some detail here, what actually want to do with it ?

Previous Topic: Tried to move Data Block Detail
Next Topic: hidden window
Goto Forum:
  


Current Time: Sat Sep 07 15:26:05 CDT 2024