You are not logged in.
My job try to insert or update datas from an oracle export to a mysql
here's some example of datas stores in a eav model (attributes are links to another table which describe attributes datas)
Existance is match against some attributes in the model, not on primary
keys which are not know in oracle export.
For the moment, I map my model in this way:
Which is the better way to check if record already exists?
I was thinking in this way: make a MysqlInput which make me an export of
all datas and check in map if there is a record with all attributes used
for keys: this method should give me records with primary key and
records without and so switch between insert or update.
it's seems that tMap allow me with unique match and inner join like in
this topic http://www.talendforge.org/forum/viewtopic.php?id=3739 so I
can check key exists. But when I insert, I need the key inserted.
tMysqlLastInsertId should be fine, but is there an easy way to add
tMysqlLastInsertId in a tMap or did I need to:
- insert or update first in the entity table
- fetch insert row or entity_id found and add attributes in a second way.
hope you can help me
PS: if you have others comments or better way about my job to design it
easily, I'll appreciate your help.
Just wondering if anybody has a solution for the above problem?
Any hint/technique/approach would be much appreciated.
in the advanced setting sub-tab of your DBoutput components there is a checkbox "show field options"
When you check this, you can chose what columns will be used to issue updates and which fields will be updated. If you set the "action on data" to Insert or Update Talend will generate a COUNT query and then issue an update or insert using the columns you define.