Skip to Main Content

Breadcrumb

May 4th

Question and Answer

Connor McDonald

Thanks for the question, marwa.

Asked: September 15, 2017 - 8:27 am UTC

Last updated: September 20, 2017 - 1:56 am UTC

Version: 10g

Viewed 1000+ times

You Asked

Hello,
I would like to do these 3 steps automatically one time per day with oracle:
1) transfert .csv files.
2) Delete data from table.
3) Load table again with sqlldr from .csv files transferred.

So if you could please let me know what would the best possible approach to do this.

and Connor said...

Transfer from where ? I'll assume you mean you receive some files and want to make them accessible to the database.

For me, I'l would look at external tables (although sqlldr will work just fine as well) - you get just more flexibility with external tables.

Anyway, here is the process:

1) place csv files in a location where they are accessible by the database, ie, either on the database server itself or on a file share that can be seen from the server

2) perform 'truncate table' on the target tables, or use the TRUNCATE keyword in your sqlldr control file

3) load the tables with

insert /*+ append*/ into target_table
select * From external_table

or run your sqlldr load process.

Plenty of examples of both all over AskTOM.

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

marwa zerzeri, September 18, 2017 - 8:14 am UTC


load data into tables from csv

marwa zerzeri, September 19, 2017 - 8:18 am UTC

Thank you for the response
how could i load data into tables from csv files using insert /*+ append*/ instead of sqlldr?
Connor McDonald
September 20, 2017 - 1:56 am UTC

More to Explore

Utilities

All of the database utilities are explained in the Utilities guide.