Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Insert or update on duplicate key but not update all fields

I am trying to load data into a dimension table. It is straight forward enough, if the record does not exist, created it. If the record does exist update it. Setting "Action on data" to "Insert or update on duplicate key or unique index" in my tMysqlOutput step does basically what I am looking for. However, when updating, I do not want to update all fields. There are couple that I want to keep as the current value while updating all the other fields. It is not clear to me how I can set the action at the individual field level. Any help would be greatly appreciated.
Thanks,
Jason
Labels (2)
17 Replies
Anonymous
Not applicable
Author

P.S. Sorry, I'm new on inserting images here. Sorry again...
P.P.S. BTW, are there any guides how to insert those "beautiful" screenshots right in the messages? I can't manage to find any of these.
Anonymous
Not applicable
Author

Hi erop,
If you register and log in as a Community member, you'll get a Image upload box that allows to upload screen captures and images up to 200KB.
For registered users, I realized that the image upload feature is only available when clicking on "post reply" (not through the quick post").

Best regards
Sabrina
0683p000009MBw9.png
Anonymous
Not applicable
Author

Many thanks, Sabrina! I swear I'll never use "Quick post" option 0683p000009MACn.png
alevy
Specialist
Specialist

You've specified the update key as code_federal but you are not populating that field in the tMap!
Anonymous
Not applicable
Author

You've specified the update key as code_federal but you are not populating that field in the tMap!

Thank you, alevy, so much! As usual for me, the solution was so obvious and simple 0683p000009MACn.png
Anonymous
Not applicable
Author

No, tMysqlOutput_1_QUERY is never populated.

alevy, have you any ideas about approaches on debugging/logging resulting SQL query in tMysqlOutput component?
alevy
Specialist
Specialist

I've seen the question asked a few times on the forum but I don't think there's a way to do it in Talend since it uses prepared statements. You would have to look at the DB logs. Having said that, you can certainly at least see the data you're sending to tMysqlOutput with a tLogRow.
Anonymous
Not applicable
Author

Thank you, alevy!