In this example we will run an extraction to merge data, i.e. insert a new data row or update an existing one.
It is important that the destination table has the right index to execute the merge statement.
In this example, we will use the data extracted in the section “Inserting Data”.

Let´s make some changes to the extracted data. We will update the field name2 with the value ‘Hamburg’.

RS-Merge-After-Update

Now let´s change the Extraction Specific Settings and set

  • Preparation to Prepare Merge,
  • Row Processing to Fill merge staging table
  • Finalization to Finalize Merge

XU_redshift_merge

The merge statement inserts new rows and updates existing ones.

The SQL statement contains the fields, that will be updated.
The SQL statement can be modified, e.g. if you would not like to update all fields.
Fields that are not contained in the merge statement will not be modified.

In this example the field name2 will be updated with the value from the SAP system.

RS-Merge-Result