How is the primary key determined ? Is it taken from the source ? Or is it auto-increment / a sequence ?
What is the target database technology ?
In the latter case, maybe you can stage your XML data, load your main table, and then load the child tables with a join between the stage and the main table.
This is an interesting case. Let us know what you find out or if you need more help
My primary key is auto-increment (serial) in Postresql.
As you see at the attached file, I tried to joind the tables (just for try) but it doesn't work.
I f you can explain more your idea ou you have an other efficient one.
OK, thanks for the details.
You really need to create a Stage. To create a Stage, drag and drop a database Schema on the mapping, and drop the XML elements on it.
Then, you wil be able to create Join between the Stage and the Main table.
So, your mapping will have :
- the XML as a source
- the Main table as a target (the serial field will be set by the rdbms)
- a Stage which contains XML data for the child tables and a functional key that will match records in the main table
- a Join between the Stage and the Main table, on the functional key (not the serial)
- map the data from the Stage to the child tables
I'm going to prepare an article on this case to illustrate.