jackyesind
jackyesind

Reputation: 3373

Bulk Update in Oracle from CSV file

I have table and CVS file what i want to do is from csv have to update the table.

csv file as follows (no delta)
1,yes
2,no
3,yes
4,yes

Steps through java

  1. what i have did is read the csv file and make two lists like yesContainList,noContainList in that list added the id values which has yes and no seperately

  2. make the list as coma seperated strinh

  3. Update the table with the comma seperated string

Its working fine. but if i want to handle lakhs of records means somewhat slow.

Could anyone tell whether is it correct way or any best way to do this update?

Upvotes: 0

Views: 2339

Answers (2)

Mohsen Heydari
Mohsen Heydari

Reputation: 7284

Doing jobs like bulk operation, import, exports or heavy SQL operation is not recommended to be done outside RDBMS due to performance issues.

By fetching and sending large tables throw ODBC like API's you will suffer network round trips, memory usage, IO hits ....

When designing a client server application (like J2EE) do you design a heavy batch operation being called and controlled from user interface layer synchronously or you will design a server side process triggered by clients command?.

Think about your java code as UI layer and RDBMS as server side.
BTW RDBMS's have embedded features for these operations like SQLLOADER in oracle.

Upvotes: 1

DS.
DS.

Reputation: 612

There are 2 basic techniques to do this:

  1. sqlldr
  2. Use an external table.

Both methods are explained here: Update a column in table using SQL*Loader?

Upvotes: 1

Related Questions