cancel
Showing results for 
Search instead for 
Did you mean: 

BODS: How to update some columns only in table

0 Kudos
3,883

Scenario:
Assume that I have target_table with column c1, c2, c3, c4, and c5. And i also have source_table with column c1, c2, c3, c4, and c5 as well.

Assume that column c1 is primary key in both tables.

Requirement:

1) If row in source_table is NOT exists in target_table, then insert that row into target_table.

2) If row in source table is exists in target_table (in case both tables contains a rows with same c1 column value), then update column c2 ONLY in target_table, and DON'T update column c3, c4 and c5 in target_table.

How can it be done in BODS?

View Entire Topic
former_member187605
Active Contributor
0 Kudos

For distinguishing between inserts and updates, you use a Table_Comparison transform, right?

There are several ways to implement your requirement. As an easy solution, insert a Map_Operation transform in the data flow between the Table_Comparison and the target table. Don't modify any Row Types. Just add an Update mapping for every column you don't want to see modified, using the before_image function:

0 Kudos

Hey...Your solution is working.

i have also posted illustration into below Q & A.

https://answers.sap.com/questions/663819/use-of-compare-columns-in-table-comparison.html?childToView...