<?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 How to execute Update query with where clause, and select statement in where clause in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-execute-Update-query-with-where-clause-and-select/m-p/2318486#M88820</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have a scenario&amp;nbsp;,&amp;nbsp;update query with 'WHERE' clause,&amp;nbsp;inside where clause also need to get value using SELECT query.&amp;nbsp;I doing this using tDBRow, but still stuck at how to get value from SELECT statement with tDBRow.  &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SELECT statement is not working inside where clause&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is example:&lt;/P&gt;&lt;P&gt;"UPDATE table_A&lt;/P&gt;&lt;P&gt;SET DT1=&amp;nbsp;? ,&amp;nbsp;&lt;/P&gt;&lt;P&gt; DT2=?,&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;column2=&amp;nbsp;?,	&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;column3= ?&lt;/P&gt;&lt;P&gt;WHERE&amp;nbsp;&amp;nbsp;column4= ?&amp;nbsp;AND&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(column2 is null OR DT2=? ) AND&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DT3 = (SELECT MAX(DT3) FROM table_A&amp;nbsp;WHERE column1=? ) "&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p00000BC4Y7AAL.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/135628iF74BFBBDA32CEEDD/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p00000BC4Y7AAL.png" alt="0693p00000BC4Y7AAL.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 00:50:17 GMT</pubDate>
    <dc:creator>Ramaraju2</dc:creator>
    <dc:date>2024-11-16T00:50:17Z</dc:date>
    <item>
      <title>How to execute Update query with where clause, and select statement in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-execute-Update-query-with-where-clause-and-select/m-p/2318486#M88820</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have a scenario&amp;nbsp;,&amp;nbsp;update query with 'WHERE' clause,&amp;nbsp;inside where clause also need to get value using SELECT query.&amp;nbsp;I doing this using tDBRow, but still stuck at how to get value from SELECT statement with tDBRow.  &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SELECT statement is not working inside where clause&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is example:&lt;/P&gt;&lt;P&gt;"UPDATE table_A&lt;/P&gt;&lt;P&gt;SET DT1=&amp;nbsp;? ,&amp;nbsp;&lt;/P&gt;&lt;P&gt; DT2=?,&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;column2=&amp;nbsp;?,	&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;column3= ?&lt;/P&gt;&lt;P&gt;WHERE&amp;nbsp;&amp;nbsp;column4= ?&amp;nbsp;AND&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(column2 is null OR DT2=? ) AND&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DT3 = (SELECT MAX(DT3) FROM table_A&amp;nbsp;WHERE column1=? ) "&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p00000BC4Y7AAL.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/135628iF74BFBBDA32CEEDD/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p00000BC4Y7AAL.png" alt="0693p00000BC4Y7AAL.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:50:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-execute-Update-query-with-where-clause-and-select/m-p/2318486#M88820</guid>
      <dc:creator>Ramaraju2</dc:creator>
      <dc:date>2024-11-16T00:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to execute Update query with where clause, and select statement in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-execute-Update-query-with-where-clause-and-select/m-p/2318487#M88821</link>
      <description>&lt;P&gt;Are there always multiple rows read from the source file? You need to iterate each row  so as to you are able to access the current value of columns. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 03:36:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-execute-Update-query-with-where-clause-and-select/m-p/2318487#M88821</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-13T03:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to execute Update query with where clause, and select statement in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-execute-Update-query-with-where-clause-and-select/m-p/2318488#M88822</link>
      <description>&lt;P&gt;only 1 row in each file.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 03:42:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-execute-Update-query-with-where-clause-and-select/m-p/2318488#M88822</guid>
      <dc:creator>Ramaraju2</dc:creator>
      <dc:date>2021-01-13T03:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to execute Update query with where clause, and select statement in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-execute-Update-query-with-where-clause-and-select/m-p/2318489#M88823</link>
      <description>&lt;P&gt;If there is only one row in each file, you can build the query string on tJavaRow and execute the query on tDBRow, eg:&lt;/P&gt;&lt;P&gt;tFileList--iterate--tFileInputDelimited--tMap--out--&amp;gt;tJavaRow--oncomponentok--tDBRow&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;on tJavaRow:&lt;/P&gt;&lt;P&gt;context.query="update tableName set fieldName1="+input_row.column1+" and fieldName2="+input_row.column2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//context.query is a context variable, string type. &lt;/P&gt;&lt;P&gt;//to access the value of column from input row using expression: input_row.columnName&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;on tDBrow:&lt;/P&gt;&lt;P&gt;set the Query field with context variable as:&lt;/P&gt;&lt;P&gt;context.query&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it help you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&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>Wed, 13 Jan 2021 04:58:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-execute-Update-query-with-where-clause-and-select/m-p/2318489#M88823</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-13T04:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to execute Update query with where clause, and select statement in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-execute-Update-query-with-where-clause-and-select/m-p/2318490#M88824</link>
      <description>&lt;P&gt;Hi Shong,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your answer. I tried it with simple update query with hardcoding values and with input row values. still no luck. Getting error "&lt;B&gt; row1 cannot be resolved to a variable&lt;/B&gt;" at tJavaRow component. Please help me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Context Variable declaration&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p00000BCB73AAH.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145779iF3031890A27FEC11/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p00000BCB73AAH.png" alt="0693p00000BCB73AAH.png" /&gt;&lt;/span&gt;Flow&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p00000BCBByAAP.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/146127i6E31589BDF28020E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p00000BCBByAAP.png" alt="0693p00000BCBByAAP.png" /&gt;&lt;/span&gt;context.query in tJavaRow&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p00000BCBKCAA5.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/135396iE20AA98B656A48EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p00000BCBKCAA5.png" alt="0693p00000BCBKCAA5.png" /&gt;&lt;/span&gt;Query in tDBRow&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p00000BCBNfAAP.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142096i3AC073480304C296/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p00000BCBNfAAP.png" alt="0693p00000BCBNfAAP.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 07:20:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-execute-Update-query-with-where-clause-and-select/m-p/2318490#M88824</guid>
      <dc:creator>Ramaraju2</dc:creator>
      <dc:date>2021-01-13T07:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to execute Update query with where clause, and select statement in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-execute-Update-query-with-where-clause-and-select/m-p/2318491#M88825</link>
      <description>&lt;P&gt;can you share the code of tJavaRow? I see some code reference to row1&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 08:19:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-execute-Update-query-with-where-clause-and-select/m-p/2318491#M88825</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-14T08:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to execute Update query with where clause, and select statement in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-execute-Update-query-with-where-clause-and-select/m-p/2318492#M88826</link>
      <description>&lt;P&gt;only this update qury i am using tJavaRow&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jan 2021 01:23:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-execute-Update-query-with-where-clause-and-select/m-p/2318492#M88826</guid>
      <dc:creator>Ramaraju2</dc:creator>
      <dc:date>2021-01-16T01:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to execute Update query with where clause, and select statement in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-execute-Update-query-with-where-clause-and-select/m-p/2318493#M88827</link>
      <description>&lt;P&gt;only this update query , using in tJavaRow&lt;span class="lia-inline-image-display-wrapper" image-alt="0693p00000BCBKCAA5.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/135396iE20AA98B656A48EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0693p00000BCBKCAA5.png" alt="0693p00000BCBKCAA5.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jan 2021 01:24:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-execute-Update-query-with-where-clause-and-select/m-p/2318493#M88827</guid>
      <dc:creator>Ramaraju2</dc:creator>
      <dc:date>2021-01-16T01:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to execute Update query with where clause, and select statement in where clause</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-execute-Update-query-with-where-clause-and-select/m-p/2318494#M88828</link>
      <description>&lt;P&gt;Hi Sheng,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Plesase help me out this.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 23:50:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-execute-Update-query-with-where-clause-and-select/m-p/2318494#M88828</guid>
      <dc:creator>Ramaraju2</dc:creator>
      <dc:date>2021-01-21T23:50:58Z</dc:date>
    </item>
  </channel>
</rss>

