Anybody guide me?
I have had a procedure as follow.
PROCEDURE P_Cache_AllFriends(
p_MEMBER_ID IN NUMBER,
p_curResult OUT SYS_REFCURSOR
) AS
BEGIN
OPEN p_curResult FOR
SELECT YF.FRIEND_ID
FROM FRIENDS YF
WHERE YF.MEMBER_ID = p_MEMBER_ID;
END P_Cache_AllFriends;
This procedure was called in php code. So I can change it. Now I want to write a query to get all subjects of all friends of a member with the list of friend identifiers are returned from the above procedure. Could I write the query like that?
DECLARE
p_curFriend SYS_REFCURSOR;
p_curSubject SYS_REFCURSOR;
BEGIN
P_Cache_AllFriends(
p_MEMBER_ID => 123456,
p_curResult => p_curFriend
);
OPEN p_curSubject FOR
SELECT *
FROM SUBJECTS
WHERE MEMBER_ID IN (....<p_curFriend>....)
END;