Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Insert CSV data into parent and child table

I have a CSV file containing users data that I want to insert into two tables in a MySQL database. The file format is as follows:

id  - first name - last name - age - other names          - locations

------------------------------------------------------------------------------------------------------

12 - john           - yol            - 12   - john, yul; john, yil - paris, france; london, uk

 

I want to insert into a table called users so the result would be:

id - external id - first name - last name - age

--------------------------------------------------------------

1 - 12               - john          - yol               - 12 

 

And another child table having the foreign key called user options:

id - user id - type - first name - last name - city        - country

-------------------------------------------------------------------------------------

1 - 12         - 1      - john         - yol             - null       - null

2 - 12         - 1      - john         - yul             - null       - null

3 - 12         - 1      - john         - yil              - null       - null

4 - 12         - 2      - null          - null             - paris    - france

5 - 12         - 2      - null         - null             - london - uk

 

So, each row should be inserted once in users table and then insert each of its options (first name/last name and other names which is type 1 or city/country which is type 2) split into users options table.

 

I am using Talend Data Integration Studio to create such a job.

I would appreciate a step-by-step solution as I am still a beginner. 

Thanks in advance.

Labels (4)
0 Replies