<?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: DB2: Termination Character in the tDB2Row component in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/DB2-Termination-Character-in-the-tDB2Row-component/m-p/2376027#M138299</link>
    <description>Thanks for the advice but tDB2SP can only call a procedure, not create/replace it. Am I wrong about that?&lt;BR /&gt;While I'm not sure about the root cause of the problem yet I found a solution / workaround:&lt;BR /&gt;Since we're working in a transaction that's started by our ETL tool we can just use "BEGIN NOT ATOMIC". This will provide us with the same notation/syntax (no Errors due to ';' as Terminator) but will not automatically create a new savepoint.&lt;BR /&gt;If you're building your own app/component or do not use a transaction already please DON'T USE this solution.</description>
    <pubDate>Wed, 22 Oct 2014 11:43:23 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2014-10-22T11:43:23Z</dc:date>
    <item>
      <title>DB2: Termination Character in the tDB2Row component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/DB2-Termination-Character-in-the-tDB2Row-component/m-p/2376024#M138296</link>
      <description>Hi, 
&lt;BR /&gt;I want to dynamically create/replace a stored procedure via the tDB2Row component. The procedure changes and is part of our CDC-logic, because of this it needs to be updated by a talend job. 
&lt;BR /&gt;We create the procedure (as a String) in a Java class. the issue is that I can't set the 
&lt;B&gt;terminator&lt;/B&gt; through the tDB2Row component. 
&lt;BR /&gt;When I tested the SP manually via Data Studio or the commandline I used the following commands which worked fine. 
&lt;BR /&gt; 
&lt;PRE&gt;#SET TERMINATOR @&lt;/PRE&gt; 
&lt;BR /&gt;-or- 
&lt;BR /&gt; 
&lt;PRE&gt;--#SET TERMINATOR @&lt;/PRE&gt; 
&lt;BR /&gt;This just results in errors: 
&lt;BR /&gt; 
&lt;PRE&gt;Exception in component tDB2Row_1&lt;BR /&gt;com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=#SET TERMINATOR @;BEGIN-OF-STATEMENT;&amp;lt;space&amp;gt;, DRIVER=4.14.111&lt;/PRE&gt; 
&lt;BR /&gt;-or- 
&lt;BR /&gt; 
&lt;PRE&gt;Exception in component tDB2Row_1&lt;BR /&gt;com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=END@;CASE;&lt;BR /&gt; &amp;nbsp; &amp;nbsp;END FOR;&lt;BR /&gt;;END, DRIVER=4.14.111&lt;/PRE&gt; 
&lt;BR /&gt;depending on which version of I used. 
&lt;BR /&gt; 
&lt;BR /&gt;The other possibility would be to using 
&lt;BR /&gt; 
&lt;PRE&gt;BEGIN ATOMIC&lt;BR /&gt; &amp;nbsp; SQL COMMANDS WITH THE NORMAL TERMINATOR;&lt;BR /&gt;END&lt;/PRE&gt; 
&lt;BR /&gt;but this also results in errors: 
&lt;BR /&gt; 
&lt;PRE&gt;Exception in component tDB2Row_1&lt;BR /&gt;com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-20112, SQLSTATE=3B002, SQLERRMC=null, DRIVER=4.14.111&lt;/PRE&gt; 
&lt;BR /&gt;I'd like to avoid using a sql file that'd have to be called via the commandline. I'm sure the error appears because the way I defined the TERMINATOR conflicts with the way talend sends this command to the database (java.sql.Statemen.execute()) 
&lt;BR /&gt;I've tried multiple other ways but none seems to work. I need some advice/pointers...</description>
      <pubDate>Wed, 22 Oct 2014 09:06:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/DB2-Termination-Character-in-the-tDB2Row-component/m-p/2376024#M138296</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2014-10-22T09:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: DB2: Termination Character in the tDB2Row component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/DB2-Termination-Character-in-the-tDB2Row-component/m-p/2376025#M138297</link>
      <description>On further investigating the SQL errors etc.:&lt;BR /&gt;It seems that the&lt;BR /&gt;&lt;PRE&gt;BEGIN ATOMIC&lt;BR /&gt; &amp;nbsp; SQL COMMANDS WITH THE NORMAL TERMINATOR;&lt;BR /&gt;END&lt;/PRE&gt;&lt;BR /&gt;works well. The error &lt;BR /&gt;&lt;PRE&gt;Exception in component tDB2Row_1&lt;BR /&gt;com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-20112, SQLSTATE=3B002, SQLERRMC=null, DRIVER=4.14.111&lt;/PRE&gt;&lt;BR /&gt;has to do with SAVEPOINTS. There's no savepoints in my procedure and I can't find any in the query&amp;nbsp; that's sent to the DB2:&lt;BR /&gt;&lt;PRE&gt;System.out.println((String)globalMap.get("tDB2Row_1_QUERY"));&lt;/PRE&gt;&lt;BR /&gt;only shows the command that I used. So there shouldn't be an issue with SAVEPOINTS</description>
      <pubDate>Wed, 22 Oct 2014 09:55:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/DB2-Termination-Character-in-the-tDB2Row-component/m-p/2376025#M138297</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2014-10-22T09:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: DB2: Termination Character in the tDB2Row component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/DB2-Termination-Character-in-the-tDB2Row-component/m-p/2376026#M138298</link>
      <description>Your mentioned commands to set the terminator are commands to the Data Studio and not SQL commands for the connection.&lt;BR /&gt;I would use the tDB2SP component instead of tDB2Row.</description>
      <pubDate>Wed, 22 Oct 2014 11:20:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/DB2-Termination-Character-in-the-tDB2Row-component/m-p/2376026#M138298</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-22T11:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: DB2: Termination Character in the tDB2Row component</title>
      <link>https://community.qlik.com/t5/Talend-Studio/DB2-Termination-Character-in-the-tDB2Row-component/m-p/2376027#M138299</link>
      <description>Thanks for the advice but tDB2SP can only call a procedure, not create/replace it. Am I wrong about that?&lt;BR /&gt;While I'm not sure about the root cause of the problem yet I found a solution / workaround:&lt;BR /&gt;Since we're working in a transaction that's started by our ETL tool we can just use "BEGIN NOT ATOMIC". This will provide us with the same notation/syntax (no Errors due to ';' as Terminator) but will not automatically create a new savepoint.&lt;BR /&gt;If you're building your own app/component or do not use a transaction already please DON'T USE this solution.</description>
      <pubDate>Wed, 22 Oct 2014 11:43:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/DB2-Termination-Character-in-the-tDB2Row-component/m-p/2376027#M138299</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2014-10-22T11:43:23Z</dc:date>
    </item>
  </channel>
</rss>

