The following package throws : PLS-00386: type mismatch found at \'V_STUDYTBL\' between FETCH cursor and INTO variables
Purpose of the code: Define
you'd need to use the object constructor on the select:
SELECT OBJTYP(A, B, C)
FROM my_table
WHERE Study_Number = p_StudyNum(i)
but you can simplify the procedure to this instead of all those loops:
begin
select cast(multiset(select /*+ cardinality(s, 10) */ a, b, c
from my_table t, table(p_StudyNum) s
where t.study_number = s.column_value) as OutputTyp)
into p_StdyDtl
from dual;
end;
Try declaring your cursor as:
CURSOR c_StudyTbl
IS
SELECT OBJTYP(A, B, C)
FROM my_table
WHERE Study_Number = p_StudyNum(i);