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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Insert only if the row doesn't Exists

Hi,
How can I make it possible to Insert a row only if it doesn't Exists in the table?
I'm using "Update or Insert" on tMySQLOutput component. But that doesn't work for me!
Labels (2)
23 Replies
janhess
Creator II
Creator II

Well that obviously doesn't work as you're not finding duplicates.
When you output to your lookup table you will generate duplicates as it is keyed on an auto generated id so you will never get duplicate keys.
Anonymous
Not applicable
Author

my concern is not the duplicate keys, but the other attributes of the table. please check the screenshot of mySQL results, you will see there are duplication and I don't want them to be repeatedly inserted.
janhess
Creator II
Creator II

So make them key fields or check to see if the values exist before inserting the record.
Anonymous
Not applicable
Author

1. How can I make the key fields?
2. That's why I wrote the SQL Query with a lot of GlobalMap.Get variables to check if they exists.. but after that I don't know how to proceed?
please let me know on both of the solutions how to implement?