<?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 import information from multiple tables to output into a single table in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/import-information-from-multiple-tables-to-output-into-a-single/m-p/2247854#M32902</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a job where I am pulling through the information for multiple instances of a single table through an iterative MySQL tDBInput, this is then being output into a single output table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The challenge I am facing is that sometimes the tables from the different instances can have differing schema. For example Table A from instance 1 may have 15 columns, whereas Table A from instance 2 may have 16 columns (15 matching and one extra), whereas Table&amp;nbsp;A from instance 3 may have 17 columns (15 matching,&amp;nbsp;two extra).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to set up the schema on the input whereby it will bring through the&amp;nbsp;metadata for all possible&amp;nbsp;columns across every instance (in the above example, 17), and then when we are bringing through the data for each instance, if the data does not exist to make it = null? So then what we have in the final output is (for the above) 17 columns, which are filled in completely for instance 3, 16 filled in (1 null) for instance 2, and 15 filled in (2 null) for instance 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have been able to do this when the schema matches and have this output into a single table, with each new instance appended beneath, I am only&amp;nbsp;having difficulty with it when the schema changes.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for your help.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Oct 2018 10:33:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-10-08T10:33:02Z</dc:date>
    <item>
      <title>import information from multiple tables to output into a single table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/import-information-from-multiple-tables-to-output-into-a-single/m-p/2247854#M32902</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a job where I am pulling through the information for multiple instances of a single table through an iterative MySQL tDBInput, this is then being output into a single output table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The challenge I am facing is that sometimes the tables from the different instances can have differing schema. For example Table A from instance 1 may have 15 columns, whereas Table A from instance 2 may have 16 columns (15 matching and one extra), whereas Table&amp;nbsp;A from instance 3 may have 17 columns (15 matching,&amp;nbsp;two extra).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to set up the schema on the input whereby it will bring through the&amp;nbsp;metadata for all possible&amp;nbsp;columns across every instance (in the above example, 17), and then when we are bringing through the data for each instance, if the data does not exist to make it = null? So then what we have in the final output is (for the above) 17 columns, which are filled in completely for instance 3, 16 filled in (1 null) for instance 2, and 15 filled in (2 null) for instance 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have been able to do this when the schema matches and have this output into a single table, with each new instance appended beneath, I am only&amp;nbsp;having difficulty with it when the schema changes.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 10:33:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/import-information-from-multiple-tables-to-output-into-a-single/m-p/2247854#M32902</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-08T10:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: import information from multiple tables to output into a single table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/import-information-from-multiple-tables-to-output-into-a-single/m-p/2247855#M32903</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; You will not be able to change the schema dynamically for each instance during tDBInput call. But you can do another work around. Why don't you select the schema with maximum number of columns as the output schema for all different tables?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Since you are using SQLs, you can use null values for the instances where column is not present. Once the data set is in unified format, you can use a tUnite component to merge the data and process it further.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Plan B is slightly circuitous where you need to store the table and column metadata information in a different tables. When you are reading the data from source table, merge all the columns with a separator symbol (like semicolon) and pass the data as single string value. Then, based on the metadata value specified in your reference table, you can slice the input string and append null values. Once this slicing and appending operation is complete, you can reform the data into new unified format and pass them further. This method require less amount of coding when more versions are coming but initial coding effort will be more.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Nikhil Thampi&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 11:11:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/import-information-from-multiple-tables-to-output-into-a-single/m-p/2247855#M32903</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-08T11:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: import information from multiple tables to output into a single table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/import-information-from-multiple-tables-to-output-into-a-single/m-p/2247856#M32904</link>
      <description>&lt;P&gt;Hi Nikhul,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the reply:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So to confirm for plan A&amp;nbsp;-are you suggesting to have multiple inputs, create the shell columns for where those columns do not exist through the MySQL query and then use a tUnite to unite all of this information before outputting into an output table? If so, I think this might be a little more difficult as I can have many instances, where more are being added over time, and this will be on multiple different tables as well so could take quite some time across every table required.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;As for plan B&amp;nbsp;I will try this and see what I can come up with - thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 11:44:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/import-information-from-multiple-tables-to-output-into-a-single/m-p/2247856#M32904</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-08T11:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: import information from multiple tables to output into a single table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/import-information-from-multiple-tables-to-output-into-a-single/m-p/2247857#M32905</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; You are right. Personally I always prefer metadata approach but it would require more initial development time. So I have given both&amp;nbsp;ways of doing. Depending on your timelines, you can choose either Plan A or B.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; If the reply has helped to resolve your query, could you please mark the topic as closed? Kudos are also welcome &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;Warm Regards,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Nikhil Thampi&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 11:54:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/import-information-from-multiple-tables-to-output-into-a-single/m-p/2247857#M32905</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-08T11:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: import information from multiple tables to output into a single table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/import-information-from-multiple-tables-to-output-into-a-single/m-p/2247858#M32906</link>
      <description>Hi - thanks again! Silly question but how might I close the topic?
&lt;BR /&gt;
&lt;BR /&gt;Thanks,</description>
      <pubDate>Mon, 08 Oct 2018 12:15:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/import-information-from-multiple-tables-to-output-into-a-single/m-p/2247858#M32906</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-08T12:15:07Z</dc:date>
    </item>
  </channel>
</rss>

