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

action on date : Update or insert adds all the rows to mySQL table

When you use databases , probably you may want to insert new rows and update existing ones right?
Insert, insert/update, update/insert it doesn't matter, whenever I run the job it adds all the records again to the database.
How can i solve this issue?
MySQL table :  0683p000009MBeY.jpgTalend: insert/update  0683p000009MAx1.jpg
Talend : Advanced Settings 0683p000009MBed.jpgMySQL duplicated data :  0683p000009MBei.jpgBest Regards
Cihan
Labels (2)
3 Replies
Anonymous
Not applicable
Author

hi,
are you using auto-increment for the table's Id ?
regards
Anonymous
Not applicable
Author

YES at msSQL Is identiy > Yes , Identity increment > 1
Please help, I have 30 tables, Each day i am deleting every table's data manually and running the talend jobs again not to have duplicated data.
Regards
Cihan
Anonymous
Not applicable
Author

if you're using auto-increment, do not map that  key in Talend.
have a look at that post about that :
http://bekwam.blogspot.fr/2011/05/mapping-auto-increment-column-in-talend.html
But ... 0683p000009MA9p.png , if you haven't got a key, you cannot update data ... So do not use 'insert or update' option, but use 2 différents flows.
one for new data => insert option on table
one for update data => update option on table
it's a better way 'cause update or insert (& reverse) are full scan.
For that purpose, use a tmap with your data input, a lookup to retrieve all id already in your table (if it's a very huge table use option reload at each row with the globalmap trick in the xherre clause).
join input & lookup flow (inner join)
first output for update , second output for create (insert) using the tmap option 'catch lookup inner join reject' (that mean no id matche so it's a new row)
that's it
hope it help
regards
laurent