title: Explicit cursor passing table as parameter PLS-00382
body: <p>I have a function with table of UDT type as in parameter. The objective of the function is to return a JSON clob to the calling environment. Unfortunately package body is compiled with an error:</p>
  
  <blockquote>
    <p>Compilation errors for PACKAGE BODY JOHN.packageA   #13#10Error:
    PLS-00382: expression is of wrong type Line: 8 Text: from persons
    where id member of v_ids;</p>
  </blockquote>
  
  <p>Is it not possible to use the member of operator with associative arrays? What different approach should i take?</p>
  
  <pre><code>CREATE OR REPLACE Package packageA As
  
     TYPE ids_tbl is Table of Number(10) INDEX BY PLS_INTEGER;   
  
     function get_people_json (p_custIds in ids_tbl) return clob;
  
  End;
  
  CREATE OR REPLACE Package Body PackageA As
  
    function get_people_json (p_custIds in ids_tbl) 
      return clob
  
      is
  
      cursor people_cur(v_ids ids_tbl) select * from persons where id member of v_ids;
  
      TYPE people_aat IS TABLE OF people_cur%ROWTYPE
      INDEX BY PLS_INTEGER;
  
  
  
      ....
  
      Begin
  
        open people_cur(p_custIds);
        ....
  
  
  
        return l_clob;
  
      End;
   End;
  </code></pre>
  
  <p>Regards
  Magnus</p>