Oracle Text Import Tip

May 12, 2011

Want to import text into Oracle? A user at the Oracle FAQ’s forum has kindly provided the following instructions:

“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;”

Who says this content acquisition is not easy?

Cynthia Murrell May 12, 2011

Comments

Comments are closed.

  • Archives

  • Recent Posts

  • Meta