Search This Blog

Friday, September 29, 2017

Import and Merge XLS/CSV data into Maximo Database on Oracle

If you want to update values of certain fields inside database, one option is to make individual update statements in xl formulas as explained in another post and another option if you have huge datasets is to use MERGE commands from Oracle.


Steps:

Create a temporary table in database which will hold our data from CSV/XL

In Oracle SQL developer, click on Table and click data tab-- click action and import.

Navigate to xls/csv make sure column names match and first header has column names.

Import and accept defaults.


Now you have the database with your xl/csv data in table.
Now we will merge it with our actual table.

with below statement.



MERGE into prodtable t using ( select * from temptable) s on (t.location=s.location) 
when matched then
UPDATE SET t.fieldtoupdate = s.fieldtoupdate;


Your user should have insert update create rights on the schema where you are trying to do merge the data.

Keep Reading ! 


No comments:

Post a Comment