Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Want to test my MAP function
I have created the following simple MAP function:
MAP MEMBER FUNCTION getLname RETURN VARCHAR2 IS
BEGIN
RETURN (LastName);
END;
but am not sure how to use it. Here is the type it was created for:
CREATE OR REPLACE TYPE student_type 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))
/
I have tried the following PL/SQL block but get the error described below:
declare
student_member student_type;
result varchar2(50);
begin
select value(s) into student_member
from student_table s;
result := student_member.getLname();
dbms_output.put_line(result);
end;
Error:
declare
*
ERROR at line 1:
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at line 5
Any help would be very much appreciated. Received on Fri Nov 21 2003 - 12:53:27 CST
![]() |
![]() |