title: Returning TABLE type from Procedure
body: <p>I was testing this code to return a TABLE type from a procedure,  but I am getting an error which I believe should not happen as I am taking table type of the entire row of employees table.  </p>
  
  <pre><code>CREATE OR REPLACE PACKAGE test_pkg
  IS
  
    TYPE my_rec IS TABLE OF employees%ROWTYPE;
  
    PROCEDURE my_proc(p_out OUT my_rec);
  
  END;
  /
  
  CREATE OR REPLACE PACKAGE BODY test_pkg
  AS
  
    PROCEDURE my_proc(p_out OUT my_rec) AS BEGIN
  
        SELECT
          employee_id,
          first_name,
          last_name BULK COLLECT INTO p_out
        FROM employees;
      END;
  
  END;
  /
  </code></pre>
  
  <blockquote>
    <p>6/65           PL/SQL: ORA-00913: too many values 6/1<br>
    PL/SQL: SQL Statement ignored</p>
  </blockquote>
  
  <p>Also what's the advantage and disadvantages of using TABLE type over REF CURSOR to return value from a procedure ?</p>