Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Change value of variable in object type

629759Aug 24 2010 — edited Aug 25 2010
Hi to all!

I created an object using:

CREATE OR REPLACE TYPE some_object AS OBJECT
(
some_information NUMBER,
MEMBER FUNCTION some_function RETURN NUMBER
)

and when I tried to implement member function "some_function" that need to change value of variable "some_information" like:

CREATE OR REPLACE TYPE BODY some_object AS

MEMBER FUNCTION some_function RETURN NUMBER IS
BEGIN
some_information := some_information + 5;
RETURN some_information;
END;

END;

It gives me following error:


Compilation errors for TYPE BODY CMS.SOME_OBJECT

Error: PLS-00363: expression 'SELF.SOME_INFORMATION' cannot be used as an assignment target
Line: 5
Text: some_information := some_information + 5;

The question is:

How to implement my function that can change value of "some_information" ?
This post has been answered by Billy Verreynne on Aug 25 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 22 2010
Added on Aug 24 2010
4 comments
708 views