Filehelpers Excel to Oracle db

2019-07-27 01:48发布

问题:

I want to import excel data to oracle DB. I got enough help for Excel part, can you guys help me in Oracle side?

Is it possible to import to oracledb with filehelpers? Please provide some sample code for reference.

Thanks Dee

回答1:

If you save the spreadsheet data as .csv files it is relatively straightforward to import it into Oracle using SQLLoader or external tables. Because we can use SQL with external tables they are generally eaiser to work with, and so are preferable to SQLLoader in almost all cases. SQL*Loader is the betterchoice when dealing with huuuuge amounts of data and when ultra-fast loading is paramount.

Find out more about external tables here. You'll find the equivalent reference for SQL*Loader here.



回答2:

A simple and relatively fool-prove way to do that for one-off tasks is to create a new column in the excel sheet, containing a formula like that:

="insert into foobar values('"&A1&"','"&A2&"');"

Copy that to all rows, then copy the whole column into an editor and run it in SQL*Plus or sql developer.



回答3:

I am using Sqlloader to upload data from CSV to Oracle DB.