Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> PLS-06002: Unreachable code
I can see a number of people have hit PLS-06002: Unreachable code but
even though I've read those posts I cannot see a way through this.
When I compile the following procedure (with default options) I get:
Errors for PACKAGE BODY xxx:
LINE/COL ERROR
When I set alter session set PLSQL_OPTIMIZE_LEVEL=0; it makes no
difference.
When I set ALTER SESSION SET PLSQL_WARNINGS='DISABLE:PERFORMANCE'; it
goes away but I'd rather find the solution. I've reduced the offending
procedure to this:
PROCEDURE xxx (
x varchar2) as
l_idx pls_integer;
mbid varchar2(50);
mb_list varchar2(1000);
BEGIN
mb_list := x; LOOP l_idx := instr(mb_list, ','); IF (l_idx <> 0) THEN mbid := substr(mb_list,1,l_idx-1); mb_list := substr(mb_list,l_idx+1); ELSE mbid := mb_list; END IF; dbms_output.put_line(mbid); IF l_idx = 0 THEN EXIT; END IF; END LOOP;
a
b
c
so it appears it works - so why the PLS-06002? and why does it error?
This is 10.2.0 XE on linux.
Martin Received on Tue Oct 24 2006 - 14:03:36 CDT