• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Insert or Update in a eav model

#1 2008-10-29 09:59:05

mmary
Member
Company: sqli
Registered: 2008-08-27
Posts: 41

Insert or Update in a eav model

Hello everybody,

My job try to insert or update datas from an oracle export to a mysql
eav model.
http://img523.imageshack.us/img523/4987/jobimportfamillewm8.th.png
here's some example of datas stores in a eav model (attributes are links to another table which describe attributes datas)
http://img523.imageshack.us/img523/2386/jobimportfamilleattribuxm6.th.png
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:
http://img523.imageshack.us/img523/6646/jobimportfamilletmapgt0.th.png
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
best regards

Matthieu

PS: if you have others comments or better way about my job to design it
easily, I'll appreciate your help.

Offline

#2 2011-04-28 09:08:15

Hoang
Guest

Re: Insert or Update in a eav model

Hi,

Just wondering if anybody has a solution for the above problem?

Any hint/technique/approach would be much appreciated.

Many thanks,
Henry

#3 2011-04-28 15:30:16

JohnGarrettMartin
Member
Registered: 2009-01-07
Posts: 762

Re: Insert or Update in a eav model

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.

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Insert or Update in a eav model

Board footer

Powered by FluxBB