SQLite Forum

CASE WHEN False THEN MyFunction() END calls MyFunction
Login
Does ths answer imply a guarantee of the order of evaluation of a CASE expression?

For example if I write

`CASE WHEN MyFunction(1) THEN 'one' WHEN MyFunction(2) THEN 'two' ELSE 'neither' END`

is it guaranteed that if the SQLITE_DETERMINISTIC flag is not set and MyFunction (1) returns true, then MyFunction(2) will not be called?

MyFunction() has side-effects, and I can't use two separate statements because the CASE expression is inside an UPDATE statement over a whole table.