Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: PLS-06002: Unreachable code

Re: PLS-06002: Unreachable code

From: Andy Hassall <andy_at_andyh.co.uk>
Date: Tue, 24 Oct 2006 20:35:54 +0100
Message-ID: <tdqsj25kikj9rru8a6tmjjk7aeh6t519hv@4ax.com>


On 24 Oct 2006 12:03:36 -0700, "Martin" <martin.j.evans_at_gmail.com> wrote:

>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
>--------
>-----------------------------------------------------------------
>nnn/13 PLS-06002: Unreachable code
>
>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:

[snip]
> IF l_idx = 0 THEN
> EXIT;
> END IF;
>
>When I compile it with ALTER SESSION SET
>PLSQL_WARNINGS='DISABLE:PERFORMANCE'; and run it with an argument of
>'a,b,c' I correctly get the output:

[snip]
>so it appears it works - so why the PLS-06002? and why does it error?
>
>This is 10.2.0 XE on linux.

 I'm tempted to call "Oracle bug" here, particularly since it doesn't show a warning if you replace the conditional with the equivalent:

 EXIT WHEN l_idx = 0;

-- 
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Received on Tue Oct 24 2006 - 14:35:54 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US