PLS-00386: type mismatch found between FETCH cursor and INTO variables

前端 未结 2 1103
梦如初夏
梦如初夏 2021-01-14 21:30

The following package throws : PLS-00386: type mismatch found at \'V_STUDYTBL\' between FETCH cursor and INTO variables

Purpose of the code: Define

2条回答
  •  無奈伤痛
    2021-01-14 22:30

    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;
    

提交回复
热议问题