on 2022 Jan 25 3:15 PM
Hello experts,
currently we are trying to insert data into a table via DWC data flow. Now we want to prevent that the data flow creates duplicate entries in the target table. Problem is that the field we have to check is NOT a primary key.
EDIT: The primary key UUID is also used saved on other tables ad referenced via association.
The db table itself has a UUID as primary key and a second data field "example" for a string 100. We need to check if there is already a entry in the table (e.g. "Foobar" in data field "example").
Which approach would you recommend inside the data flow?
BR,
Christian
Hello Sven,
thank you for your answer. I forgot to mention that the primary key UUID is also saved on other tables and connected via association. If we delete the original entry we also have to update the associated entries. If possible we would rather avoid doing this.
Thanks in advance,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sven,
maybe i can show you the (simplyfied) scenario:
We need to add additional data to the table "Test1". Before that we need to check if there is already an existing entry for "Example" (e.g. "TestExampleEntry"). We can´t delete the entry from "Test1" because the primary key "UUID" is used at the table "Test2".
The solution with the left join did come to our mind, but we unsure if that´s the best practice.
Thank you!
Hello Christian,
you could use the delete mode in the data flow:
1. First you would delete all the records in the target that come from the source with the same field value in this one field.
2. After that you would upsert the new records in the target.
Does that work for you?
Kind regards
Sven
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.