Problem with own type and procedure [message #372723] |
Mon, 05 March 2001 10:03 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
jean-luc buthod
Messages: 3 Registered: March 2001
|
Junior Member |
|
|
Hi
Please see the following example and tell me why it can't compile; How shall I do to add a new number for a specified object....
-----------------------------------------
CREATE OR REPLACE TYPE numbers_tab AS TABLE OF NUMBER
/
CREATE OR REPLACE TYPE myTyp AS OBJECT (
numbers numbers_tab,
MEMBER PROCEDURE addNumber ( newNumber NUMBER )
)
/
CREATE OR REPLACE TYPE BODY myTyp AS
MEMBER PROCEDURE addNumber ( newNumber NUMBER ) IS
BEGIN
DECLARE
myNumbers numbers_tab;
BEGIN
INSERT INTO SELF.numbers VALUES (newNumber);
END;
END;
END;
/
show errors;
------------------------------------------
Error is
PLS-00201: identifier 'SELF.NUMBERS' must be declared
Thank you for your help
Jean-luc
|
|
|
|
|
Re: Problem with own type and procedure [message #372762 is a reply to message #372734] |
Wed, 07 March 2001 08:49 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
kavithask
Messages: 34 Registered: March 2001 Location: London
|
Member |
|
|
Hi,
I just copied your code and pasted it into SQL*Plus prompt of Oracle 8i environment and it executed just fine. I had no errors.
Try dropping all existing objects and copy the code and run the code one after another in SQL*Plus prompt.
HTH
Kavitha
|
|
|