Problem solve Get help with specific problems with your technologies, process and projects.

Loading text files into Oracle tables

I am trying to load text file into an Oracle table by writing the code inside a stored procedure using SQL*Plus. Is there any way to do that with out using SQL*Loader?

You can do this a few ways. If you are using Oracle 9i, then you can "mount" the file so that it appears as a table in the database. Oracle 9i calls this new feature External Tables. It uses SQL*Loader as the engine for bringing the data from outside the database to inside the database. The benefit of this is that one the external table has been mounted to the database, you can use simple SQL statements to pull the data from that file.

If you are not using 9i, or do not wish to use this method, then you can use the UTL_FILE supplied package. This package will let you open a file for input or output. So open the file, read the data, and process it, all from within your PL/SQL block!

For More Information

Dig Deeper on Oracle database design and architecture

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.