<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Simple update into a database using the Query Database smart service</title><link>https://community.appian.com/discussions/f/data/13511/simple-update-into-a-database-using-the-query-database-smart-service</link><description>Dear all, 
 I would like to make a quick update to just one database column and trying to use the Write to Database smart service, I am required to populate all the other fields. Because I do not need to start getting all the other fields just so I can</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Simple update into a database using the Query Database smart service</title><link>https://community.appian.com/thread/61479?ContentTypeID=1</link><pubDate>Thu, 11 Oct 2018 15:56:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:157dafdb-69ee-4826-a97d-83f3e151c02d</guid><dc:creator>susana197</dc:creator><description>Thanks a lot Simple,&lt;br /&gt;
&lt;br /&gt;
This was just what I needed.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple update into a database using the Query Database smart service</title><link>https://community.appian.com/thread/61369?ContentTypeID=1</link><pubDate>Tue, 09 Oct 2018 10:25:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:69ae0adf-04cc-4ecc-930a-305da8c02c38</guid><dc:creator>Farnaz</dc:creator><description>Hi Susan,&lt;br /&gt;
&lt;br /&gt;
While updating a column in DB, you need the Where Clause.&lt;br /&gt;
&lt;br /&gt;
The same need not be replicated in Appian Concept.&lt;br /&gt;
&lt;br /&gt;
If the pv!currentRequest .id =30, and the rest of the columns hold the appropriate value, this implies that the row where id = 30 should be updated, no need to specify the where clause.&lt;br /&gt;
&lt;br /&gt;
Hope this answers your query!!&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Farnaz&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple update into a database using the Query Database smart service</title><link>https://community.appian.com/thread/61368?ContentTypeID=1</link><pubDate>Tue, 09 Oct 2018 10:19:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5b335b64-e932-4c95-b9d7-92e702d8a490</guid><dc:creator>susana197</dc:creator><description>Thank you guys so much for your kind guides.  &lt;br /&gt;
&lt;br /&gt;
I will go ahead and use the Write to Data Store Entity Smart Service.  However, I am do not believe I&amp;#39;ve understand your instructions as to how to include my WHERE (using SQL thinking).  For example, I have a table as follows:&lt;br /&gt;
&lt;br /&gt;
Table_Requests&lt;br /&gt;
-----------------------&lt;br /&gt;
id - int, autoincrement , primary key&lt;br /&gt;
amount - decimal&lt;br /&gt;
requestDate - datetime&lt;br /&gt;
employee - text&lt;br /&gt;
&lt;br /&gt;
Supposing I want to update a specific row where id is equal to 30 (WHERE id = 30) with values {amount: 2345, requestDate: now(), employee: logginuser()}&lt;br /&gt;
&lt;br /&gt;
I can set this up in the input node of the Write to Data Store Entity Smart Service. BUT I cannot see were to set the id to pv!currentRequest (I already have a process variable with the value of the id WHERE or which row to update).&lt;br /&gt;
&lt;br /&gt;
If someone knows how to set the condition for the row to update in the input or output node of the Write to Data Store Smart Service, please can you show me using a screenshot when you have the chance?&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple update into a database using the Query Database smart service</title><link>https://community.appian.com/thread/61365?ContentTypeID=1</link><pubDate>Tue, 09 Oct 2018 09:52:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:46bacd4f-a0d1-4117-af99-fb473590aa4e</guid><dc:creator>Farnaz</dc:creator><description>&lt;p&gt;Hi Susan,&lt;br /&gt; &lt;br /&gt; As other suggested, please follow the below steps&lt;br /&gt; &lt;br /&gt; (1) Use Write to Data Store Entity Smart Service instead of Query Database.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; (2) To update specific columns, please create a CDT and specify the &amp;lt;xsd:element&amp;gt; for those columns (not all). While creating this CDT, the primary key should not have anotation @GeneratedValue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;(3) Use this CDT in the Smart Service and map the columns values to the respective ac!variable. Also, map the primary key value. So the compiler will know that this is an update not an insert.&lt;br /&gt; &lt;br /&gt; Hope this helps!!!&lt;br /&gt; &lt;br /&gt; Thanks,&lt;br /&gt; Farnaz&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple update into a database using the Query Database smart service</title><link>https://community.appian.com/thread/61363?ContentTypeID=1</link><pubDate>Tue, 09 Oct 2018 07:38:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1686dfab-59c6-484e-9482-06f6414798cf</guid><dc:creator>simples533</dc:creator><description>&lt;p&gt;Hi Susana, &lt;br /&gt; &lt;br /&gt; Don&amp;#39;t create manually new Input under Data tab, When you add ac!variable_name in your query under setup tab -&amp;gt; Database Query, Appian automatically create input variable and you need to pass input value in it only.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; Other thing to keep in mind is Assignment tab, make sure you have selected Run as Whoever design Process.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/cfs-file/__key/communityserver-discussions-components-files/16/2845.Capture.PNG"&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/16/2845.Capture.PNG" alt=" " /&gt;&lt;/a&gt;&lt;br /&gt; &lt;br /&gt; Regards,&lt;br /&gt; Simple Shah&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple update into a database using the Query Database smart service</title><link>https://community.appian.com/thread/61361?ContentTypeID=1</link><pubDate>Tue, 09 Oct 2018 06:05:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4cf64a73-d531-4042-9e6c-11507f5df6f3</guid><dc:creator>Dastagiri Dudekula</dc:creator><description>&lt;p&gt;The Query Database smart service is &lt;strong&gt;used to &lt;span style="color:#ff0000;"&gt;retrieve&lt;/span&gt; information from an external database using a SQL query, &lt;span style="color:#ff0000;"&gt;and update or create&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;process variables&lt;/span&gt; using the query results&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;To&amp;nbsp;&lt;strong&gt;insert or &lt;span style="color:#ff0000;"&gt;update&lt;/span&gt;&lt;/strong&gt;&lt;span style="color:#ff0000;"&gt;&amp;nbsp;&lt;/span&gt;data, refer to&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/18.3/Write_to_Data_Store_Entity_Smart_Service.html"&gt;Write to Data Store Entity&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/18.3/Write_to_Multiple_Data_Store_Entities_Smart_Service.html"&gt;[Write to Multiple Data Store Entities&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple update into a database using the Query Database smart service</title><link>https://community.appian.com/thread/61350?ContentTypeID=1</link><pubDate>Mon, 08 Oct 2018 19:08:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7f6e6853-59fb-4bd0-89bd-affd5abcf114</guid><dc:creator>Bala</dc:creator><description>&lt;p&gt;Populate value for ~1.requestId using pv.&lt;/p&gt;
&lt;p&gt;&amp;quot;~1.&amp;quot; represents query name that you see in setup tab. Your &amp;quot;requestid&amp;quot; node input will not be used by Query Database smart service.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="/cfs-file/__key/communityserver-discussions-components-files/16/pastedimage1539025671914v1.png"&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/16/pastedimage1539025671914v1.png" alt=" " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple update into a database using the Query Database smart service</title><link>https://community.appian.com/thread/61349?ContentTypeID=1</link><pubDate>Mon, 08 Oct 2018 19:02:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:81e726cd-a552-4f75-9cfd-af148b4a02a8</guid><dc:creator>gianninol</dc:creator><description>Hello,&lt;br /&gt;
&lt;br /&gt;
It is actually possible to update only your single field with the Write to Database smart service. If you create a different CDT that references the same table, but that only has the primary key field and the field you wish to write to, you can use that to update only the single column. I believe that is the simplest solution to your problem.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>