Vantiq does not support this kind of update syntax currently in VAIL so you have to do a SELECT ONE, followed by the UPDATE, like this:
var current = SELECT EXACTLY ONE FROM order_detail where id == 123
UPDATE order_detail(amount: current.amount + 100) where id == 123
It’s worth pointing out that if you had to do this to several records you can use streaming syntax.
SELECT ONE FROM order_detail AS item where <SOME CLAUSE>{
var amount = item.amount + 100
UPDATE order_detail(amount:amount) where id == item.id
}
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Hi all,
When we use SQL, we can sometimes use a statement like this:
UPDATE order_detail SET amount = amount + 100 WHERE id = 123
In VANTIQ, is there any similar way to do this?
Thanks.