Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlik Community,
I'm working on a Qlik Replicate task where the source is DB2 LUW and the target is Amazon Redshift, using Full Load + CDC.
I want to implement soft delete logic — so that when a row is deleted in DB2, it is not removed from Redshift, but instead updated with a "soft delete flag".
| id | name | phone |
|---|---|---|
| 1 | abc | 23456789 |
| 2 | dce | 1234567890 |
| 3 | efd | 1234567890 |
Row with id = 3 is deleted.
| id | name | phone | is_deleted | deleted_at |
|---|---|---|---|---|
| 1 | abc | 23456789 | false | NULL |
| 2 | dce | 1234567890 | false | NULL |
| 3 | efd | 1234567890 | true | 2025-06-25 15:00:00 |
Full Load: Drop and Create Table
CDC:
Any tips, validation, or best practices would be much appreciated.
Thanks in advance!
Hello @Bishnu123 ,
Function operation_indicator can be used to support soft-delete.
When the operation_indicator function is invoked on its own or as part of an expression, records deleted from the source table will not be deleted from the corresponding target table. Instead, the corresponding target record will be flagged (with a user-provided value) to indicate that it was deleted from the source. For example if I add a new column "soft_delete" and its expression is like:
operation_indicator('DELETE', 'UPDATE', 'INSERT')
if the record is deleted from source side, the flag "soft_delete" column's value is "DELETE".
Hope this helps.
John.
Hello @Bishnu123 ,
Function operation_indicator can be used to support soft-delete.
When the operation_indicator function is invoked on its own or as part of an expression, records deleted from the source table will not be deleted from the corresponding target table. Instead, the corresponding target record will be flagged (with a user-provided value) to indicate that it was deleted from the source. For example if I add a new column "soft_delete" and its expression is like:
operation_indicator('DELETE', 'UPDATE', 'INSERT')
if the record is deleted from source side, the flag "soft_delete" column's value is "DELETE".
Hope this helps.
John.