<?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: ContextLoad duplicate local variable key in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/ContextLoad-duplicate-local-variable-key/m-p/2232434#M22399</link>
    <description>&lt;P&gt;If i am not sure if i am undermining the complexity, here are couple of my observations:&lt;/P&gt;&lt;P&gt;1) Do you really need a procedure here, because procedure will definitely turnout to be expensive in terms of performance in this context&lt;/P&gt;&lt;P&gt;2) Instead of a procedure you can have a view like:&lt;/P&gt;&lt;P&gt;SELECT 'run_id' AS v_key, NVL (MAX (RUN_ID), 0) + 1 AS v_value&lt;BR /&gt;FROM etlexecution where date_fin is null; --your query may differ, pls reconfirm&lt;/P&gt;&lt;P&gt;3) You don't need a commit in your procedure, when ever a procedure is executed externally, it does a implicit commit&lt;/P&gt;&lt;P&gt;4) Try to put a tmap after your stored procedure component to see the outports of it, i doubt if it is giving 2 ports with the same name&lt;/P&gt;</description>
    <pubDate>Fri, 27 Dec 2019 15:38:45 GMT</pubDate>
    <dc:creator>tnewbie</dc:creator>
    <dc:date>2019-12-27T15:38:45Z</dc:date>
    <item>
      <title>ContextLoad duplicate local variable key</title>
      <link>https://community.qlik.com/t5/Talend-Studio/ContextLoad-duplicate-local-variable-key/m-p/2232433#M22398</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I start with Talend.&lt;/P&gt; 
&lt;P&gt;I follow O'Reilly &lt;A href="http://archive.oreilly.com/oreillyschool/courses/dba3/DBA%203%20Creating%20a%20Data%20Warehouse%20v1.pdf" target="_self" rel="nofollow noopener noreferrer"&gt;guide &lt;/A&gt;in page 82.&lt;/P&gt; 
&lt;P&gt;I create a Pre-Job / Post-Job to audit the Execution.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 882px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8SU.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138100iFA3F974A74D87807/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8SU.png" alt="0683p000009M8SU.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;I have a OracleSP calling an Oracle procedure :&amp;nbsp;etl_demarrage returning a label and run_id&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;create or replace PROCEDURE etl_demarrage ( cle_lib out varchar2, actuel_run_id out integer)
IS

BEGIN
actuel_run_id := null;
cle_lib := 'run_id';

    SELECT MAX(run_id) 
        INTO actuel_run_id
    FROM ETLEXECUTION
    WHERE date_fin IS NULL;

IF actuel_run_id IS NULL THEN
    BEGIN
        INSERT INTO ETLEXECUTION (date_debut) VALUES (SYSDATE);
        SELECT MAX(run_id) 
            INTO actuel_run_id
        FROM ETLEXECUTION
        WHERE date_fin IS NULL;
    END;
END IF;

COMMIT;
END;&lt;/PRE&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="image.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8L5.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142590i6BDCBFE24350016F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8L5.png" alt="0683p000009M8L5.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If I replace T_Contextload by a tLogRow, i get :&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;[statistics] connected
run_id|24
[statistics] disconnected&lt;/PRE&gt; 
&lt;P&gt;So Procedure return a right tuple and the insert in DB is OK.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The light params of contextLoad are :&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M8SZ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/150630i94C237A5AFDDA838/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M8SZ.png" alt="0683p000009M8SZ.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;But when i run, i got the error :&amp;nbsp;Duplicate local variable key_tContextLoad_1&lt;/P&gt; 
&lt;P&gt;In the code i have twice declaration for key_tContextLoad_1 variable :&lt;/P&gt; 
&lt;PRE&gt;/**
 * [tContextLoad_1 main ] start
 */

currentComponent = "tContextLoad_1";

// row1
// row1

if (execStat) {
	runStat.updateStatOnConnection("row1" + iterateId, 1, 1);
}

//////////////////////////
String tmp_key_tContextLoad_1 = null;
String key_tContextLoad_1 = null;
...

/**
 * [tContextLoad_1 end ] start
 */

currentComponent = "tContextLoad_1";

java.util.Enumeration&amp;lt;?&amp;gt; enu_tContextLoad_1 = context.propertyNames();
while (enu_tContextLoad_1.hasMoreElements()) {
	String key_tContextLoad_1 = (String) enu_tContextLoad_1.nextElement();
	if (!assignList_tContextLoad_1.contains(key_tContextLoad_1)&lt;/PRE&gt; 
&lt;P&gt;Why i have twice declarations and how i can i fix this problem ?&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;I couldn't find a solution on the internet&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Thanks for your help&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2019 13:22:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/ContextLoad-duplicate-local-variable-key/m-p/2232433#M22398</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-27T13:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: ContextLoad duplicate local variable key</title>
      <link>https://community.qlik.com/t5/Talend-Studio/ContextLoad-duplicate-local-variable-key/m-p/2232434#M22399</link>
      <description>&lt;P&gt;If i am not sure if i am undermining the complexity, here are couple of my observations:&lt;/P&gt;&lt;P&gt;1) Do you really need a procedure here, because procedure will definitely turnout to be expensive in terms of performance in this context&lt;/P&gt;&lt;P&gt;2) Instead of a procedure you can have a view like:&lt;/P&gt;&lt;P&gt;SELECT 'run_id' AS v_key, NVL (MAX (RUN_ID), 0) + 1 AS v_value&lt;BR /&gt;FROM etlexecution where date_fin is null; --your query may differ, pls reconfirm&lt;/P&gt;&lt;P&gt;3) You don't need a commit in your procedure, when ever a procedure is executed externally, it does a implicit commit&lt;/P&gt;&lt;P&gt;4) Try to put a tmap after your stored procedure component to see the outports of it, i doubt if it is giving 2 ports with the same name&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2019 15:38:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/ContextLoad-duplicate-local-variable-key/m-p/2232434#M22399</guid>
      <dc:creator>tnewbie</dc:creator>
      <dc:date>2019-12-27T15:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: ContextLoad duplicate local variable key</title>
      <link>https://community.qlik.com/t5/Talend-Studio/ContextLoad-duplicate-local-variable-key/m-p/2232435#M22400</link>
      <description>Thanks for your advise&lt;BR /&gt;I add a tMap between OracleSP and TContextLoad and the error is gone.&lt;BR /&gt;I don't understand but that's ok&lt;BR /&gt;I prefer keep my procedure to store my new run id</description>
      <pubDate>Fri, 27 Dec 2019 19:58:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/ContextLoad-duplicate-local-variable-key/m-p/2232435#M22400</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-27T19:58:28Z</dc:date>
    </item>
  </channel>
</rss>

