<?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: Dynamic SQL in Stored proc not working in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-SQL-in-Stored-proc-not-working/m-p/2372044#M134919</link>
    <description>Hi Sabrina,
&lt;BR /&gt;Yes I am using tmysqlsp and mysql db. I have read the article too.
&lt;BR /&gt;Please find below the screenshot
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MHOS.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/132803iDDF55F7E8E78DAA8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MHOS.png" alt="0683p000009MHOS.png" /&gt;&lt;/span&gt;
&lt;BR /&gt;
&lt;BR /&gt;Regards
&lt;BR /&gt;Rathi</description>
    <pubDate>Wed, 18 May 2016 09:27:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-05-18T09:27:23Z</dc:date>
    <item>
      <title>Dynamic SQL in Stored proc not working</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-SQL-in-Stored-proc-not-working/m-p/2372042#M134917</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I am using a stored procedure, that truncates a partitioned table.&lt;BR /&gt;And I pass the table name as a parameter to the stored proc. And inside, the stored proc, there is a dynamic sql that truncates the table as per the table name 'in' parameter. The procedure is as follows&lt;BR /&gt;DELIMITER $$&lt;BR /&gt;CREATE DEFINER=`mpadmin`@`%` PROCEDURE `mysqlproc`(in isactivetoproc int, in tablename varchar(255))&lt;BR /&gt;begin&lt;BR /&gt;set @sql = concat('alter table ',tablename, ' truncate partition pactive');&lt;BR /&gt;if isactivetoproc = 1&lt;BR /&gt;then&lt;BR /&gt;prepare stmt from @sql;&lt;BR /&gt;execute stmt ;&lt;BR /&gt;deallocate prepare stmt;&lt;BR /&gt;end if;&lt;BR /&gt;end$$&lt;BR /&gt;DELIMITER ;&lt;BR /&gt;I have tested this on mysql and it works fine. But when I call it through talend , it keeps saying there is a syntax error.&lt;BR /&gt;However, when I don't use the dynamic sql and use regular SQL, and call through talend it works.&lt;BR /&gt;DELIMITER $$&lt;BR /&gt;CREATE DEFINER=`mpadmin`@`%` PROCEDURE `mysqlproctest`(in isactivetoproc int, in tablename varchar(255))&lt;BR /&gt;begin&lt;BR /&gt;alter table farmer truncate partition pactive;&lt;BR /&gt;end$$&lt;BR /&gt;DELIMITER ;&lt;BR /&gt;My intention is to reuse the procedure for all tables.&amp;nbsp;&lt;BR /&gt;Any thoughts on why the first proc is not working&lt;BR /&gt;Thanks&lt;BR /&gt;Rathi&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2016 12:23:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-SQL-in-Stored-proc-not-working/m-p/2372042#M134917</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-17T12:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic SQL in Stored proc not working</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-SQL-in-Stored-proc-not-working/m-p/2372043#M134918</link>
      <description>Hi,
&lt;BR /&gt;Did you use component tMysqlSP to call your stored procedure in MySql DB? Could you please show us your setting screenshot?
&lt;BR /&gt;Have you already checked this KB article about:
&lt;A href="https://help.talend.com/search/all?query=Calling+a+stored+procedure+or+function" target="_blank" rel="nofollow noopener noreferrer"&gt;TalendHelpCenter:Calling a stored procedure or function&lt;/A&gt;?
&lt;BR /&gt;Best regards
&lt;BR /&gt;Sabrina</description>
      <pubDate>Wed, 18 May 2016 04:22:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-SQL-in-Stored-proc-not-working/m-p/2372043#M134918</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-18T04:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic SQL in Stored proc not working</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-SQL-in-Stored-proc-not-working/m-p/2372044#M134919</link>
      <description>Hi Sabrina,
&lt;BR /&gt;Yes I am using tmysqlsp and mysql db. I have read the article too.
&lt;BR /&gt;Please find below the screenshot
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MHOS.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/132803iDDF55F7E8E78DAA8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MHOS.png" alt="0683p000009MHOS.png" /&gt;&lt;/span&gt;
&lt;BR /&gt;
&lt;BR /&gt;Regards
&lt;BR /&gt;Rathi</description>
      <pubDate>Wed, 18 May 2016 09:27:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-SQL-in-Stored-proc-not-working/m-p/2372044#M134919</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-18T09:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic SQL in Stored proc not working</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-SQL-in-Stored-proc-not-working/m-p/2372045#M134920</link>
      <description>Hi,&lt;BR /&gt;And could you post your tMySqlSP component setting screenshot, please?&lt;BR /&gt;Best regards&lt;BR /&gt;Sabrina</description>
      <pubDate>Wed, 18 May 2016 09:57:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-SQL-in-Stored-proc-not-working/m-p/2372045#M134920</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-18T09:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic SQL in Stored proc not working</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-SQL-in-Stored-proc-not-working/m-p/2372046#M134921</link>
      <description>Hi Sabrina,
&lt;BR /&gt;PFA the screenshot
&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MH10.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/150844i9AFB1E89200A26E3/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MH10.png" alt="0683p000009MH10.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Wed, 18 May 2016 10:14:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-SQL-in-Stored-proc-not-working/m-p/2372046#M134921</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-18T10:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic SQL in Stored proc not working</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-SQL-in-Stored-proc-not-working/m-p/2372047#M134922</link>
      <description>Hi,
&lt;BR /&gt;Any update on this?
&lt;BR /&gt;Thanks
&lt;BR /&gt;Rathi</description>
      <pubDate>Thu, 19 May 2016 09:50:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-SQL-in-Stored-proc-not-working/m-p/2372047#M134922</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-19T09:50:52Z</dc:date>
    </item>
  </channel>
</rss>

