Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem in Insert or Update in DB adapter

905784Jul 5 2012 — edited Jul 5 2012
Hi All,

I wanted to insert or update the records into multiple tables in single instance.

Problem is there is a primary key across all 3 tables but that will generate in auto sequence for every new insertion of records. (say, 1,2,3,4, for every new insertion).

There is one more field common across all the 3 tables but that is not a primary key which actually has the unique records everytime, I should use this field in order to avoid duplication.

When I used Insert or Update(merge operation), then it is validating with primary key which is autogenerating in this case.

Hence, I decided to go with Pure SQL but could not find right example to do that.

I got this query

if table t has a row exists that has key X:
update t set mystuff... where mykey=X
else
insert into t mystuff...

But how it should be converted to real case.

Please can anyone suggest how to perform this.

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 2 2012
Added on Jul 5 2012
2 comments
385 views