Oracle Connector Delete then Insert (write mode)

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
phanikumar
Participant
Posts: 60
Joined: Tue Sep 20, 2011 10:44 pm
Location: INDIA

Oracle Connector Delete then Insert (write mode)

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
phanikumar
Participant
Posts: 60
Joined: Tue Sep 20, 2011 10:44 pm
Location: INDIA

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply