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

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL help needed

Re: PL/SQL help needed

From: Vitalis <vitalisREMOVETHAT_at_numericable.fr>
Date: Sun, 3 Apr 2005 13:19:32 +0200
Message-ID: <424fd14d$0$17273$636a15ce@news.free.fr>

"BSI" <BSI_at_home.com> a écrit dans le message de news: Xns962B7141CFEF2BSIhomecom_at_140.99.99.130...
> Hi there,
>
> I have a problem and hope somebody may be able to help. Compiling the
> following code, i get "PLS-00363: expression 'SELF' cannot be used as an
> assignment target." Since i'm new to PL/SQL, I believe i must be missing
> something fundamentally wrong in calling methods. I've looked over the
> documentation, but couldn't find a solution.
>
> If it matters at all, I'm using Oracle Database 9.2
>
>
>
> CREATE OR REPLACE TYPE Proc AS OBJECT (
> anAttribute NUMBER,
>
> MEMBER FUNCTION FindBLY(aIndex OUT NUMBER, aStartIndex IN NUMBER)
> RETURN NUMBER,
> MEMBER PROCEDURE PrepareSegment(aIndex IN NUMBER)
>
> )
> /
> SHOW ERRORS;
>
> CREATE OR REPLACE TYPE BODY Proc
> AS
>
> MEMBER FUNCTION FindBLY(aIndex OUT NUMBER, aStartIndex IN NUMBER)
> RETURN NUMBER
> IS
> aValue NUMBER;
> BEGIN
>
> PrepareSegment( aValue );
> RETURN aValue;
>
> END;
>
> MEMBER PROCEDURE PrepareSegment( aIndex IN NUMBER )
> IS
> ycoord NUMBER;
> BEGIN
>
> --ycoord := FindBLY(ycoord, 1);
> DBMS_OUTPUT.PUT_LINE('aIndex is: ' || aIndex);
>
> END;
>
> END;
> /
> SHOW ERRORS;
>
>
> Please help :)
>
> Thanks.

Hi,

The error is due to the fact that in procedures, the parameter mode of SELF defaults to IN OUT.
So to correct your code, change both related lines to:   MEMBER PROCEDURE PrepareSegment(self in proc, aIndex IN NUMBER)

HTH
Jerome Received on Sun Apr 03 2005 - 06:19:32 CDT

Original text of this message

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