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

[resolved] Insert & Update with tMap?

Hi,
I am wondering how should I create the mappings & lookup if I want to insert data into the database if the primary key value doesn't exists and update the existing data in the database if any data is changed.
My input is data from MySQL database and Output is an Oracle database. I have a simple mapping such as:
tMySqlInput --> Main --> tMap --> Main --> tOracleOutput (with Action on Data = Insert)
Based on the above mapping, how can I create mappings & lookup if there is new data from MySQL, data will be inserted into Oracle and if there is a data changed from MySQL, an update should be executed in Oracle? Should I create a tOracleInput as a lookup?
Please any help is really appreciated!!
Thanks!
Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi Shong,
Thanks! It works great; however, can you please explain the difference between "insert or update" & "update or insert" items in action on data list? Is the difference on the sequence which action is triggered first?
Thanks again

View solution in original post

7 Replies
Anonymous
Not applicable
Author

Hello
how should I create the mappings & lookup if I want to insert data into the database if the primary key value doesn't exists and update the existing data in the database if any data is changed.

Only select 'insert or update' item on action on data list, check 'key' box of primary key column on schema of tOracleOutput, don't need do any lookup on tMap.
Best regards
shong
Anonymous
Not applicable
Author

Hi Shong,
Thanks! It works great; however, can you please explain the difference between "insert or update" & "update or insert" items in action on data list? Is the difference on the sequence which action is triggered first?
Thanks again
Anonymous
Not applicable
Author

Hello
Is the difference on the sequence which action is triggered first?

We can say that it get the same result between "insert or update" & "update or insert", the only difference is which action is triggered first as you said.
Best regards

shong
Anonymous
Not applicable
Author

If you expect more data to be inserted than data to be updated, use Insert or Update and viceversa.
Anonymous
Not applicable
Author

it doesn't work for me 0683p000009MPcz.png!!!!
Anonymous
Not applicable
Author

Hello
To imanouch87, please create a new topic and describe your problem.
Best regards
Shong
Anonymous
Not applicable
Author

Can u please provide any screen shots for this.....? which can help us too good.