<?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: Extracting data from database mixed with hard-coded values using file containing the metadata in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Extracting-data-from-database-mixed-with-hard-coded-values-using/m-p/2286821#M60443</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;your problem is not clear to me,&lt;/P&gt;&lt;P&gt;Can't you just join the 2 flows?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Feb 2020 14:18:48 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-02-07T14:18:48Z</dc:date>
    <item>
      <title>Extracting data from database mixed with hard-coded values using file containing the metadata</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Extracting-data-from-database-mixed-with-hard-coded-values-using/m-p/2286820#M60442</link>
      <description>&lt;P&gt;Our database connection is using JDBC (&lt;EM&gt;tDBInput&lt;/EM&gt;).&amp;nbsp;We have files containing metadata of the table/s we want to get data from. Something like this:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;TABLE width="342"&gt; 
 &lt;TBODY&gt; 
  &lt;TR&gt; 
   &lt;TD width="87"&gt;columnName&lt;/TD&gt; 
   &lt;TD width="68"&gt;isIncluded&lt;/TD&gt; 
   &lt;TD width="85"&gt;isHardCoded&lt;/TD&gt; 
   &lt;TD width="102"&gt;HardCodeValue&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;col1&lt;/TD&gt; 
   &lt;TD&gt;Y&lt;/TD&gt; 
   &lt;TD&gt;N&lt;/TD&gt; 
   &lt;TD&gt;&amp;nbsp;&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;col2&lt;/TD&gt; 
   &lt;TD&gt;N&lt;/TD&gt; 
   &lt;TD&gt;N&lt;/TD&gt; 
   &lt;TD&gt;&amp;nbsp;&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;col3&lt;/TD&gt; 
   &lt;TD&gt;Y&lt;/TD&gt; 
   &lt;TD&gt;N&lt;/TD&gt; 
   &lt;TD&gt;&amp;nbsp;&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;col4&lt;/TD&gt; 
   &lt;TD&gt;Y&lt;/TD&gt; 
   &lt;TD&gt;Y&lt;/TD&gt; 
   &lt;TD&gt;"val4"&lt;/TD&gt; 
  &lt;/TR&gt; 
  &lt;TR&gt; 
   &lt;TD&gt;col5&lt;/TD&gt; 
   &lt;TD&gt;Y&lt;/TD&gt; 
   &lt;TD&gt;Y&lt;/TD&gt; 
   &lt;TD&gt;"val5"&lt;/TD&gt; 
  &lt;/TR&gt; 
 &lt;/TBODY&gt; 
&lt;/TABLE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If &lt;EM&gt;isIncluded="Y"&lt;/EM&gt;, then the values of that column will be part of the resulting dataset (those rows in the metadata CSV file is ignored).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If &lt;EM&gt;isHardCoded="N"&lt;/EM&gt;, that column&amp;nbsp;is included in the SELECT statement composed (in the Query section of the &lt;EM&gt;tDBInput&lt;/EM&gt;).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If &lt;EM&gt;isHardCoded="Y"&lt;/EM&gt;, then the value of that column is not extracted from the database, but rather the &lt;EM&gt;columnName&lt;/EM&gt;s together with the corresponding &lt;EM&gt;HardCodeValue&lt;/EM&gt;s are appended "horizontally" to the result of the query from the database.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Example, if the&amp;nbsp;&lt;EM&gt;tDBInput&amp;nbsp;&lt;/EM&gt;outputs 100 rows (containing values for &lt;EM&gt;col1&lt;/EM&gt; and &lt;EM&gt;col3&lt;/EM&gt; only), each of these rows will have additional columns,&amp;nbsp;&lt;EM&gt;col4&lt;/EM&gt; and &lt;EM&gt;col5,&amp;nbsp;&lt;/EM&gt;with values "&lt;EM&gt;val4&lt;/EM&gt;" and "&lt;EM&gt;val5&lt;/EM&gt;" respectively.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Based on my reading of some of the community posts (I am new to Talend), I can use &lt;EM&gt;tWriteDynamicFields&lt;/EM&gt;, &lt;EM&gt;tSetDynamicSchema&lt;/EM&gt;, &lt;EM&gt;tJavaRow, tDenormalize&amp;nbsp;&lt;/EM&gt;and/or combinations, but it is still hazy in my understanding. I have used &lt;EM&gt;tMap&lt;/EM&gt;, but I can't put dynamic column name in the output.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;So, what's the best solution / design for this? Here is the design of my initial experimentation (plus my ideas):&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="talend_community_question_1.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M92D.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129963i40BE36E017E609AA/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M92D.png" alt="0683p000009M92D.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 08:59:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Extracting-data-from-database-mixed-with-hard-coded-values-using/m-p/2286820#M60442</guid>
      <dc:creator>menorah84</dc:creator>
      <dc:date>2020-02-07T08:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting data from database mixed with hard-coded values using file containing the metadata</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Extracting-data-from-database-mixed-with-hard-coded-values-using/m-p/2286821#M60443</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;your problem is not clear to me,&lt;/P&gt;&lt;P&gt;Can't you just join the 2 flows?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 14:18:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Extracting-data-from-database-mixed-with-hard-coded-values-using/m-p/2286821#M60443</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-07T14:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting data from database mixed with hard-coded values using file containing the metadata</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Extracting-data-from-database-mixed-with-hard-coded-values-using/m-p/2286822#M60444</link>
      <description>&lt;P&gt;I'm not sure, I'm new to Talend, so my solution is like this. If you have one flow solution that is better, that would be great.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2020 02:17:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Extracting-data-from-database-mixed-with-hard-coded-values-using/m-p/2286822#M60444</guid>
      <dc:creator>menorah84</dc:creator>
      <dc:date>2020-02-10T02:17:59Z</dc:date>
    </item>
  </channel>
</rss>

