I have a Stored procedure which takes 2 input parameter and 6 out. One of the out parameter returns more than one record. Is there any way to declare it as an array hence I don't have to declare a cursor. Here is the code,
CREATE OR REPLACE PROCEDURE SP_GET_USER_DETAILS
(
P_ID IN OUT VARCHAR2
, P_USER_NAME IN OUT VARCHAR2
, P_USER_TYPE OUT VARCHAR2
, P_EMPLOYEE_ID OUT VARCHAR2
, P_LICENSE_NO OUT VARCHAR2
, P_PHONE_NO OUT VARCHAR2
) IS
BEGIN
SELECT ACCT.ID, ACCT.USERNAME, ACCT.EMPLOYEE_ID, ACCT.LICENSE_NO,
ADDRESS.PHONE_NO INTO P_ID, P_USER_NAME, P_EMPLOYEE_ID, P_LICENSE_NO, P_PHONE_NO
FROM PROVIDER_ACCT ACCT
LEFT OUTER JOIN EMP_ADDRESS ADDRESS ON ACCT.ID=ACCT.ID
END SP_GET_PRISON_USER_DETAILS;
The problem is ADDRESS.PHONE_NO alone returns multiple rows. Is there any way to declare it as an array and get this working ? Thanks in advance.
If its not possible, could you please explain how to do it using a ref cursor ?