Re: in out param and PLS-00204 error in pl/sql

From: Jusung Yang <jusungyang_at_yahoo.com>
Date: 4 Sep 2002 21:40:55 -0700
Message-ID: <42ffa8fa.0209042040.3959dcca_at_posting.google.com>


What version of ORACLE are you using? Seems to be OK in 9i as shown below. In any case, LEVEL is an ORACLE reserved word. Best not to use it for your variables or arguments.

SQL> CREATE OR REPLACE PROCEDURE explode1(level in out number, item   2 character) AS
  3 BEGIN
  4 level := level+1;
  5 DBMS_OUTPUT.PUT_LINE('level='|| level ||'item=' || item);   6 END;
  7 /

Procedure created.

SQL> declare
  2 inp number := 0;
  3 begin
  4 explode1(inp,'test');
  5 end;
  6 /
level=1item=test

PL/SQL procedure successfully completed.

nutron2000_at_yahoo.com (nutron) wrote in message news:<e4ed71f5.0209040748.748acca5_at_posting.google.com>...
> Can someone tell me why the following is wrong? i want to pass a
> numeric value to a procedure, modify it and read it back.
> --------------------------------------------
> set serveroutput on;
> set line 200;
>
> CREATE OR REPLACE PROCEDURE explode1(level in out number, item
> character) AS
>
> BEGIN
>
> level := level+1;
> DBMS_OUTPUT.PUT_LINE('level='|| level ||'item=' || item);
>
> END;
> /
> show errors
>
> declare
> inp number := 0;
> begin
> explode1(inp,'test');
> end;
> /
>
> Warning: Procedure created with compilation errors.
>
> Errors for PROCEDURE EXPLODE1:
>
> LINE/COL ERROR
> -------- -----------------------------------------------------------------
> 5/3 PL/SQL: Statement ignored
> 5/12 PLS-00204: function or pseudo-column 'LEVEL' may be used
> inside a
> SQL statement only
>
> 6/3 PL/SQL: Statement ignored
> 6/35 PLS-00204: function or pseudo-column 'LEVEL' may be used
> inside a
> SQL statement only
>
> -----------------------------------------------------------------------
> thanks in advance
> nutron
Received on Thu Sep 05 2002 - 06:40:55 CEST

Original text of this message