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

前端 未结 2 1085
梦如初夏
梦如初夏 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;
    
    0 讨论(0)
  • 2021-01-14 22:35

    Try declaring your cursor as:

    CURSOR c_StudyTbl
    IS
      SELECT OBJTYP(A, B, C)
        FROM my_table
        WHERE Study_Number = p_StudyNum(i);
    
    0 讨论(0)
提交回复
热议问题