<?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 Weird behavior from tDBOutput component -- Please help explain! in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Weird-behavior-from-tDBOutput-component-Please-help-explain/m-p/2207007#M6830</link>
    <description>&lt;P&gt;I found something weird with the tDBOutput component. I will describe it in detail, please be patient with me.&lt;/P&gt; 
&lt;P&gt;I use Talend Open Studio for DI 7.1.1&lt;/P&gt; 
&lt;P&gt;Here is my job design:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="My job design.JPG" style="width: 581px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2l3.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129952iD83B2E4837EABC0E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2l3.jpg" alt="0683p000009M2l3.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;This is a simple job: it reads data from a flat file "PO_RCT" and insert the rows into a table "PO_Receipt".&lt;/P&gt; 
&lt;P&gt;It only has two checkpoints: 01- Insert RCT Rows &amp;amp; 02 - Archive RCT File (not shown).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I added a little extra in the job:&lt;/P&gt; 
&lt;P&gt;I added a trailer row on the flat file which has the &lt;SPAN&gt;total&amp;nbsp;#&amp;nbsp;of&amp;nbsp;records info. In my PreJob, I created a GlobalVar "totalRCTCnt" to get the&amp;nbsp; total&amp;nbsp;#&amp;nbsp;of&amp;nbsp;records from the trailer row.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;In my main job, it reads the file ( set the Footer = 1 in tFileInpitDelimited to exclude the trailer row) and try to insert the rows into PO_Receipt table in the database.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;I have two RunIf condition:&lt;/P&gt; 
&lt;P&gt;If&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;((Integer)globalMap.get("tFileInputDelimited_2_NB_LINE")).intValue()==((BigDecimal)globalMap.get("totalRCTCnt")).intValue(),&amp;nbsp; &lt;FONT size="2"&gt;&amp;nbsp;Commit Rows&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;If&amp;nbsp;&lt;FONT size="1 2 3 4 5 6 7"&gt;((Integer)globalMap.get("tFileInputDelimited_2_NB_LINE")).intValue()!=((BigDecimal)globalMap.get("totalRCTCnt")).intValue(),&amp;nbsp; &amp;nbsp; &lt;FONT size="2"&gt;send error email and Rollback Rows.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Now I have 2 real rows in the file, but I&amp;nbsp;&lt;SPAN&gt;intentionally put&amp;nbsp;total&amp;nbsp;#&amp;nbsp;of&amp;nbsp;records =12 in the trailer row to test my logic and my job. Here is the result:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test-1.JPG" style="width: 657px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2rZ.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145623iFA023375A9F66661/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2rZ.jpg" alt="0683p000009M2rZ.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test-11.JPG" style="width: 539px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2gX.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154577iCA599CD2D1E15D5E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2gX.jpg" alt="0683p000009M2gX.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;So the job goes to the If (totalCountDiffer) path and Rollback the rows, the job failed and there is no rows in the PO_Receipt table. Of course, if I correct the&amp;nbsp;&lt;SPAN&gt;total&amp;nbsp;#&amp;nbsp;of&amp;nbsp;records to be 2 in the trailer row, job would succeed with 2 rows inserted.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;All above is what I expected.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Then I did some other thing to the flat file, this time I observed the weird behavior:&lt;/P&gt; 
&lt;P&gt;In the flat, again I set the&amp;nbsp;&lt;SPAN&gt;total&amp;nbsp;#&amp;nbsp;of&amp;nbsp;records = 12 and the file has the original 2 rows. I insert the 3rd row right above the trailer row, and make one of fields null (empty) -- this field is part of the composite primary key in PO_Receipt table.&amp;nbsp; Now I run the job again -&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test-2.JPG" style="width: 838px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2re.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145393iFBD4895255A5C798/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2re.jpg" alt="0683p000009M2re.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test-22.JPG" style="width: 651px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LyWh.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138913i677C10883BDAA335/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LyWh.jpg" alt="0683p000009LyWh.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;As we can see, 3 rows were read from the flat file but only 2 rows shown after tDBOutput ("PO_Receipt"). It seems the job didn't go to the next subjob ("Print Total Counts"), and neither tDBCommit nor tDBRollback shown run condition. And I didn't receive the error email as well.&lt;/P&gt; 
&lt;P&gt;&lt;FONT face="arial black,avant garde" color="#FF0000"&gt;But there are 2 rows inserted into the table! How could this happen?&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;BTW, I have "Auto Commit" unchecked in my DBConnection:&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NO AUTOCOMMIT.JPG" style="width: 382px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2ro.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142290iFCAFBE3E051FC270/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2ro.jpg" alt="0683p000009M2ro.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;And I delete all rows from the table in PreJob:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="last.JPG" style="width: 307px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2rt.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156861i211F380AD5499BA8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2rt.jpg" alt="0683p000009M2rt.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;I need help to understand this. Thanks!&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Feb 2019 22:41:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-02-28T22:41:44Z</dc:date>
    <item>
      <title>Weird behavior from tDBOutput component -- Please help explain!</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-behavior-from-tDBOutput-component-Please-help-explain/m-p/2207007#M6830</link>
      <description>&lt;P&gt;I found something weird with the tDBOutput component. I will describe it in detail, please be patient with me.&lt;/P&gt; 
