<?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: Null Output from tAS400Row using Prepared Statement in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Null-Output-from-tAS400Row-using-Prepared-Statement/m-p/2214257#M11178</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;tDBRow do not propagate&amp;nbsp;resultset by default&lt;/P&gt; 
&lt;P&gt;at least you need to&lt;SPAN&gt;&amp;nbsp;set a switch in the advanced component settings to "Propagate Query's Recordset".&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;and you need to use a tParseRecordSet component&amp;nbsp;to further evaluate the RecordSet in your flow.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;check some scenarios for MySQL -&amp;nbsp;&lt;A href="https://help.talend.com/reader/hm5FaPiiOP31nUYHph0JwQ/61XKWjkH3MqvYNU79nWw_A" target="_self" rel="nofollow noopener noreferrer"&gt;https://help.talend.com/reader/hm5FaPiiOP31nUYHph0JwQ/61XKWjkH3MqvYNU79nWw_A&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;but really no reason to use tDBRow for SELECT, for SELECT it more easy to use tDBInput, best chois&amp;nbsp;for tDBRow - DDL, UPDATE, DELETE and etc&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Mar 2019 13:26:55 GMT</pubDate>
    <dc:creator>vapukov</dc:creator>
    <dc:date>2019-03-29T13:26:55Z</dc:date>
    <item>
      <title>Null Output from tAS400Row using Prepared Statement</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-Output-from-tAS400Row-using-Prepared-Statement/m-p/2214253#M11174</link>
      <description>&lt;P&gt;Hey all,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm trying to use the following prepared statement in my tAS400Row in Talend Data Integration Studio component:&lt;/P&gt; 
&lt;PRE&gt;SELECT ERSEQ FROM F5747ERR WHERE
			EREDOC = ?
 			AND EREDCT = ?
 			AND EREKCO = ?&lt;/PRE&gt; 
&lt;P&gt;However, I'm only getting null values as an output. In order to analyse the issue I tried printing the Query and its' parameters in a tJava and log the row output as such:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Capture.PNG" style="width: 264px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M44t.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129360iE1A54BCC048363F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M44t.png" alt="0683p000009M44t.png" /&gt;&lt;/span&gt;&lt;/SPAN&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; 
&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;The tJava Code looks like this:&lt;/P&gt; 
&lt;PRE&gt;System.out.println(((String)globalMap.get("tAS400Row_5_QUERY")));
System.out.println("1: " + ((Integer)globalMap.get("rowOut.SYEDOC")));
System.out.println("2: " + ((String)globalMap.get("rowOut.SYEDCT")));
System.out.println("3: " + ((String)globalMap.get("rowOut.SYEKCO")));&lt;/PRE&gt; 
&lt;P&gt;Output from the Java and tLogRow is:&lt;/P&gt; 
&lt;PRE&gt;SELECT ERSEQ FROM F5747ERR WHERE  			EREDOC = ?   			AND EREDCT = ?   			AND EREKCO = ?
1: 10019751
2: IN
3: 00700
.-----.
|tLogRow_1|
|=---=|
|ERSEQ|
|=---=|
|null |
'-----'&lt;/PRE&gt; 
&lt;P&gt;&amp;nbsp;Now, if I run the same query - with the '?' replaced by the values - directly against the DB, I get the expected results (i.e. a set of numbers).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;At this point I don't know what I'm doing wrong. Any help would be appreciated.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Kind Regards,&lt;/P&gt; 
&lt;P&gt;Philip&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 10:31:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-Output-from-tAS400Row-using-Prepared-Statement/m-p/2214253#M11174</guid>
      <dc:creator>PhilipSommer</dc:creator>
      <dc:date>2019-03-29T10:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Null Output from tAS400Row using Prepared Statement</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-Output-from-tAS400Row-using-Prepared-Statement/m-p/2214254#M11175</link>
      <description>&lt;P&gt;Can you please show us the advance setting of Row Component.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just wanted to see if "Use PreparedStatement" has been well configured.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 11:46:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-Output-from-tAS400Row-using-Prepared-Statement/m-p/2214254#M11175</guid>
      <dc:creator>akumar2301</dc:creator>
      <dc:date>2019-03-29T11:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Null Output from tAS400Row using Prepared Statement</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-Output-from-tAS400Row-using-Prepared-Statement/m-p/2214255#M11176</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;There you go. This is also how I configured tAS400Row components with Update statements in the same job.&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M453.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/155976i3953B378F423FD0E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M453.png" alt="0683p000009M453.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;EDIT:&lt;/P&gt; 
