Reputation: 359
I need to load 2 database tables from a single csv file containing mixed data. I also want to maintain parent child relations using foreign key relation.
Below is example of input csv file,
<name>,<title>,<department>,<location>
John,Developer,IT, Florida
Mike,Designer,Sales,Nevada
Chris,Designer,Sales,Nevada
And below are 2 table structures. Employee table has dept_id as foreign key. Department table will have unique names(no repetitions). According to above sample csv, it should have 2 entries(IT, Sales).
DEPARTMENT
-------------
id
name
location
EMPLOYEE
---------
id
name
title
dept_id
I am a completely new to using Kettle and any pointers would be appreciated.
Upvotes: 3
Views: 2724
Reputation: 5164
This is very easy. Have you downloaded spoon and started it up yet (The editor for creating transformations)
As for the ID's you can allow the database to generate those as autonumber fields if you like - and do the lookup on whatever the unique requirement is.
I strongly reccomend downloading the tool and having a play - it's so easy once you start.
Upvotes: 1