<?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: Multiple SQL Statements in SQL Template =&amp;gt; Duplicate local variable in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Multiple-SQL-Statements-in-SQL-Template-gt-Duplicate-local/m-p/2374806#M137352</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;There seems to be an issue when there are multiple variable instances with the same name.&lt;/P&gt;&lt;P&gt;Does it work with single statement?&lt;/P&gt;&lt;P&gt;#sql sentence&lt;/P&gt;&lt;P&gt;DROP TABLE temp_&amp;lt;%=__TABLE_NAME__ %&amp;gt;;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Sabrina&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Nov 2021 08:41:29 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-11-12T08:41:29Z</dc:date>
    <item>
      <title>Multiple SQL Statements in SQL Template =&gt; Duplicate local variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Multiple-SQL-Statements-in-SQL-Template-gt-Duplicate-local/m-p/2374805#M137351</link>
      <description>&lt;P&gt;I am using Talend Studio&lt;/P&gt;&lt;P&gt;Talend Cloud Data Management Platform&lt;/P&gt;&lt;P&gt;Version: 7.3.1&lt;/P&gt;&lt;P&gt;Build id: 20210818_1049-patch&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having trouble adding multiple SQL statements to a SQL Template.&lt;/P&gt;&lt;P&gt;The code I'm trying to write was generating Java errors.&amp;nbsp;So I have resorted to your example code to see if it is me.&lt;/P&gt;&lt;P&gt;The sample code in your &lt;/P&gt;&lt;P&gt;&lt;A href="https://help.talend.com/r/en-US/7.3/studio-user-guide-data-integration/...-syntax?tocId=K0X4LeMygZ9MCT5_9pzP8g" alt="https://help.talend.com/r/en-US/7.3/studio-user-guide-data-integration/...-syntax?tocId=K0X4LeMygZ9MCT5_9pzP8g" target="_blank"&gt;&lt;U&gt;documentation&lt;/U&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt; produces the same scenario, so I will use that to ask for help on this problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error I get is:&lt;/P&gt;&lt;P&gt;	Duplicate local variable tempSQLSentence_tSQLTemplate_1_1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Java code that is generated is&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000Kzcx8AAB.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129064i6F047428D90CF9D0/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000Kzcx8AAB.png" alt="0695b00000Kzcx8AAB.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, the variable "tempSQLSentence_tSQLTemplate_1_1" is being declared 3 times in this code block.&lt;/P&gt;&lt;P&gt;Possibly the error is simply that the variable is being declared each time, when it should be declared only the first time.&lt;/P&gt;&lt;P&gt;Alternatively, the variable suffix number must be incremented.&lt;/P&gt;&lt;P&gt;I've kept the example flow very simple so we may focus on the actual issue.&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000KzcwAAAR.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141330iA30041C93D330908/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000KzcwAAAR.png" alt="0695b00000KzcwAAAR.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I have the same problem is more complex flows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SQL Template code I'm using is from your &lt;A href="https://help.talend.com/r/en-US/7.3/studio-user-guide-data-integration/...-syntax?tocId=K0X4LeMygZ9MCT5_9pzP8g" alt="https://help.talend.com/r/en-US/7.3/studio-user-guide-data-integration/...-syntax?tocId=K0X4LeMygZ9MCT5_9pzP8g" target="_blank"&gt;&lt;U&gt;documentation&lt;/U&gt;&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000KzcvgAAB.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/146100i7F11B34AD64AA8AC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000KzcvgAAB.png" alt="0695b00000KzcvgAAB.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:31:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Multiple-SQL-Statements-in-SQL-Template-gt-Duplicate-local/m-p/2374805#M137351</guid>
      <dc:creator>McDon</dc:creator>
      <dc:date>2024-11-15T23:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple SQL Statements in SQL Template =&gt; Duplicate local variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Multiple-SQL-Statements-in-SQL-Template-gt-Duplicate-local/m-p/2374806#M137352</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;There seems to be an issue when there are multiple variable instances with the same name.&lt;/P&gt;&lt;P&gt;Does it work with single statement?&lt;/P&gt;&lt;P&gt;#sql sentence&lt;/P&gt;&lt;P&gt;DROP TABLE temp_&amp;lt;%=__TABLE_NAME__ %&amp;gt;;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Sabrina&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 08:41:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Multiple-SQL-Statements-in-SQL-Template-gt-Duplicate-local/m-p/2374806#M137352</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-12T08:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple SQL Statements in SQL Template =&gt; Duplicate local variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Multiple-SQL-Statements-in-SQL-Template-gt-Duplicate-local/m-p/2374807#M137353</link>
      <description>It does work with a single statement.
