Problem with IF ... THEN .... END IF statement

Jerry

Member
I have a PLSQL Package that contains about 30 related procedures and functions.

my problem arrises with the following example:

IF X >= Y THEN
Z := Z + 1;
END IF;

the Z := Z + 1; is always executed.

if i program it it as follows it works as expected.

IF X >= Y THEN
Z := Z + 1;
ELSE
A := A;
END IF;

is this a problem with the DEBUG function PL/SQL, a problem with ORACLE, or the size of my package? the package is approx. 210KB.

Thanks,

Jerry
 
This is probably the known Oracle error (Marco, you pointed this out some time ago, where is it). Have you put a watch on the variable Z and seen that it is incremented when it shouldn't, or are you just seeing the debugger 'seem' to execute that line?
 
This is a known Oracle Server bug (bug# 2276832). For if-then-else constructs it sometimes reports incorrect execution line numbers. The actual execution is okay though, but it is confusing.
 
Back
Top