<?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 Parameter index on tMSSqlRow prepared statement in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Parameter-index-on-tMSSqlRow-prepared-statement/m-p/2375182#M137653</link>
    <description>Hi 
&lt;BR /&gt;I want to execute a SQL query with the tMSSqlRow component, as input I'm using a tXMLMap component. The SQL query should be executed for every incoming row, using two values (eid, communication_number; both of data type integer) as parameters. 
&lt;BR /&gt;In the basic settings of tMSSql I entered the SQL query with question marks as placeholders for the parameters: 
&lt;BR /&gt; 
&lt;PRE&gt;"UPDATE  mytable&lt;BR /&gt;SET     eid = ?&lt;BR /&gt;WHERE   communication_number = ?"&lt;/PRE&gt; 
&lt;BR /&gt;Under advanced settings I activated "Use PreparedStatement" and I defined the two parameters with parameter indexes 1 and 2. 
&lt;BR /&gt;When I run the job, I got the error message "Invalid parameter index 1". Any ideas what could be the cause for that error? 
&lt;BR /&gt;Thanks 
&lt;BR /&gt;Tom</description>
    <pubDate>Tue, 05 Jul 2016 18:43:27 GMT</pubDate>
    <dc:creator>Albot248</dc:creator>
    <dc:date>2016-07-05T18:43:27Z</dc:date>
    <item>
      <title>Parameter index on tMSSqlRow prepared statement</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Parameter-index-on-tMSSqlRow-prepared-statement/m-p/2375182#M137653</link>
      <description>Hi 
&lt;BR /&gt;I want to execute a SQL query with the tMSSqlRow component, as input I'm using a tXMLMap component. The SQL query should be executed for every incoming row, using two values (eid, communication_number; both of data type integer) as parameters. 
&lt;BR /&gt;In the basic settings of tMSSql I entered the SQL query with question marks as placeholders for the parameters: 
&lt;BR /&gt; 
&lt;PRE&gt;"UPDATE  mytable&lt;BR /&gt;SET     eid = ?&lt;BR /&gt;WHERE   communication_number = ?"&lt;/PRE&gt; 
&lt;BR /&gt;Under advanced settings I activated "Use PreparedStatement" and I defined the two parameters with parameter indexes 1 and 2. 
&lt;BR /&gt;When I run the job, I got the error message "Invalid parameter index 1". Any ideas what could be the cause for that error? 
&lt;BR /&gt;Thanks 
&lt;BR /&gt;Tom</description>
      <pubDate>Tue, 05 Jul 2016 18:43:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Parameter-index-on-tMSSqlRow-prepared-statement/m-p/2375182#M137653</guid>
      <dc:creator>Albot248</dc:creator>
      <dc:date>2016-07-05T18:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Parameter index on tMSSqlRow prepared statement</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Parameter-index-on-tMSSqlRow-prepared-statement/m-p/2375183#M137654</link>
      <description>Hi &amp;nbsp; 
&lt;BR /&gt;You need to iterate each input row using tFlowToIterate component, the job looks like 
&lt;BR /&gt;....tXMLMap--main(out1)--tFlowToIterte--iterate--tMssqlRow 
&lt;BR /&gt;on tMssqlRow, write the query as: 
&lt;BR /&gt;"Update mytable set eid="+(Integer)globalMap.get("out1.eid")+"where communication_number="+(Integer)globalMap.get("out1. 
&lt;FONT size="2"&gt;&lt;FONT face="Verdana, Helvetica, Arial, sans-serif"&gt;communication_number&lt;/FONT&gt;&lt;/FONT&gt;") 
&lt;BR /&gt;BTW, why don't you use tMssqlOutput to update the data? For example: 
&lt;BR /&gt;....tXMLMap--main(out1)--tMssqlOutput 
&lt;BR /&gt;Set eid column as a key on the schema, and select 'update' item in the Action on data list. 
&lt;BR /&gt;Regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Wed, 06 Jul 2016 08:10:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Parameter-index-on-tMSSqlRow-prepared-statement/m-p/2375183#M137654</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-06T08:10:18Z</dc:date>
    </item>
  </channel>
</rss>

