<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Handling primary key changes with DELETE + INSERT in Qlik Replicate</title>
    <link>https://community.qlik.com/t5/Qlik-Replicate/Handling-primary-key-changes-with-DELETE-INSERT/m-p/2555518#M16657</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I’ve configured a replication task that reads from a Log Stream and replicates data to a Snowflake target with &lt;STRONG&gt;Apply Changes Processing&lt;/STRONG&gt; enabled, meaning that changes are applied directly to the target tables in Snowflake. The source of the Log Stream is an Oracle database.&lt;/P&gt;&lt;P&gt;Moreover, I’ve implemented a &lt;STRONG&gt;soft-delete logic&lt;/STRONG&gt; in this task by adding a technical field defined as follows:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CASE ifnull(operation_indicator('DELETE','UPDATE','INSERT'),'null')

WHEN 'null' THEN 'INSERT'

ELSE operation_indicator('DELETE','UPDATE','INSERT') END&lt;/LI-CODE&gt;&lt;P&gt;This is the soft-delete implementation described here: &lt;A href="https://community.qlik.com/t5/Qlik-Replicate/Operation-Indicator-as-New-column/td-p/2061166" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Replicate/Operation-Indicator-as-New-column/td-p/2061166&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Occasionally, operations are performed on the source that &lt;STRONG&gt;modify &lt;/STRONG&gt;&lt;STRONG&gt;primary key fields&lt;/STRONG&gt;. This is not a problem for Qlik Replicate, which correctly updates the corresponding record in the target table. However, this change is processed as an &lt;STRONG&gt;UPDATE&lt;/STRONG&gt;. This can be a problem for consumers of the target table. If they read the table using an incremental approach, they have no indication that the record with the previous primary key has been modified or no longer exists. Therefore, if a downstream table is updated incrementally using a &lt;STRONG&gt;MERGE&lt;/STRONG&gt;, this change will not be captured correctly.&lt;/P&gt;&lt;P&gt;I tried to investigate if it’s possible to transform the &lt;STRONG&gt;UPDATE&lt;/STRONG&gt; into a &lt;STRONG&gt;DELETE&lt;/STRONG&gt; of the record with the previous key, followed by an &lt;STRONG&gt;INSERT&lt;/STRONG&gt; of the record with the new key. I found that this is possible for Change Tables populated using &lt;STRONG&gt;Store Changes Processing&lt;/STRONG&gt;: “DELETE and INSERT when updating a primary key column: For tasks configured with streaming target endpoints (for example, Kafka), the DELETE+INSERT statements will be executed on the actual target. For all other target endpoints, they will be executed in the associated Change Tables. This option requires full supplemental logging to be turned on in the source database” (&lt;A href="https://help.qlik.com/en-US/replicate/May2026/Content/Global_Common/Content/SharedEMReplicate/Customize%20Tasks/tasks_applychangtunestab.htm#ar_tasks_custom_1624443382_1694425" target="_blank"&gt;https://help.qlik.com/en-US/replicate/May2026/Content/Global_Common/Content/SharedEMReplicate/Customize%20Tasks/tasks_applychangtunestab.htm#ar_tasks_custom_1624443382_1694425&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;However, I need to apply this logic directly to the target tables, rather than to Change Tables, using the soft-delete approach. This would allow consumers of the target table to identify that the record with the previous primary key no longer exists, even if they read the table incrementally (for example, by reading only the changes from the last day).&lt;/P&gt;&lt;P&gt;Is there a way to &lt;STRONG&gt;transform a primary key UPDATE into a DELETE + INSERT for regular target tables&lt;/STRONG&gt; (not Change Tables)? &lt;SPAN&gt;I&lt;/SPAN&gt;s there a way to achieve the same result using the soft-delete logic described above?&lt;/P&gt;&lt;P&gt;Thank you in advance for your support.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
    <pubDate>Mon, 31 Aug 2026 12:00:39 GMT</pubDate>
    <dc:creator>raffaelec</dc:creator>
    <dc:date>2026-08-31T12:00:39Z</dc:date>
    <item>
      <title>Handling primary key changes with DELETE + INSERT</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Handling-primary-key-changes-with-DELETE-INSERT/m-p/2555518#M16657</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I’ve configured a replication task that reads from a Log Stream and replicates data to a Snowflake target with &lt;STRONG&gt;Apply Changes Processing&lt;/STRONG&gt; enabled, meaning that changes are applied directly to the target tables in Snowflake. The source of the Log Stream is an Oracle database.&lt;/P&gt;&lt;P&gt;Moreover, I’ve implemented a &lt;STRONG&gt;soft-delete logic&lt;/STRONG&gt; in this task by adding a technical field defined as follows:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CASE ifnull(operation_indicator('DELETE','UPDATE','INSERT'),'null')

WHEN 'null' THEN 'INSERT'

ELSE operation_indicator('DELETE','UPDATE','INSERT') END&lt;/LI-CODE&gt;&lt;P&gt;This is the soft-delete implementation described here: &lt;A href="https://community.qlik.com/t5/Qlik-Replicate/Operation-Indicator-as-New-column/td-p/2061166" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Replicate/Operation-Indicator-as-New-column/td-p/2061166&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Occasionally, operations are performed on the source that &lt;STRONG&gt;modify &lt;/STRONG&gt;&lt;STRONG&gt;primary key fields&lt;/STRONG&gt;. This is not a problem for Qlik Replicate, which correctly updates the corresponding record in the target table. However, this change is processed as an &lt;STRONG&gt;UPDATE&lt;/STRONG&gt;. This can be a problem for consumers of the target table. If they read the table using an incremental approach, they have no indication that the record with the previous primary key has been modified or no longer exists. Therefore, if a downstream table is updated incrementally using a &lt;STRONG&gt;MERGE&lt;/STRONG&gt;, this change will not be captured correctly.&lt;/P&gt;&lt;P&gt;I tried to investigate if it’s possible to transform the &lt;STRONG&gt;UPDATE&lt;/STRONG&gt; into a &lt;STRONG&gt;DELETE&lt;/STRONG&gt; of the record with the previous key, followed by an &lt;STRONG&gt;INSERT&lt;/STRONG&gt; of the record with the new key. I found that this is possible for Change Tables populated using &lt;STRONG&gt;Store Changes Processing&lt;/STRONG&gt;: “DELETE and INSERT when updating a primary key column: For tasks configured with streaming target endpoints (for example, Kafka), the DELETE+INSERT statements will be executed on the actual target. For all other target endpoints, they will be executed in the associated Change Tables. This option requires full supplemental logging to be turned on in the source database” (&lt;A href="https://help.qlik.com/en-US/replicate/May2026/Content/Global_Common/Content/SharedEMReplicate/Customize%20Tasks/tasks_applychangtunestab.htm#ar_tasks_custom_1624443382_1694425" target="_blank"&gt;https://help.qlik.com/en-US/replicate/May2026/Content/Global_Common/Content/SharedEMReplicate/Customize%20Tasks/tasks_applychangtunestab.htm#ar_tasks_custom_1624443382_1694425&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;However, I need to apply this logic directly to the target tables, rather than to Change Tables, using the soft-delete approach. This would allow consumers of the target table to identify that the record with the previous primary key no longer exists, even if they read the table incrementally (for example, by reading only the changes from the last day).&lt;/P&gt;&lt;P&gt;Is there a way to &lt;STRONG&gt;transform a primary key UPDATE into a DELETE + INSERT for regular target tables&lt;/STRONG&gt; (not Change Tables)? &lt;SPAN&gt;I&lt;/SPAN&gt;s there a way to achieve the same result using the soft-delete logic described above?&lt;/P&gt;&lt;P&gt;Thank you in advance for your support.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2026 12:00:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Handling-primary-key-changes-with-DELETE-INSERT/m-p/2555518#M16657</guid>
      <dc:creator>raffaelec</dc:creator>
      <dc:date>2026-08-31T12:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: Handling primary key changes with DELETE + INSERT</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Handling-primary-key-changes-with-DELETE-INSERT/m-p/2555523#M16659</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;No. Qlik Replicate cannot transform a primary-key UPDATE into a DELETE + INSERT directly on regular target tables when using Apply Changes Processing.&lt;/P&gt;&lt;P&gt;But you can try below&amp;nbsp;&lt;/P&gt;&lt;P&gt;use Store Changes Processing/Change Tables if downstream consumers require explicit DELETE + INSERT events, or implement the PK-change handling downstream in Snowflake using the appropriate change metadata.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2026 13:31:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Handling-primary-key-changes-with-DELETE-INSERT/m-p/2555523#M16659</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2026-08-31T13:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Handling primary key changes with DELETE + INSERT</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Handling-primary-key-changes-with-DELETE-INSERT/m-p/2555802#M16669</link>
      <description>&lt;P&gt;Not knowing a lot about working with snowflake; but could you replicate to a "landing" table and then write triggers off the landing table to handle the DELETE + INSERT into your main table?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2026 22:30:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Handling-primary-key-changes-with-DELETE-INSERT/m-p/2555802#M16669</guid>
      <dc:creator>Jon_Donker</dc:creator>
      <dc:date>2026-09-03T22:30:34Z</dc:date>
    </item>
  </channel>
</rss>