&lt;P&gt;I use Talend Open Studio for DI 7.1.1&lt;/P&gt; 
&lt;P&gt;Here is my job design:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="My job design.JPG" style="width: 581px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2l3.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129952iD83B2E4837EABC0E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2l3.jpg" alt="0683p000009M2l3.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;This is a simple job: it reads data from a flat file "PO_RCT" and insert the rows into a table "PO_Receipt".&lt;/P&gt; 
&lt;P&gt;It only has two checkpoints: 01- Insert RCT Rows &amp;amp; 02 - Archive RCT File (not shown).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I added a little extra in the job:&lt;/P&gt; 
&lt;P&gt;I added a trailer row on the flat file which has the &lt;SPAN&gt;total&amp;nbsp;#&amp;nbsp;of&amp;nbsp;records info. In my PreJob, I created a GlobalVar "totalRCTCnt" to get the&amp;nbsp; total&amp;nbsp;#&amp;nbsp;of&amp;nbsp;records from the trailer row.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;In my main job, it reads the file ( set the Footer = 1 in tFileInpitDelimited to exclude the trailer row) and try to insert the rows into PO_Receipt table in the database.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;I have two RunIf condition:&lt;/P&gt; 
&lt;P&gt;If&lt;FONT size="1 2 3 4 5 6 7"&gt;&amp;nbsp;((Integer)globalMap.get("tFileInputDelimited_2_NB_LINE")).intValue()==((BigDecimal)globalMap.get("totalRCTCnt")).intValue(),&amp;nbsp; &lt;FONT size="2"&gt;&amp;nbsp;Commit Rows&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;If&amp;nbsp;&lt;FONT size="1 2 3 4 5 6 7"&gt;((Integer)globalMap.get("tFileInputDelimited_2_NB_LINE")).intValue()!=((BigDecimal)globalMap.get("totalRCTCnt")).intValue(),&amp;nbsp; &amp;nbsp; &lt;FONT size="2"&gt;send error email and Rollback Rows.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Now I have 2 real rows in the file, but I&amp;nbsp;&lt;SPAN&gt;intentionally put&amp;nbsp;total&amp;nbsp;#&amp;nbsp;of&amp;nbsp;records =12 in the trailer row to test my logic and my job. Here is the result:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test-1.JPG" style="width: 657px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2rZ.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145623iFA023375A9F66661/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2rZ.jpg" alt="0683p000009M2rZ.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test-11.JPG" style="width: 539px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2gX.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154577iCA599CD2D1E15D5E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2gX.jpg" alt="0683p000009M2gX.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;So the job goes to the If (totalCountDiffer) path and Rollback the rows, the job failed and there is no rows in the PO_Receipt table. Of course, if I correct the&amp;nbsp;&lt;SPAN&gt;total&amp;nbsp;#&amp;nbsp;of&amp;nbsp;records to be 2 in the trailer row, job would succeed with 2 rows inserted.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;All above is what I expected.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Then I did some other thing to the flat file, this time I observed the weird behavior:&lt;/P&gt; 
&lt;P&gt;In the flat, again I set the&amp;nbsp;&lt;SPAN&gt;total&amp;nbsp;#&amp;nbsp;of&amp;nbsp;records = 12 and the file has the original 2 rows. I insert the 3rd row right above the trailer row, and make one of fields null (empty) -- this field is part of the composite primary key in PO_Receipt table.&amp;nbsp; Now I run the job again -&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test-2.JPG" style="width: 838px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2re.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145393iFBD4895255A5C798/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2re.jpg" alt="0683p000009M2re.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test-22.JPG" style="width: 651px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LyWh.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138913i677C10883BDAA335/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LyWh.jpg" alt="0683p000009LyWh.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;As we can see, 3 rows were read from the flat file but only 2 rows shown after tDBOutput ("PO_Receipt"). It seems the job didn't go to the next subjob ("Print Total Counts"), and neither tDBCommit nor tDBRollback shown run condition. And I didn't receive the error email as well.&lt;/P&gt; 
&lt;P&gt;&lt;FONT face="arial black,avant garde" color="#FF0000"&gt;But there are 2 rows inserted into the table! How could this happen?&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;BTW, I have "Auto Commit" unchecked in my DBConnection:&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NO AUTOCOMMIT.JPG" style="width: 382px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2ro.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142290iFCAFBE3E051FC270/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2ro.jpg" alt="0683p000009M2ro.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;And I delete all rows from the table in PreJob:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="last.JPG" style="width: 307px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2rt.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156861i211F380AD5499BA8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2rt.jpg" alt="0683p000009M2rt.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" color="#000000"&gt;I need help to understand this. Thanks!&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 22:41:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-behavior-from-tDBOutput-component-Please-help-explain/m-p/2207007#M6830</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-28T22:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Weird behavior from tDBOutput component -- Please help explain!</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-behavior-from-tDBOutput-component-Please-help-explain/m-p/2207008#M6831</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;Could you please enable the Die on Error action for tOracleOutput where you are writing the data. Then use a OnSubJobError to capture the error and rollback (like you are doing in the case of count mismatch)?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; Could you also try to print the values used in in Run if condition in the same tJava using System.out.println() function? This will give you idea whether you are getting right numbers from previous components (just another debugging step).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; Please let us know the results and we will take it forward from there.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 05:37:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-behavior-from-tDBOutput-component-Please-help-explain/m-p/2207008#M6831</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-01T05:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Weird behavior from tDBOutput component -- Please help explain!</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-behavior-from-tDBOutput-component-Please-help-explain/m-p/2207009#M6832</link>
      <description>&lt;P&gt;Nikhil,&lt;/P&gt; 
