Update Data on SQL View?

I was trying to get the App to be able to update a table with a SQL View as data source, however I got the following error when I tried to save the changes:

Incorrect usage of UPDATE and LIMIT

Not sure if I’ve missed something or if this is possible at all?

Thanks all.

Yes, it is possible to update data through a SQL view. There is probably something off about your SQL view - are you able to do data inserts through it outside of appsheet? You can also look at your database logs to see the queries appsheet is using to help you troubleshoot.

1 Like

I just checked the log it seems that query Appsheet tried to run is

UPDATE table SET column = ‘111122333’ WHERE Key = 'xxxx LIMIT

I tried removing the LIMIT and successfully ran the query from the client, wonder if there is any options that I can control this on Appsheet?

Also referring to this on MYSQL Documentation:

For multiple-table syntax, ORDER BY and LIMIT cannot be used.

https://dev.mysql.com/doc/refman/8.0/en/update.html

Nope.

Your SQL view seems to be aggregated or refererencing to the multiple tables, which make SQL view as read-only.
It is not a matter of AppSheet or not, generally you are not able to edit that particular view.

1 Like