Page 1 of 1

Oracle Connector Delete then Insert (write mode)

Posted: Wed Feb 11, 2015 7:32 pm
by phanikumar
Hi,

I am trying to write into an Oracle table with writemode as 'deletethenInsert'

I am using user defined queries.

To my knowledge this should run the delete query first and then insert the query.

Looking at the logs it shows that it is performing delete and insert simultaneously.

Any idea on how to first completely run the Delete statement and then the Insert.

Regards
Kumar

Posted: Wed Feb 11, 2015 8:12 pm
by ray.wurlod
How do you know from the log that they are performed simultaneously? The log's time granularity may be too coarse to separate operations that occur consecutively.

Posted: Wed Feb 11, 2015 9:29 pm
by phanikumar
I misunderstood the concept of DelethenInsert:

It actually deletes the matched records and then inserts the new records.

I used the option beforeSQLstatement to actually delete the records in the table and then I selected the write mode as Insert to actually insert the records.

All good.

Regards
Kumar

Posted: Wed Feb 11, 2015 9:32 pm
by ray.wurlod
So you have deleted rows from the target table even though their keys were not in your source data?

In that case you could have specified "Truncate" as the table mode. That would probably be faster.