jabarreras
Member²
Try this function:
create or replace function ppp return integer is
a integer;
begin
if true then
a:=0;
if true then
a:=1;
if true then
a:=2;
else
a:=3;
end if;
else
a:=4;
end if;
else
a:=5;
end if;
return(a);
end ppp;
The return value will be 2, and that's right, but if you follow with debugger the execution flow, you will see that the execution line goes through a:=3 and a:=4 and a:=5 although the return value is 2. If you write every if-else-end if like in Delphi:
if cond
begin
sentence
end else
begin
sentence
end
the execution flow it's correct, but you multiply by 3 the number of program lines.
Am I right?,
Is anything I am doing wrong?
create or replace function ppp return integer is
a integer;
begin
if true then
a:=0;
if true then
a:=1;
if true then
a:=2;
else
a:=3;
end if;
else
a:=4;
end if;
else
a:=5;
end if;
return(a);
end ppp;
The return value will be 2, and that's right, but if you follow with debugger the execution flow, you will see that the execution line goes through a:=3 and a:=4 and a:=5 although the return value is 2. If you write every if-else-end if like in Delphi:
if cond
begin
sentence
end else
begin
sentence
end
the execution flow it's correct, but you multiply by 3 the number of program lines.
Am I right?,
Is anything I am doing wrong?