Home » RDBMS Server » Server Administration » Problem with own type and procedure
Problem with own type and procedure [message #372723] Mon, 05 March 2001 10:03 Go to next message
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 #372734 is a reply to message #372723] Tue, 06 March 2001 10:14 Go to previous messageGo to next message
kavithask
Messages: 34
Registered: March 2001
Location: London
Member
Hi,

The code worked fine for me, when I removed the extra "end;" command from the Type Body creation. Just remove this and see if it works.

HTH
Kavitha
Re: Problem with own type and procedure [message #372759 is a reply to message #372734] Wed, 07 March 2001 05:53 Go to previous messageGo to next message
jean-luc buthod
Messages: 3
Registered: March 2001
Junior Member
Well, I don't understand why id doesn't work.
I have the following error when compiling the body type
PLS-00201: identifier 'SELF.NUMBERS' must be declared

Is that normal?
Do you have this error too?

Regards
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
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
Previous Topic: storing code file
Next Topic: Inefficient cursor
Goto Forum:
  


Current Time: Mon Jun 03 01:04:26 CDT 2024