One way of doing this is to:
Start by creating a table in Oracle where you can insert the excel data into the database. You can use something like this:
CREATE TABLE excel_dump AS SELECT * FROM Persons WHERE 1 = 0;
Then in excel you can create a column to hold an insert statement - so if column A
holds Person_ID
values and column B
holds name values then, for the first row, you can use:
="INSERT INTO excel_dump (Person_ID, name) VALUES ( "&A1&", '"&SUBSTITUTE(B1,"'", "''") &"' );"
Add more columns as appropriate (numeric fields can be concatenated without any issues, as per the A1
cell, but text fields should be wrapped in SUBSTITUTE( ?, "'", "''" )
so that any single quotes in the data are escaped, as per the B1
cell). Then copy that for each row.
Copy and paste the insert statements generated from those rows into your favourite oracle client (SQL Developer / SQL*Plus / Toad etc) to populate the excel_dump
table.
Then you can do whatever investigations you want comparing the two tables. So if you want to see the rows from the excel spreadsheet which do not match the rows in the Persons
table then you can do something like:
SELECT Person_ID, Name FROM excel_dump
MINUS
SELECT Person_ID, Name FROM Persons;
Or some more complex analysis as you find appropriate.
Alternately
If you are using SQL Developer, then it has an option to import data from an Excel spreadsheet.