CREATE OR REPLACE TYPE membership_type AS OBJECT (
       country VARCHAR2(4),
       type VARCHAR2(60) );
/
CREATE OR REPLACE TYPE memberships_type AS TABLE OF membership_type;
/
CREATE OR REPLACE FUNCTION members_of(org VARCHAR2)
RETURN memberships_type
IS
  toreturn memberships_type;
BEGIN
  SELECT membership_type(country, type)
    BULK COLLECT INTO toreturn
    FROM ismember
    WHERE organization = org;
  RETURN toreturn;
END;
/
SELECT country, type
FROM TABLE(SELECT members_of('EU') FROM DUAL);
