<?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 SQL Templates: &amp;quot;Duplicate local variable tempSQLSentence_tSQLTemplate&amp;quot; in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/SQL-Templates-quot-Duplicate-local-variable-tempSQLSentence/m-p/2278231#M53768</link>
    <description>Hi, 
&lt;BR /&gt;I'm setting up an SQL Template with many sql statements. 
&lt;BR /&gt;Unfortunately all these sql statements generate the same java variable, as you can see below: 
&lt;BR /&gt;String tempSQLSentence_tSQLTemplate_1_1 = "EXECUTE format('SELECT set_config(%L, %L, %L)',..."; 
&lt;BR /&gt;... 
&lt;BR /&gt;String tempSQLSentence_tSQLTemplate_1_1 = "WITH parent_info AS ( SELECT c.oid ..."; 
&lt;BR /&gt;... 
&lt;BR /&gt;String tempSQLSentence_tSQLTemplate_1_1 = "FOR v_row IN WITH child_info AS ..."; 
&lt;BR /&gt;... 
&lt;BR /&gt;and I get the error "Duplicate local variable tempSQLSentence_tSQLTemplate" many times. 
&lt;BR /&gt;Is it a bug or I strictly need to fill any SQL Template with just ONE sql statement? 
&lt;BR /&gt;More, I notice that FOR statements, as far as IF, LOOP statements, are splitted in the generated code: 
&lt;BR /&gt;... 
&lt;BR /&gt;String tempSQLSentence_tSQLTemplate_1_1 = "EXECUTE v_sql"; 
&lt;BR /&gt;globalMap.put("tSQLTemplate_1_QUERY", 
&lt;BR /&gt;tempSQLSentence_tSQLTemplate_1_1); 
&lt;BR /&gt;stmt_tSQLTemplate_1.addBatch(tempSQLSentence_tSQLTemplate_1_1); 
&lt;BR /&gt;String tempSQLSentence_tSQLTemplate_1_1 = "END IF"; 
&lt;BR /&gt;globalMap.put("tSQLTemplate_1_QUERY", 
&lt;BR /&gt;tempSQLSentence_tSQLTemplate_1_1); 
&lt;BR /&gt;stmt_tSQLTemplate_1.addBatch(tempSQLSentence_tSQLTemplate_1_1); 
&lt;BR /&gt;String tempSQLSentence_tSQLTemplate_1_1 = "END LOOP";&amp;nbsp; 
&lt;BR /&gt;... 
&lt;BR /&gt;is it correct? it seems to me quite strange even once the above problem (the name duplication) is solved. 
&lt;BR /&gt;Looking forward for your help, 
&lt;BR /&gt;thank you, 
&lt;BR /&gt;Lorenzo</description>
    <pubDate>Mon, 21 Nov 2016 14:41:17 GMT</pubDate>
    <dc:creator>Lorenzo5</dc:creator>
    <dc:date>2016-11-21T14:41:17Z</dc:date>
    <item>
      <title>SQL Templates: "Duplicate local variable tempSQLSentence_tSQLTemplate"</title>
      <link>https://community.qlik.com/t5/Talend-Studio/SQL-Templates-quot-Duplicate-local-variable-tempSQLSentence/m-p/2278231#M53768</link>
      <description>Hi, 
&lt;BR /&gt;I'm setting up an SQL Template with many sql statements. 
&lt;BR /&gt;Unfortunately all these sql statements generate the same java variable, as you can see below: 
&lt;BR /&gt;String tempSQLSentence_tSQLTemplate_1_1 = "EXECUTE format('SELECT set_config(%L, %L, %L)',..."; 
&lt;BR /&gt;... 
&lt;BR /&gt;String tempSQLSentence_tSQLTemplate_1_1 = "WITH parent_info AS ( SELECT c.oid ..."; 
&lt;BR /&gt;... 
&lt;BR /&gt;String tempSQLSentence_tSQLTemplate_1_1 = "FOR v_row IN WITH child_info AS ..."; 
&lt;BR /&gt;... 
&lt;BR /&gt;and I get the error "Duplicate local variable tempSQLSentence_tSQLTemplate" many times. 
&lt;BR /&gt;Is it a bug or I strictly need to fill any SQL Template with just ONE sql statement? 
&lt;BR /&gt;More, I notice that FOR statements, as far as IF, LOOP statements, are splitted in the generated code: 
&lt;BR /&gt;... 
&lt;BR /&gt;String tempSQLSentence_tSQLTemplate_1_1 = "EXECUTE v_sql"; 
&lt;BR /&gt;globalMap.put("tSQLTemplate_1_QUERY", 
&lt;BR /&gt;tempSQLSentence_tSQLTemplate_1_1); 
&lt;BR /&gt;stmt_tSQLTemplate_1.addBatch(tempSQLSentence_tSQLTemplate_1_1); 
&lt;BR /&gt;String tempSQLSentence_tSQLTemplate_1_1 = "END IF"; 
&lt;BR /&gt;globalMap.put("tSQLTemplate_1_QUERY", 
&lt;BR /&gt;tempSQLSentence_tSQLTemplate_1_1); 
&lt;BR /&gt;stmt_tSQLTemplate_1.addBatch(tempSQLSentence_tSQLTemplate_1_1); 
&lt;BR /&gt;String tempSQLSentence_tSQLTemplate_1_1 = "END LOOP";&amp;nbsp; 
&lt;BR /&gt;... 
&lt;BR /&gt;is it correct? it seems to me quite strange even once the above problem (the name duplication) is solved. 
&lt;BR /&gt;Looking forward for your help, 
&lt;BR /&gt;thank you, 
&lt;BR /&gt;Lorenzo</description>
      <pubDate>Mon, 21 Nov 2016 14:41:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/SQL-Templates-quot-Duplicate-local-variable-tempSQLSentence/m-p/2278231#M53768</guid>
      <dc:creator>Lorenzo5</dc:creator>
      <dc:date>2016-11-21T14:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Templates: "Duplicate local variable tempSQLSentence_tSQLTemplate"</title>
      <link>https://community.qlik.com/t5/Talend-Studio/SQL-Templates-quot-Duplicate-local-variable-tempSQLSentence/m-p/2278232#M53769</link>
      <description>Hi,&lt;BR /&gt;On which build version you got this issue? Have you tried to switched from "Designer" to "Code" tab to see if there is any error line in generated java code?&lt;BR /&gt;Best regards&lt;BR /&gt;Sabrina</description>
      <pubDate>Mon, 05 Dec 2016 06:30:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/SQL-Templates-quot-Duplicate-local-variable-tempSQLSentence/m-p/2278232#M53769</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-05T06:30:15Z</dc:date>
    </item>
  </channel>
</rss>

