I was investigating a mysterious problem which I now suspect may be a bug, as illustrated by the two simple stored functions below:-
create function getlv1() returns long varchar begin declare @lv long varchar; set @lv = @lv || 'a'; return @lv; end;
create function getlv2() returns long varchar begin declare @lv long varchar; declare @i integer; set @lv = @lv || 'a'; return @lv; end;
When I 'select getlv1()' in dbisql I receive an error message "Column '@lv' not found", but 'select getlv2()' works just fine. The only difference between the two definitions is the unused/unwanted declaration of the variable @i.
asked 11 Jul '13, 10:06
Thank you for reporting this problem.
You could work around the problem by using
declare @lv long varchar = NULL;
instead of the current declaration in the first function.
Why are you using @lv in the calculation? Using the variable provides no benefit for your calculation. Is there a different problem you are trying to solve?
answered 11 Jul '13, 10:49
Thank you for reporting this problem. I do believe that you have found a bug. We will investigate and provide a fix as needed.
answered 11 Jul '13, 10:20