&lt;P&gt;For clarification, the global variables result from a previous tFlowToIterate which gets the rowOut as input:&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M458.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/139861i65786FE40A7BC628/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M458.png" alt="0683p000009M458.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 11:50:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-Output-from-tAS400Row-using-Prepared-Statement/m-p/2214255#M11176</guid>
      <dc:creator>PhilipSommer</dc:creator>
      <dc:date>2019-03-29T11:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Null Output from tAS400Row using Prepared Statement</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-Output-from-tAS400Row-using-Prepared-Statement/m-p/2214256#M11177</link>
      <description>&lt;P&gt;I am not sure what is going wrong here , except these globalVariable are null in this component.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try once to change the query as non-prepared&amp;nbsp; and let me know if these are still NULL in tJava result.&lt;/P&gt;&lt;P&gt;like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"SELECT ERSEQ FROM F5747ERR WHERE&lt;/P&gt;&lt;P&gt;EREDOC = " + ((Integer)globalMap.get("rowOut.SYEDOC"))&lt;/P&gt;&lt;P&gt;+ " AND EREDCT = '" + ((String)globalMap.get("rowOut.SYEDCT"))&lt;/P&gt;&lt;P&gt;+"' AND EREKCO = '" + ((String)globalMap.get("rowOut.SYEKCO")) + "'"&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 13:22:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-Output-from-tAS400Row-using-Prepared-Statement/m-p/2214256#M11177</guid>
      <dc:creator>akumar2301</dc:creator>
      <dc:date>2019-03-29T13:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Null Output from tAS400Row using Prepared Statement</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-Output-from-tAS400Row-using-Prepared-Statement/m-p/2214257#M11178</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;tDBRow do not propagate&amp;nbsp;resultset by default&lt;/P&gt; 
&lt;P&gt;at least you need to&lt;SPAN&gt;&amp;nbsp;set a switch in the advanced component settings to "Propagate Query's Recordset".&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;and you need to use a tParseRecordSet component&amp;nbsp;to further evaluate the RecordSet in your flow.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;check some scenarios for MySQL -&amp;nbsp;&lt;A href="https://help.talend.com/reader/hm5FaPiiOP31nUYHph0JwQ/61XKWjkH3MqvYNU79nWw_A" target="_self" rel="nofollow noopener noreferrer"&gt;https://help.talend.com/reader/hm5FaPiiOP31nUYHph0JwQ/61XKWjkH3MqvYNU79nWw_A&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;but really no reason to use tDBRow for SELECT, for SELECT it more easy to use tDBInput, best chois&amp;nbsp;for tDBRow - DDL, UPDATE, DELETE and etc&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2019 13:26:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-Output-from-tAS400Row-using-Prepared-Statement/m-p/2214257#M11178</guid>
      <dc:creator>vapukov</dc:creator>
      <dc:date>2019-03-29T13:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Null Output from tAS400Row using Prepared Statement</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Null-Output-from-tAS400Row-using-Prepared-Statement/m-p/2214258#M11179</link>
      <description>&lt;P&gt;Hey Vapukov,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks for the info. I still cannot seem to get it to work. I have now set up the tAS400Row as follows:&lt;/P&gt; 
&lt;UL&gt; 
 &lt;LI&gt;Checked the "Propagate QUERY's recordset" checkmark under adv. settings&lt;/LI&gt; 
 &lt;LI&gt;Change the ERSEQ column in the schema to type Object under basic setting&lt;/LI&gt; 
&lt;/UL&gt; 
&lt;P&gt;I then rout the output into a tParseRecordSet and log the output of that. If I set the output type of the tParseRecordset to be an Integer column, then I get&amp;nbsp; a conversion error from Object to Integer. If I leave the output as an object-typed column I simply get no output rows whatsoever:&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture.PNG" style="width: 322px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M45P.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145263i4ADD7EECA72D6B8E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M45P.png" alt="0683p000009M45P.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;I would expect to get a single output row with value "1".&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Changing from a prepared statement to one with "inline-values" does not seem to change anything.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Kind Regards,&lt;/P&gt; 
&lt;P&gt;Philip&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;EDIT: Is there any way to use prepared statements with tDBInput as you suggest I use that component? I don't really feel like concatenating a SQL statement inline with values I know little about.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;EDIT 2: Okay, I got it to work after specifing the correct column name as a value in the attribute table for the tParseRecordset. However, I originally wanted to read the max value of that column. If I change the SQL to "SELECT MAX(ERSEQ) ..." Talend tells me the specified column was not found in the&amp;nbsp;tParseRecordset, despite the traces debug showing the columns' name to be unchanged (i.e. "ERSEQ").&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 12:48:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Null-Output-from-tAS400Row-using-Prepared-Statement/m-p/2214258#M11179</guid>
      <dc:creator>PhilipSommer</dc:creator>
      <dc:date>2019-04-01T12:48:52Z</dc:date>
    </item>
  </channel>
</rss>

