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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to ignore 'duplicate key' errors

Hello all,
I'm sorry to bother you with stupid question, but I'm new to TOS and I'm not able to find anything similar in both UG and this forum.
I want to pump data from a MySQL schema to an other MySQL schema, ignoring duplicate key errors on destination table.
I gave a try to all available 'Action on data' on tMysqlOutput, but nothing seems to fit (I don't really want to update existing data).
Any suggestion would be very appreciated.
Thanks and regards,
Massimo
Labels (2)
6 Replies
Anonymous
Not applicable
Author

Either fetch unique values from the database or use the tUniqueRow component for moving unique rows to the target table.
Thanks and Regards,
Pravu Mishra.
Anonymous
Not applicable
Author

Try the action "insert if not exist".
Anonymous
Not applicable
Author

Hi nkxxDV,
unfortunately the only 'Action on data' I get in Component panel of tMysqlOutput are:
- insert
- update
- insert or update
- update or insert
- delete
- replace
- insert or update on duplicate key or unique index
I run TOS 3.1.3 build r26090.
Regards,
Massimo
Anonymous
Not applicable
Author

Ok, indeed it only exists for tMSSqlOutput.
Then I suggest you to fetch all the primary keys from your destination table and use it as a lookup for your main flow. You will do the join on the primary key and only output rejected rows.
Anonymous
Not applicable
Author

It seems to be working.
Thanks,
Massimo
Anonymous
Not applicable
Author

What about choosing insert or update on duplicate key or unique index AND Advanced Settings > Use Field Options and selecting the primary key column(s) as Updateable

edit: ETL seemed to work even without any updateable columns but this is invalid syntax and it would sometimes (?) recognise it or will hang so you are better to update the primary key (i.e. change nothing)