title: Oracle error ORA-22905: cannot access rows from a non-nested table item
body: <p>here's the stored procedure i wrote.In this proc "p_subjectid" is an array of numbers passed from the front end.</p>
  
  <pre><code>PROCEDURE getsubjects(p_subjectid subjectid_tab,p_subjects out refCursor) 
         as
  
         BEGIN
  
              open p_subjects for select * from empsubject where subject_id in
              (select column_value from table(p_subjectid));
              --select * from table(cast(p_subjectid as packg.subjectid_tab))
        END getsubjects;
  </code></pre>
  
  <p>This is the error i am getting.</p>
  
  <pre><code>Oracle error ORA-22905: cannot access rows from a non-nested table item OR
  </code></pre>
  
  <p>as i have seen in different post,i tried casting "cast(p_subjectid as packg.subjectid_tab)" inside table function as given in the comment below.But i am getting another error: <code>ORA-00902: invalid datatype</code>.</p>
  
  <p>And this is the definition of the "subjectid_tab".</p>
  
  <pre><code>type subjectid_tab is table of number index by binary_integer;
  </code></pre>
  
  <p>Can anyone please tell me what's the error.Is anything wrong with the my procedure.</p>