&lt;P&gt;Thank you for your reply!&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;Could you please enable the Die on Error action for tOracleOutput where you are writing the data.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;A: Die on Error was ready enabled -&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PO_Rreceipt.JPG" style="width: 194px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2or.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134487i7493B206A0371A42/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2or.jpg" alt="0683p000009M2or.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;Then use a OnSubJobError to capture the error and rollback (like you are doing in the case of count mismatch)?&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;A: I modified the job based on your suggestion and please see the new job design and run result described below -&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;The new design to have a OnSubJobError path and try to print out error message before rollback the rows.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="new design.JPG" style="width: 518px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2sr.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145461iAC25D977265DD6C9/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2sr.jpg" alt="0683p000009M2sr.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Job run result ( 3 real rows in the source, 1 of them violated the not null constraint):&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="new design_result.JPG" style="width: 561px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2sw.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/130972iCDE7860A54C61337/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2sw.jpg" alt="0683p000009M2sw.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;I highlighted all the important info in Yellow: the job ran through the OnSubjobError path and error message was printed out and the job exit with exit code 1. Of course, no rows were inserted.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;But if modify the job a little bit, I see something a little different and I still have questions to ask.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;1st modification: Disable the tDie component and run the job -&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="result_ without tDie.JPG" style="width: 633px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2t1.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142291i7964A41DA8E1C482/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2t1.jpg" alt="0683p000009M2t1.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;As you can see, the job ran through the OnSubjobError path and we still get the same error message (which was logged by my error file), still no rows were inserted. But look at the bottom: exit code =0.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;My question: Why the exit code would be 0 when the job has an error?&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;2nd modification:&amp;nbsp;Disable the tDie &amp;amp; tDBRollback and run the job -&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="result_without Rollback_01.JPG" style="width: 539px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2t6.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156862i31E8917E4A04ECB7/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2t6.jpg" alt="0683p000009M2t6.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The job ran through the OnSubjobError path and we still get the same error message. And exit code = 0&lt;/P&gt; 
&lt;P&gt;And this time &lt;FONT color="#FF0000"&gt;2 rows were inserted! -&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="result_without Rollback_02.JPG" style="width: 154px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2tB.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128324i91349060962F367D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2tB.jpg" alt="0683p000009M2tB.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;My question: &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;1. Why the exit code would be 0 when the job has an error? (same as the above one)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;2. Why 2 rows would be inserted when there is no tDBCommit component working in the subjob?&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;3. Why the global variable&amp;nbsp;tDBOutput_1_NB_LINE_INSERTED shows "Number of Rows inserted"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;null&amp;nbsp; but there are actually rows inserted into the table?&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#333333"&gt;Thanks,&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#333333"&gt;TM&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 17:08:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-behavior-from-tDBOutput-component-Please-help-explain/m-p/2207009#M6832</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-01T17:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Weird behavior from tDBOutput component -- Please help explain!</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-behavior-from-tDBOutput-component-Please-help-explain/m-p/2207010#M6833</link>
      <description>&lt;P&gt;Nikhil,&lt;/P&gt; 
