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: 
_AnonymousUser
Specialist III
Specialist III

Compare CSV file versus DB Records

Hi there,
New Talend user here. First day of using Talend Integration Suite 4.1.1. I am trying to compare and validate a CSV file versus records in MSSQL DB Table. Do you have any idea how to do this in a nice way? Or i would very much appreciate if you can provide me sample screenshot on the components involve.
Best Regards,
Andres
Labels (2)
7 Replies
Anonymous
Not applicable

Hi,
You can use the components tFileInputDelimited for the csv file and tMSSqlInput for the DB table and then use tMap. Make sure to inner join the map and map all fields that you want to compare.
Then create 2 output components. The first output could contain the matched records and the second output could contain the non-matched records. You can catch these non-matched records with the "catch inner join rejects" option in the output.
Good luck
_AnonymousUser
Specialist III
Specialist III
Author

Good Job! many thanks
_AnonymousUser
Specialist III
Specialist III
Author

Thanks. I was able to do this.
My next problem is, If there is no data in that Table I want this CSV file to populate that table.
how to do this using this scenario:
CSV(tFileInputDelimited) ----> tMAP <---- Table (tMSSLQInlput)
Anonymous
Not applicable

Hi,
As saukema said, create a new ouput which will catch the reject. Put your csv as a source and your table as a lookup.
_AnonymousUser
Specialist III
Specialist III
Author

I already did that. This solution only compares. It does not insert to DB.
see here:
CSV(tFileInputDelimited) ----> tMAP <---- Table (tMSSLQInlput)
| |
| |
tFileOutputDelimited1 tFileOutputDelimited2
wit this scenario, how can i insert the result to TABLE.
Anonymous
Not applicable

Link your output reject to a tMSSQLOutput.
_AnonymousUser
Specialist III
Specialist III
Author

Thanks. it is now working.