title: can plsql function return object
body: <p>i have encountered a problem while writing the following code:</p>
  
  <pre><code>create or replace function getashish(dept varchar2) return emp3 as
  
  emp5 emp3;
  
  str varchar2(300);
  
  begin
  
  str := 'select e.last_name,l.city,e.salary from employees e join departments d 
  
  on e.department_id = d.department_id join locations l on d.location_id=l.location_id where 
  
  d.department_name = :dept';
  
  execute immediate str bulk collect into emp5  using dept;
  
  end;
  </code></pre>
  
  <p>emp 3 is table of an object as defined below:</p>
  
  <pre><code>create or replace type emp1 as object (lname varchar2(10),city varchar2(10),sal number(10));
  
  create or replace type emp3 as table of emp1;
  </code></pre>
  
  <p>i am getting the following error while executing the function: SQL Error:</p>
  
  <pre><code>ORA-00932: inconsistent datatypes: expected - got -
  </code></pre>
  
  <p>thank you for your anticipated help and support.</p>