Hello
I have a process that runs daily that pulls down a csv file imports it and does some conversion and puts that converted data into a staging table.
I then want a plsql script I can automate along with the other process to insert or update the data from the Staging Table to the main table.
I will have several hundred thousand records per day and approximately 25% of them will be data that needs to be updated.
Example
Maintable Contains
COOPID,ACCOUNTID,DATETIME,VALUE
HSCE,300001,9/10/2017 5:00:00.0000000 AM,0.48
HSCE,300001,9/10/2017 6:00:00.0000000 AM,5
HSCE,300001,9/10/2017 7:00:00.0000000 AM,1
HSCE,300001,9/10/2017 8:00:00.0000000 AM,2.3
HSCE,300001,9/10/2017 9:00:00.0000000 AM,1.8
HSCE,300001,9/10/2017 10:00:00.0000000 AM,3
HSCE,300001,9/10/2017 11:00:00.0000000 AM,2.3
StagingTable Contains
COOPID,ACCOUNTID,DATETIME,VALUE
HSCE,300001,9/10/2017 5:00:00.0000000 AM,3.8
HSCE,300001,9/10/2017 6:00:00.0000000 AM,2.6
HSCE,300001,9/10/2017 7:00:00.0000000 AM,1.2
HSCE,300001,9/11/2017 8:00:00.0000000 AM,6.2
HSCE,300001,9/11/2017 9:00:00.0000000 AM,3.3
HSCE,300001,9/11/2017 10:00:00.0000000 AM,2.5
HSCE,300001,9/11/2017 11:00:00.0000000 AM,6.6
I want a script that will automatically put in the new 9/11 data into the MainTable and update the MainTable with the new values for 9/10 This is a small size example for 1 account but the file and table both contain lots of accounts for many years worth of data.
I looked at Merge and other postings however all seem to use Dual instead of looking at 2 tables.
Thanks for the help