<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to insert data from CSV file into Parent and Child tables with Child table having the Parent table id as foreign key? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-insert-data-from-CSV-file-into-Parent-and-Child-tables/m-p/2304299#M76088</link>
    <description>&lt;P&gt;Thanks Manohar for the prompt response.&lt;/P&gt;&lt;P&gt;However, it would be more understandable if you can provide with an example by creating a sample job. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gaurav.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Nov 2020 07:29:38 GMT</pubDate>
    <dc:creator>GRana1604394240</dc:creator>
    <dc:date>2020-11-04T07:29:38Z</dc:date>
    <item>
      <title>How to insert data from CSV file into Parent and Child tables with Child table having the Parent table id as foreign key?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-insert-data-from-CSV-file-into-Parent-and-Child-tables/m-p/2304297#M76086</link>
      <description>&lt;P&gt;I have a CSV file with some client data. The format is as below :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Client_Name;Time_Sheet_ID;Business_Unit;Location;Cost_Code;Worker_Name;Payroll_Number;Time_Sheet_Start_Date;Time_Sheet_End_Date;Time_Sheet_Submit_Date;Time_Sheet_Approved_Date;Rate_Code;Submitted_Units;Pay_rate;Bill_rate&lt;/P&gt;&lt;P&gt;XYZ;XYZTS00000123;XYZ Client;&amp;lt;xyz&amp;gt;;XYZNAME, ;XYZREF;31-08-2020;06-09-2020;08-09-2020;08-09-2020;XYZ/Hours;3.0;28.0;30.0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two tables :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Parent - It has following columns :&lt;/P&gt;&lt;P&gt;id - Primary Key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Client_Name &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Time_Sheet_ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Business_Unit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Location&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cost_Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Worker_Name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Payroll_Number&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Time_Sheet_Start_Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Time_Sheet_End_Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Time_Sheet_Submit_Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Time_Sheet_Approved_Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want all the columns till 'Time_Sheet_Approved_Date' in the CSV above to be mapped with Parent table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another table is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Child - It has following columns :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;id&lt;/P&gt;&lt;P&gt;parent_id - Parent's table id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rate_Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Submitted_Units&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pay_rate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bill_rate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The columns from '&lt;/P&gt;&lt;P&gt;Rate_Code&lt;/P&gt;' till '&lt;P&gt;Bill_rate&lt;/P&gt;' in the above CSV are mapped with this table.&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want a mapping such that the CSV data can be inserted into the Parent table and then to the Child table along with the appropriate Parent_id. &lt;/P&gt;&lt;P&gt;I tried with Last_Inserted_Id but it only works if the Child table doesn't have its own Auto Generated Id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I implement this use case in Talend? I am using version 7.2.1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:10:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-insert-data-from-CSV-file-into-Parent-and-Child-tables/m-p/2304297#M76086</guid>
      <dc:creator>GRana1604394240</dc:creator>
      <dc:date>2024-11-16T01:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert data from CSV file into Parent and Child tables with Child table having the Parent table id as foreign key?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-insert-data-from-CSV-file-into-Parent-and-Child-tables/m-p/2304298#M76087</link>
      <description>&lt;P&gt;@Gaurav Rana​&amp;nbsp;, you need to have two flows in a job.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) read a file and load to parent tables &lt;/P&gt;&lt;P&gt;2) you need to take on subjob ok from first flow and then do lookup with file and parent table to get child job.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as part of generation of primary key ,you need to use &lt;B&gt;Numeric&lt;/B&gt;.&lt;B&gt;sequence&lt;/B&gt;("Parameter name", start value, increment value)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Manohar&lt;/P&gt;</description>
      <pubDate>Tue, 03 Nov 2020 11:20:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-insert-data-from-CSV-file-into-Parent-and-Child-tables/m-p/2304298#M76087</guid>
      <dc:creator>manodwhb</dc:creator>
      <dc:date>2020-11-03T11:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert data from CSV file into Parent and Child tables with Child table having the Parent table id as foreign key?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-insert-data-from-CSV-file-into-Parent-and-Child-tables/m-p/2304299#M76088</link>
      <description>&lt;P&gt;Thanks Manohar for the prompt response.&lt;/P&gt;&lt;P&gt;However, it would be more understandable if you can provide with an example by creating a sample job. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gaurav.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 07:29:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-insert-data-from-CSV-file-into-Parent-and-Child-tables/m-p/2304299#M76088</guid>
      <dc:creator>GRana1604394240</dc:creator>
      <dc:date>2020-11-04T07:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert data from CSV file into Parent and Child tables with Child table having the Parent table id as foreign key?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-insert-data-from-CSV-file-into-Parent-and-Child-tables/m-p/2304300#M76089</link>
      <description>&lt;P&gt;Hi Manohar,&lt;/P&gt;&lt;P&gt;                   I need to insert the Parent's table Primary Key (Auto generated ID) into the Child table.&lt;/P&gt;&lt;P&gt;Is there a way to implement this such that a row is read from the source CSV file and an entry with the mapped columns is made in the Parent table.&lt;/P&gt;&lt;P&gt;Now, when the data is inserted in Parent table, we will have the Primary Key (Parent's table Id).&lt;/P&gt;&lt;P&gt;I now need to make an entry in the Child table with the remaining mapped columns of the same input row along with the Parent's table ID generated in the above step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, in your reply, the primary key that I need to use Numeric.sequence for is the Parent's table or Child's table ? And what significance does it have in this use case?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gaurav.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Nov 2020 07:35:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-insert-data-from-CSV-file-into-Parent-and-Child-tables/m-p/2304300#M76089</guid>
      <dc:creator>GRana1604394240</dc:creator>
      <dc:date>2020-11-04T07:35:58Z</dc:date>
    </item>
  </channel>
</rss>

