Nurul
Nurul

Reputation: 29

Talend insert or update data into table

How can I update and insert data into output table?

I've had success in inserting data but failed to update the data. The situation is like this: If ic_num from TableA exists in TableB -> then update the data else -> insert new data

I've already used tMap and select action insert or update but the output only inserts all the data.

enter image description here

enter image description here

I do try to make the design like this but I don't know where to set the condition for it. The condition is to check if ic_no already exists or not.

enter image description here

Upvotes: 1

Views: 3486

Answers (1)

RP-
RP-

Reputation: 5837

Your ic_num is not part of your key in your tMySQLOutput's schema, either you need to make it as part of the primary key or unique key. You could do that in by clicking on the horizontal ellipse next to "Edit Schema".

You even can look at the code it generated by going to "Code" editor which is located at the bottom of the main window.

Upvotes: 1

Related Questions