Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Member Funtion Error
I am using Oracle 9i on Windows XP.
I am trying to complete a tutorial for my Database class and have come
across an error which I can't get around. I enter the following code which
seems to work:
ALTER TYPE student_type REPLACE AS OBJECT
(FirstName varchar2(15),
LastName varchar2(15),
Address address_type,
Contact contact_type,
DateOfBirth date,
Nationality varchar2(15),
AttendanceMode varchar2(15),
StudentNo varchar2(15),
Userid varchar(15),
FeeStatus varchar2(25),
MEMBER FUNCTION getName RETURN varchar2,
PRAGMA RESTRICT_REFERENCES (getName, WNDS, WNPS, RNDS, RNPS)
)
/
It produces the result "Type altered."
Then I enter the following code to implement my member function: CREATE TYPE BODY student_type IS
MEMBER FUNCTION getName RETURN VARCHAR2 IS
BEGIN
RETURN (FirstName || '' || LastName);
END;
/
(not sure if I should have the "/" at the end but thats the only way I can
get it to run)
and I recieve the following error message: CREATE TYPE BODY student_type IS
*
I know I already have an object type named student_type but have been given the code to implement my member function by my teacher and assumed it would work.
Any suggestions?
Thanks in advance.
James
Received on Sat Nov 15 2003 - 13:39:57 CST
![]() |
![]() |