Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Want to test my MAP function

Want to test my MAP function

From: James <Jimbo_at_yahoo.com>
Date: Fri, 21 Nov 2003 18:53:27 +0000 (UTC)
Message-ID: <bplmv7$eva$1@titan.btinternet.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US