Debugger error

j.bencze

Member
When debugging an implicit cursor loop in a test window some steps are shown erroneously.
Ex.
DECLARE
i PLS_INTEGER := 0;
BEGIN
FOR sor IN (SELECT 1 FROM DUAL
UNION
SELECT 2 FROM DUAL) LOOP
IF i = 0 THEN
DBMS_OUTPUT.PUT_LINE('A') ;
ELSE
DBMS_OUTPUT.PUT_LINE('B') ;
i := i +1;
END IF;
END LOOP;
DBMS_OUTPUT.PUT_LINE('i='||i);
END;

The debugger - before taking the the next value and before leaving the loop - stops on the i := i +1; statement, without executing it.

It seems the debugger allways stops on the last statement in the loop before moving on to the correct statement.
 
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.

I tried this on Oracle10g and it works okay.
 
Thanks Marco, but the error appears even if I don't use an if-then-else construct:
Ex.
DECLARE
i PLS_INTEGER := 0;
BEGIN
FOR sor IN (SELECT 1 FROM DUAL WHERE 1 = 0) LOOP
DBMS_OUTPUT.PUT_LINE('1') ;
DBMS_OUTPUT.PUT_LINE('2') ;
i := i +1;
END LOOP;
i := i + 1;
DBMS_OUTPUT.PUT_LINE('i='||i) ;
END;
 
Back
Top