Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
We've noticed that when Qlik Replicate gets an update for a record on Snowflake it DELETES and then INSERTS the new record in the target table.
Is this expected behavior? Is there a way to get it to just run an UPDATE statement on the affected record?
We are running in USPERT mode for Apply Conflicts
Hello @zacker20 ,
You are correct — this is expected behavior. In UPSERT mode, Qlik Replicate parses an UPDATE operation as a pair of DELETE and INSERT operations.
Hope this helps.
John.
So if I turned off UPSERT mode, it would apply UPDATES normally?
Hi @zacker20 ,
Yes, exactly.
thanks,
John.
Thank you John, so turning off upsert mode - does that involve setting the Apply changes using SQL merge? Or changing Apply Conflicts to do what exactly?
Hello @zacker20 ,
There are two main apply strategies:
1. Qlik Replicate generates the apply SQL statements
Regular mode: Qlik Replicate generates standard INSERT, UPDATE & DELETE SQL statements, corresponding directly to the operations in the source database.
UPSERT mode: Similar to regular mode for INSERT and DELETE. However, source UPDATE operations are translated into a pair of operations: DELETE followed by INSERT.
2. Snowflake MERGE functionality
If “Apply changes using SQL MERGE” is enabled in the task settings, Qlik Replicate will not generate separate INSERT, UPDATE or DELETE statements. Instead, it will use Snowflake’s MERGE functionality, where a single MERGE statement handles all three types of source operations.
Note:
When “Apply changes using SQL MERGE” is enabled, the Apply Conflicts error-handling policy is automatically preset and cannot be modified. In addition, some related configuration options will not be available.
Regards,
John.
Again, thank you John. How do I make sure Qlik Replicate is in Regular mode?
Do I just make sure apply conflicts has:
No record found when applying DELETE: Ignore record
Duplicate key when applying INSERT: Log record to the exceptions table
No record found for applying an UPDATE: Log record to the exceptions table
Hello @zacker20 ,
You are right. And make sure the “Apply changes using SQL MERGE” is not used.
thanks,
John.