One Star

How to import data from excel to two (or multiple ) Mysql tables?

Hi all! The First, I'm sorry because I'm not good English Smiley Very Happy.
I need load data from excel file(itHelp.xlsx) to two Mysql tables (finishedtime and itHelpContent) by tMap.
But finishedtime table and itHelpContent table have a relationship 1-n (Primary key of finishedtime table is Foreign key of itHelpContent table ).
I have two problems need help.
1. I want When load a record from excel to finishedtime table : if record is new --> insert, if not --> skip . How to do it ?
2. When load a new record to finishedtime table, it'll have a FinishedTimeID ( auto increment). How to insert this FinishedTimeID to itHelpContent table (Foreign Key) ?
Thanks every body so much ! Smiley Happy
image : http://i277.photobucket.com/albums/kk42/linh_060/tMap.png
Sorry, i can't upload image Smiley Sad
2 REPLIES
Moderator

Re: How to import data from excel to two (or multiple ) Mysql tables?

Hi, linh_060
For your first issue, in the component -tMysqloutput, there is a option named "Action on table". Choose the item"Drop table if exists and create" see pic.
And for your second issue, we just take into research and give your response sooner.
Best Regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: How to import data from excel to two (or multiple ) Mysql tables?

Hi, linh_060
For your first issue, in the component -tMysqloutput, there is a option named "Action on table". Choose the item"Drop table if exists and create" see pic.
And for your second issue, we just take into research and give your response sooner.
Best Regards
Sabrina

Hi,Thank Sabrina !
Issue 1: I done as You guide me.
But it is not true Smiley Sad.
If I choose the item "Drop table if exists and create", not only Records are not inserted to finishedtime table but also the auto increment property of FinishedTimeID(primary key) is deleted.