<?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 Dynamic table creation fails when using  column alias in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-table-creation-fails-when-using-column-alias/m-p/2268016#M46713</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to create a table using the dynamic schema. The job looks like this :&lt;/P&gt;
&lt;P&gt;tJDBCInput --&amp;gt; dynamicSchema ---&amp;gt; tMSSqlOutput (Create table if not exists)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The query in the input contains alias for duplicate column name :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Select
addressBookA.email&amp;nbsp;as email1,
addressBookB.email as email2,
....
from
addressBook&amp;nbsp;addressBookA,
addressBook&amp;nbsp;addressBookB
where&amp;nbsp;addressBookA.id =&amp;nbsp;addressBookB.id .....&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when running the job, i have the following error :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;java.sql.SQLException:Column names in each table must be unique&lt;/PRE&gt;
&lt;P&gt;It looks like the dynamic schema does not use the alias for the table creation thus giving the error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any idea how to solve this ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 07 Sep 2018 07:18:15 GMT</pubDate>
    <dc:creator>mat2121</dc:creator>
    <dc:date>2018-09-07T07:18:15Z</dc:date>
    <item>
      <title>Dynamic table creation fails when using  column alias</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-table-creation-fails-when-using-column-alias/m-p/2268016#M46713</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to create a table using the dynamic schema. The job looks like this :&lt;/P&gt;
&lt;P&gt;tJDBCInput --&amp;gt; dynamicSchema ---&amp;gt; tMSSqlOutput (Create table if not exists)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The query in the input contains alias for duplicate column name :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Select
addressBookA.email&amp;nbsp;as email1,
addressBookB.email as email2,
....
from
addressBook&amp;nbsp;addressBookA,
addressBook&amp;nbsp;addressBookB
where&amp;nbsp;addressBookA.id =&amp;nbsp;addressBookB.id .....&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when running the job, i have the following error :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;java.sql.SQLException:Column names in each table must be unique&lt;/PRE&gt;
&lt;P&gt;It looks like the dynamic schema does not use the alias for the table creation thus giving the error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any idea how to solve this ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 07:18:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-table-creation-fails-when-using-column-alias/m-p/2268016#M46713</guid>
      <dc:creator>mat2121</dc:creator>
      <dc:date>2018-09-07T07:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table creation fails when using  column alias</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-table-creation-fails-when-using-column-alias/m-p/2268017#M46714</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/00570000004XLpQAAW"&gt;@mat2121&lt;/A&gt;,as part of testing keep the different name then email in Table B and modify the query and execute the job and let me know.&lt;/P&gt; 
&lt;P&gt;by the way which database are you using?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 08:06:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-table-creation-fails-when-using-column-alias/m-p/2268017#M46714</guid>
      <dc:creator>manodwhb</dc:creator>
      <dc:date>2018-09-07T08:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic table creation fails when using  column alias</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-table-creation-fails-when-using-column-alias/m-p/2268018#M46715</link>
      <description>&lt;P&gt;Hi, thanks for your input.&lt;/P&gt; 
&lt;P&gt;I'am using MySQL.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I was able to fix the problem using this parameter in the connection string :&amp;nbsp;&lt;SPAN&gt;useOldAliasMetadataBehavior=true&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-installing-upgrading-5-1.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-installing-upgrading-5-1.html&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Sep 2018 08:48:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-table-creation-fails-when-using-column-alias/m-p/2268018#M46715</guid>
      <dc:creator>mat2121</dc:creator>
      <dc:date>2018-09-07T08:48:03Z</dc:date>
    </item>
  </channel>
</rss>