&lt;P&gt;I did more test and have another question to ask.&lt;/P&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="another_new_design.JPG" style="width: 628px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2jd.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/137159i129FC7C66C4AE559/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2jd.jpg" alt="0683p000009M2jd.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In this new design, I connect tDBOutput and the subjob (3 components with red background) with OnComponentError. The job ran through the subjob and failed (exit code =1). No rows were inserted.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Then I change the&amp;nbsp;OnComponentError to RunIf -&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RunIf.JPG" style="width: 643px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2kp.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/137525i061E5AD5E104C57C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2kp.jpg" alt="0683p000009M2kp.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;And I run the job -&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RunIf_result.JPG" style="width: 581px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2ta.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/155880i1F43C1F17206D868/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2ta.jpg" alt="0683p000009M2ta.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;As you can see, it didn't kickoff the subjob at all but 2 rows were inserted (which is the existing mystery).&lt;/P&gt; 
&lt;P&gt;My new question is: &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Why the Run If trigger not working here?&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 20:15:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-behavior-from-tDBOutput-component-Please-help-explain/m-p/2207010#M6833</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-01T20:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Weird behavior from tDBOutput component -- Please help explain!</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Weird-behavior-from-tDBOutput-component-Please-help-explain/m-p/2207011#M6834</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; I would suggest to retain the OnSubJobOk version of your job with minor modifications.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 777px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2tk.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156020iC53FAB0B703B0ACF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2tk.png" alt="0683p000009M2tk.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In the schema of tOracleOutput, you need to select the keys to mention the PK columns by selecting the keys check box. Also please select the Action on Data as "Insert or Update". ANother thing you have to do is in the tMap output expression editor. You need to verify whether the input columns are not null for Primary Key columns.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;So you can add a filter condition in output schema's filter expression by adding Not Null check for primary key columns. You can send all the records which is failing this condition to another output flow and check these records later. Or you can send these failed records back to source system. In this way, you should be able to load all good records and reject bad ones.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Mar 2019 14:41:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Weird-behavior-from-tDBOutput-component-Please-help-explain/m-p/2207011#M6834</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-02T14:41:29Z</dc:date>
    </item>
  </channel>
</rss>

