Subtract on SQL

Hello!

So I want to subtract a value from my database field using the Database Update from Wappler.

The problem is that I need to get the field value to be subtract from a Database Query and substract it with the value I posted on my form.

Here is how I developed it on the Update Database form:

I beleive I cant use any operator on the SQL script.

I thought of first getting the value from my server side to my client side and then post the subtraction directly to the update action, but is a Stock value I’ll be updating, so I believe that subtracting directly the actual stock would be more secure, as the stock could change if someone else buys a product while other is doing the same action (the stock would be altered by the first person and by the time the second person posts the form, the stock number won’t be the same)

Sorry for my English, I redacted it the best I could, hope I made myself clear.

Community Page
Last updated: