Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm fairly new to Talend and I've spent quite a bit of time trying to figure this out this past week and have come across some posts that have gotten me up to this point, and any help would be appreciated. I'm trying migrate some data from a legacy DB to a new system, whose schema containing parent/child relationships is mapped out differently. In the legacy database, I have an child entity (TaPieceJointe) containing document attachments which hold the foreign key to its parent (PceIns). In the target database, this relationship is held in a separate table (modules_relation):
OLD DB Maps TO ==> NEW DB
TaPieceJointe PceCod docs.count
TaPieceJointe PceIns
TaPieceJointe PceNature
TaPieceJointe PcePME
TaPieceJointe PceName docs.title
TaPieceJointe PcePath docs.original_file_name
docs.file_type
docs.file
modules_relation.module_from
modules_relation.id_from (FK to equipment table which I used as lookup in tmap1)
modules_relation.module_to
modules_relation.id_to (FK to docs.count)
Between the posts I've come across, they've suggested using tMysqlLastInsertId, tHashOutput and tHashInput. So essentially what I've done is to:
-insert into the first target table "docs"
-then try to get the auto-increment key value from "docs" by using tMysqlLastInsertId in order to insert into modules-relation in the target DB, which holds the parent/child relationship between the entities "doc" and "equipment" (entity equivalant to foreign key PceIns).
I've tried to follow as best as possible on how to achieve this, but alas I've come across this latest obstacle where tHashInput is not initialized.
tFileInputDelimited(1)-->tHashOutput
|
|
|on Subjob OK
|
| tHashInput
| |
tFileInputDelimited(2)-->tMap-->tLogRow