Hi,
I'm trying to add only new rows and update rows that have changes instead of truncating data each time I load the data.
I managed to perform the task from Oracle to SQL using Lookup transformation but an error occurred from SQL to Oracle updating. Upon further research, it seems that Oracle have trouble performing row by row update using OLE DB Command. Thus, I followed a guide (http://www.techbrothersit.com/2014/04/ssis-how-to-create-use-temp-table-in.html) and stored the changed rows in a ##Temp OLE DB Destination table(SQL) and execute an SQL task after my data flow task to update it into Oracle. However, it seems that Oracle do not support JOINS like SQL.
I tried it with this statement from(http://dba.stackexchange.com/questions/3033/how-to-update-a-table-from-a-another-table) but there's still error in it. Please help me thanks :(
EMPSQL is my Oracle table and ##Temp is the temporary SQL staging table. Data that needs to be updated are EmployeeName, EmployeeAge, EmployeeEmail and EmployeeAddress.
MERGE INTO EMPSQLUSING
(
SELECT
EmployeeID,
EmployeeName,
EmployeeAge,
EmployeeEmail,
EmployeeAddress
FROM ##Temp
)SRC ON (SRC.EmployeeID = EMPSQL.EmployeeID)
WHEN MATCHED THEN UPDATE
SET
EMPSQL.EmployeeName = SRC.EmployeeName,
EMPSQL.EmployeeAge = SRC.EmployeeAge,
EMPSQL.EmployeeEmail = SRC.EmployeeEmail,
EMPSQL.EmployeeAddress = SRC.EmployeeAddress