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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

insert data to table with condition

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?

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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.

0683p000009M66I.png

 

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 🙂

View solution in original post

4 Replies
Anonymous
Not applicable
Author

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.

0683p000009M66I.png

 

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 🙂

Anonymous
Not applicable
Author

Hi @nthampi,

 

thanks for answering my question. Your suggestion is work, you can see picture of my job below :0683p000009M66S.png

 

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 :

 

0683p000009M66X.png

 

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?

Anonymous
Not applicable
Author

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 🙂

Anonymous
Not applicable
Author

Ok, I'll try it. Thanks for your help. I'll create a new one for my next task.