Is this a bug in SQL Anywhere 17.0.9 create or replace database variable testvar bit default 0; create or replace function testvar() returns bit begin if testvar = 1 then return(1); else return(0); end if; end; set testvar = 1; select testvar; select testvar();--why this delivers 0? |
Odd, seems to be a bug with 17.0.11.6800, too.
The behaviour is as expected when the database variable is qualified within the function:
It seems to affect a connection-level variable in version 16 as well.