Link to home
Start Free TrialLog in
Avatar of MIHIR KAR
MIHIR KARFlag for India

asked on

Loading records from external file-system to DB!

Hi Expert,

I want to insert multiple records on a single query and my records are in an external file.

Please any advice for me ...

I have 2 Approach:: Please suggest which one will work effectively.

1: Using external table ... "insert into table select * from exttbl;"
2: Using SQL loder .
ASKER CERTIFIED SOLUTION
Avatar of jtrifts
jtrifts
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
External tables are just temporary tables loaded with SQL*Loader.

The answer is really where does the file reside?  If it is not on the database server, external table is probably not the solution, the database needs direct access to the file in order to load it.
I agree that both of these approaches can work.  I have also used both of them at different times.  Neither one actually uses a query to get the job done.  Johnsone's comment about where the data file is located, is very important.

There is a third option that can also be used to load data into Oracle tables, that is a PL\SQL procedure that uses the procedures and functions in UTL_FILE to read an ASCII file (on the server) then convert or transform the data if necessary and load it into one or more tables.