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

How to check if a record Exists in DB

I have a folder of excel files
Talend package reads the folder and for each excel file in the folder it unpivots the content of the excel file and inserts in a MSSQL database.
Now the same row/record could exist in multiple files and thats why we keep getting duplicates in the database.
if someone could help me understand, if there is a way to check if the record exists in MSSQL DB, before inserting then i can skip duplicates and just get unique records. Please see the attached screenshot.
Thanks
Labels (2)
12 Replies
Anonymous
Not applicable
Author

Can someone from the expert talend team point me in right direction please. I would highly appreciate it.
Anonymous
Not applicable
Author

Can you add a unique key to your database table? If you then set the MSSQL component to be "Insert if not exist", this would stop duplicates being inserted.
Anonymous
Not applicable
Author

Thank You. Very Helpful. What should i do if i want to update the existing record instead of skipping it? Is there an option in the tMSSQL component for this as well?
Anonymous
Not applicable
Author

OK - set the action on data to be "Update or insert". This updates existing entries or create it if non existing.
_AnonymousUser
Specialist III
Specialist III

OK - set the action on data to be "Update or insert". This updates existing entries or create it if non existing.

Hi,
For the Update or insert otpion in mysql output it requires a primary key. So how to get the primary keys from db and assign it to the rows in excel sheet. Kindly help.

Thanks,
Senthil
Anonymous
Not applicable
Author

Hi Senthil,
I have replied your related forum https://community.talend.com/t5/Design-and-Development/how-to-fetch-primary-keys-from-db-and-set-it-..., feel free post your issue on forum.
Best regards
Sabrina
Anonymous
Not applicable
Author

hi

"insert if not exist" option is not available in tverticaoutput component(TOS) how to achieve this case in vertica database.
Anonymous
Not applicable
Author

Hi,
So far, there is no "insert if not exist" option in tverticaoutput.
As alternative, you can set any primary key you wanted in schema setting by manual(checkout the "Key" option) .
and take the "Update or insert" data action in tverticaoutput.
Best regards
Sabrina
_AnonymousUser
Specialist III
Specialist III

Hi,
I want to convert excel sheet to mysql table.MySQl table has id which is auto increment.
I have list of user in excel sheet which might contain duplicate.I have Insert ignore option which give me correct record but when add new record in existing excel file . auto increment value is almost double. for example 
I have list of user 20 distinct values first time in excel file but i have added one more and try to run same excel file . the auto increment value for new record will be 41 but i want 21. is it posible?
please let me know..its very urgent.
Thank you in advance.