SQLite Forum

CASE WHEN False THEN MyFunction() END calls MyFunction
Login
I've created a small experiment.

Here is the sql-code:
select 'Test and set flag 1';
select fs(1); -- is flag 1 set? O = clear 1 = set
select case sf(1)
when 0 then 'Failed to set flag 1!'
when 1 then 'Success! Flag  1 is set'
end; -- set flag 1

select case 1
when fsc(1) THEN "Flag 1 set and cleared"
when fc(1) THEN "Flag 1 is clear"
end  as 'flag status?';

-- clear flag 1
select case fc(1);

select case 1
when fsc(1) THEN "Flag 1 is set and cleared"
when fc(1) THEN "Flag 1 is clear"
end  as 'flag status?';

And this is the result:

Test and set flag 1

Success! Flag  1 is set

Flag 1 set and cleared

Flag 1 is clear

It seems to me that this is deterministic.