kartshan
kartshan

Reputation: 131

Bulk update of tables in Oracle

I have a requirement where I need to make bulk updates to a table from a flat file in a Java program.

The flat file will have thousands of entries with Comma Separated Values. So if the entry in the flat file is found in table, I should update the row, else I need to insert it into another table. So I have written a function for the same. But my problem is updating the table at one go for all the entries in the flat file.

I have come across bulk insertion using SQL loader, but that cannot be used for updating the table.

I also used the JDBC batch update, but the problem is stored procedure/Function with out or inout parameters cannot be batched.

Can anyone suggest if there is a way to do this ?

Upvotes: 3

Views: 1187

Answers (2)

A.B.Cade
A.B.Cade

Reputation: 16905

I'd use a external table (referencing a file as a table) and then use a merge command (a command that lets you do upserts) to update / insert my table

Upvotes: 6

dbrin
dbrin

Reputation: 15673

Google GORM its a bit more involved but you will write less code.

Upvotes: 0

Related Questions