Update Single row using REST API

Want to update single record in Rest Api Expose method, tried 2 methods first is update method (POST)  of entity and then tried with SQL Aggregate.

rest api.jpg

After Update Try adding commit transaction server action

Capture122.JPG

mvp_badge
MVP

Hi Priyanka,

The error message is self-explanatory. You use a variable mi which is not an input parameter to your advances SQL not is it a column name. If the name column needs to be filled with the text 'mi' then you need to enclose the text in single quotes.

Regards,

Daniel

hi Daniel 
I tried using following query. 
 
update {Product} set {Product}.[Name]='mi' where {Product}.[Id]=31
when I test the query it is showing Query returned no rows.
mvp_badge
MVP

Well that is correct, an update query does not return rows, it updates a record, in your case the record with Id 31, assuming that record exists.

mvp_badge
MVP

How do you call the SQL statement? It will not work from the SQL editor, those changes are not committed.

Hi Priyanka,


You can change the SQL query as shown below or you can make use of input variable which stores name value and use the variable value instead of passing "mi" text



update {product} set {product}.[Name] = "mi" where {Product}.[Id]=32


Regards,

Hidayat

Hi Hidayat 

I tried using following query. 
 
update {Product} set {Product}.[Name]='mi' where {Product}.[Id]=31
when I test the query it is showing Query returned no rows.

After Update Try adding commit transaction server action

Capture122.JPG

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.