Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to insert excel file to mysql db with condition if column at table doesn't contains excel filename then can be inserted else can not be inserted?
Hi,
If my understanding about your query is correct, you want to load the data from excel to DB if the data is not present in DB based on some key column evaluation. You can select "Action on Data" as "Insert or Update" and in the schema, mark the column you want to use as the condition as Key column.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Hi,
If my understanding about your query is correct, you want to load the data from excel to DB if the data is not present in DB based on some key column evaluation. You can select "Action on Data" as "Insert or Update" and in the schema, mark the column you want to use as the condition as Key column.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Hi @nthampi,
thanks for answering my question. Your suggestion is work, you can see picture of my job below :
in my job above, i successfully create job iterating insert filename from each excel file to table. If table contain excel filename then error message will show up like at picture below :
So, my next task is I want to insert all datas/rows from excel file to another table when first table before doesn't contain excel filename.
Can you help me how to design it?
Hi,
The easiest way is to do is an inner join lookup between target table and input flow.
In the tMap, you can select inner join reject condition in output flow to gather all the records which do not have a file name present. This flow can be sent further to load to any other table.
Since the original query for the post has been answered, I would request you to close this post and create a new one for any further queries. This will help to keep the focus of the query in the thread.
I would also appreciate if you could spare a second to mark the topic as resolved and kudos will be a bonus. Its the only way of appreciating the authors for their Talend community work 🙂
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