But only because of the variable name increment.

It is also worth noting I noticed something else.

When using multiple SQL Templates, each with 1 sql statement, inside 1 component;
The variable name that is shown in my code increments - i think this is where the bug is.

&lt;VARAIBLE_NAME&gt;_1_1
&lt;VARIABLE_NAME&gt;_1_2
&lt;VARIABLE_NAME&gt;_1_3

To me it would seem like the first number should increment for each different SQL template inside the component.
Then within each SQL template, the second number should increment.&lt;/VARIABLE_NAME&gt;&lt;/VARIABLE_NAME&gt;&lt;/VARAIBLE_NAME&gt;</description>
      <pubDate>Fri, 12 Nov 2021 12:22:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Multiple-SQL-Statements-in-SQL-Template-gt-Duplicate-local/m-p/2374807#M137353</guid>
      <dc:creator>McDon</dc:creator>
      <dc:date>2021-11-12T12:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple SQL Statements in SQL Template =&gt; Duplicate local variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Multiple-SQL-Statements-in-SQL-Template-gt-Duplicate-local/m-p/2374808#M137354</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;SQL templates are definitely made for ELT. Are you performing ELT on your Snowflake?&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Sabrina&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 03:48:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Multiple-SQL-Statements-in-SQL-Template-gt-Duplicate-local/m-p/2374808#M137354</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-15T03:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple SQL Statements in SQL Template =&gt; Duplicate local variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Multiple-SQL-Statements-in-SQL-Template-gt-Duplicate-local/m-p/2374809#M137355</link>
      <description>Yes. Per my flow, I, using an ELT component.
Is that what you were asking me?</description>
      <pubDate>Mon, 15 Nov 2021 11:03:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Multiple-SQL-Statements-in-SQL-Template-gt-Duplicate-local/m-p/2374809#M137355</guid>
      <dc:creator>McDon</dc:creator>
      <dc:date>2021-11-15T11:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple SQL Statements in SQL Template =&gt; Duplicate local variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Multiple-SQL-Statements-in-SQL-Template-gt-Duplicate-local/m-p/2374810#M137356</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;There raises a support case 00242656 about:Multiple SQL Statements in SQL Template =&amp;gt; Duplicate local variable&lt;/P&gt;&lt;P&gt;Our support engineers are making an investigation on it and then come back to you as soon as possible.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Sabrina&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 04:19:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Multiple-SQL-Statements-in-SQL-Template-gt-Duplicate-local/m-p/2374810#M137356</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-16T04:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple SQL Statements in SQL Template =&gt; Duplicate local variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Multiple-SQL-Statements-in-SQL-Template-gt-Duplicate-local/m-p/2374811#M137357</link>
      <description>&lt;P&gt;Talend fixed this in the Dec 2021 patch.&lt;/P&gt;&lt;P&gt;I have confirmed it&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 03:03:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Multiple-SQL-Statements-in-SQL-Template-gt-Duplicate-local/m-p/2374811#M137357</guid>
      <dc:creator>McDon</dc:creator>
      <dc:date>2022-01-25T03:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple SQL Statements in SQL Template =&gt; Duplicate local variable</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Multiple-SQL-Statements-in-SQL-Template-gt-Duplicate-local/m-p/2374812#M137358</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thanks for your feedback and let us know this fixed patch.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Sabrina&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 06:38:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Multiple-SQL-Statements-in-SQL-Template-gt-Duplicate-local/m-p/2374812#M137358</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-25T06:38:43Z</dc:date>
    </item>
  </channel>
</rss>

