I need to be able to return from a procedure a list of values in the form of a cursor variable. But within the list some fields can have multiple values
e.g. a product can have multiple description lines in the description field (obtained from a different table).
I was thinking in line of creating a nested table within a record type and associate this to a cursor.
TYPE N_TYPE IS TABLE OF VARCHAR2(350);
TYPE TYPE1 IS RECORD ( FIELD_1 VARCHAR2(100)
, FIELD_2 VARCHAR2(30)
, FIELD_3 N_TYPE);
TYPE T_CUR IS REF CURSOR RETURN TYPE1;
Procedure p_proc (p_1 IN VARCHAR2, p_2 OUT t_cur) is
-- processing input parameter and passing out a cursor to host application
end p_proc;
Here within the procedure I will need to pass p_1 into a table and using a explicit cursor to retrieve the data into Field_1 and Field_2.
Then from another table I will need to assign multiple records into Field_3.
Can anyone show me how to populate data into a nested table when the table is part of a datatype within a record? And how do I check once it has been populated. And how to assign this back to a cursor variable for the out parameter?