<?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>question Re: Can't run Merge query to update or insert SQL Server table in PUTSQL in NiFi in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Can-t-run-Merge-query-to-update-or-insert-SQL-Server-table/m-p/377295#M243209</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/106948"&gt;@LKB&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Can you share screenshots of your UpdateAttribute processor configuration?&lt;BR /&gt;Are you using the advanced UI of the UpdateAttribute processor?&lt;BR /&gt;&lt;BR /&gt;The &lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-update-attribute-nar/1.23.2/org.apache.nifi.processors.attributes.UpdateAttribute/index.html" target="_self"&gt;UpdateAttribute&lt;/A&gt; processor is fairly simplistic in design. Without configuring the advanced UI, it simply can remove attributes or create/modify existing attributes.&amp;nbsp; Each Attribute is defined by key:value pairs where the property name is the key and property value is the key.&amp;nbsp; The Advanced UI allows for conditionally based attribute additions or modifications.&lt;/P&gt;&lt;P&gt;If you found any of the suggestions/solutions provided helped you with your issue, please take a moment to login and click "&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Accept as Solution&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;" on one or more of them that helped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;BR /&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Oct 2023 15:02:35 GMT</pubDate>
    <dc:creator>MattWho</dc:creator>
    <dc:date>2023-10-05T15:02:35Z</dc:date>
    <item>
      <title>Can't run Merge query to update or insert SQL Server table in PUTSQL in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Can-t-run-Merge-query-to-update-or-insert-SQL-Server-table/m-p/377205#M243180</link>
      <description>&lt;P&gt;I am trying to run a merge query in PUTSQL after using ExecuteSQL to pull from source database. I then pass the results through ConvertAvrotoJSON and then to&amp;nbsp;convertJSONToSQL (set to INSERT since there is no UPSERT for SQL server database). I want to now run the merge query to update if the primary key is matched or insert if not, but I have been getting all sorts of errors&lt;/P&gt;&lt;P&gt;Input flowfile has the following attributes&lt;/P&gt;&lt;P&gt;sql.args.1.type&lt;BR /&gt;12&lt;BR /&gt;sql.args.1.value&lt;BR /&gt;A-001&lt;BR /&gt;sql.args.2.type&lt;BR /&gt;12&lt;BR /&gt;sql.args.2.value&lt;BR /&gt;DDD&lt;BR /&gt;sql.args.3.type&lt;BR /&gt;12&lt;BR /&gt;sql.args.3.value&lt;BR /&gt;2B&lt;BR /&gt;sql.args.4.type&lt;BR /&gt;12&lt;BR /&gt;sql.args.4.value&lt;BR /&gt;AAA&lt;BR /&gt;sql.args.5.type&lt;BR /&gt;12&lt;BR /&gt;sql.args.5.value&lt;BR /&gt;2B&lt;BR /&gt;sql.args.6.type&lt;BR /&gt;12&lt;BR /&gt;sql.args.6.value&lt;BR /&gt;BBB&lt;BR /&gt;sql.args.7.type&lt;BR /&gt;93&lt;BR /&gt;sql.args.7.value&lt;BR /&gt;1954-08-01 22:46:50.73&lt;BR /&gt;sql.catalog&lt;BR /&gt;CUSDB&lt;BR /&gt;sql.table&lt;BR /&gt;CUSTOMERS&lt;BR /&gt;uuid&lt;BR /&gt;50a3daf9-e5d8-422b-b6cb-9c92da723c55&lt;/P&gt;&lt;P&gt;I created the following attributes in UpdateAtributes&lt;/P&gt;&lt;P&gt;I directed this flowfile to UpdateAttribute where I created above properties like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;sql.args.1.type = 12;&amp;nbsp;&amp;nbsp;sql.args.1.value = ${vkey}&lt;/P&gt;&lt;P&gt;sql.args.2.type = 12;&amp;nbsp;&amp;nbsp;sql.args.2.value = ${AP}&lt;/P&gt;&lt;P&gt;sql.args.3.type = 12;&amp;nbsp;&amp;nbsp;sql.args.3.value = ${BP}&lt;/P&gt;&lt;P&gt;........&lt;/P&gt;&lt;P&gt;sql.args.7.type = 93;&amp;nbsp;&amp;nbsp;sql.args.7.value = ${LAST_MOD_DATE}&lt;/P&gt;&lt;P&gt;But when I check the results of the queue of the UpdateAtributes, I see that&amp;nbsp;sql.args.1.type,&amp;nbsp;sql.args.2.type, ...&amp;nbsp;sql.args.7.type return blank values. I am doing something wrong in the way I have defined those properties?&lt;/P&gt;&lt;P&gt;Merge query in PutSQL looks like this&lt;/P&gt;&lt;P&gt;MERGE INTO CUSDB.dbo.CUSTOMERS as t&lt;BR /&gt;USING (select ? as vkey, ? as ap, ? as bp, ? as lm, ? as lnum, ? as wn, ? as LAST_MOD_DATE) s&lt;BR /&gt;ON t.EKEY = s.EKEY&lt;BR /&gt;WHEN MATCHED THEN&lt;BR /&gt;UPDATE SET&lt;BR /&gt;t.ap = s.ap,&lt;BR /&gt;t.bp = s.bp,&lt;BR /&gt;t.lm = s.lm,&lt;BR /&gt;t.lnum = s.lnum,&lt;BR /&gt;t.wn = s.wn,&lt;BR /&gt;t.LAST_MOD_DATE = s.LAST_MOD_DATE&lt;BR /&gt;WHEN NOT MATCHED THEN&lt;BR /&gt;INSERT (vkey, ap, bp, lm, lnum, wn, LAST_MOD_DATE) VALUES (?, ?, ?, ?, ?, ?, to_date(?, 'YYYY-MM-DD HH34:MI:SS'))&lt;/P&gt;&lt;P&gt;I get the error that all parameters are blank. Can someone please point me in the direction to resolve this issue. Why are the attributes going blank when I set them in UpdateAttributes?&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 02:18:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Can-t-run-Merge-query-to-update-or-insert-SQL-Server-table/m-p/377205#M243180</guid>
      <dc:creator>LKB</dc:creator>
      <dc:date>2023-10-04T02:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can't run Merge query to update or insert SQL Server table in PUTSQL in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Can-t-run-Merge-query-to-update-or-insert-SQL-Server-table/m-p/377295#M243209</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/106948"&gt;@LKB&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Can you share screenshots of your UpdateAttribute processor configuration?&lt;BR /&gt;Are you using the advanced UI of the UpdateAttribute processor?&lt;BR /&gt;&lt;BR /&gt;The &lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-update-attribute-nar/1.23.2/org.apache.nifi.processors.attributes.UpdateAttribute/index.html" target="_self"&gt;UpdateAttribute&lt;/A&gt; processor is fairly simplistic in design. Without configuring the advanced UI, it simply can remove attributes or create/modify existing attributes.&amp;nbsp; Each Attribute is defined by key:value pairs where the property name is the key and property value is the key.&amp;nbsp; The Advanced UI allows for conditionally based attribute additions or modifications.&lt;/P&gt;&lt;P&gt;If you found any of the suggestions/solutions provided helped you with your issue, please take a moment to login and click "&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Accept as Solution&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;" on one or more of them that helped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;BR /&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 15:02:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Can-t-run-Merge-query-to-update-or-insert-SQL-Server-table/m-p/377295#M243209</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2023-10-05T15:02:35Z</dc:date>
    </item>
  </channel>
</rss>

