title: How do I display a nested table in Oracle - PL/SQL?
body: <p>I have an assignment where I'm supposed to create a user-defined function that will return all employees after 1968. My code is as follows:</p>
  
  <p>First I create a new object, called emp_dobs, to hold the employees' firstname, lastname, and date of birth, using the same data types as the original employee table:</p>
  
  <pre><code>CREATE OR REPLACE TYPE emp_dobs AS OBJECT (
      emp_fname VARCHAR2(20),
      emp_lname VARCHAR2(20),
      emp_dob DATE
  );
  /
  </code></pre>
  
  <p>Then I create emp_dobs_nested as a table of emp_dobs:</p>
  
  <pre><code>CREATE OR REPLACE TYPE emp_dobs_nested AS TABLE OF emp_dobs;
  /
  </code></pre>
  
  <p>Lastly, I create a function that's supposed to return an emp_dobs_nested table:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION get_emp_dobs RETURN emp_dobs_nested
  AS 
      dobs emp_dobs_nested;
  BEGIN
      SELECT emp_dobs(firstname, lastname, birthdate) BULK COLLECT INTO dobs
      FROM employee
      WHERE birthdate &lt; TO_DATE('01-JAN-1968', 'DD-MON-YYYY');
      RETURN dobs;
  END;
  /
  </code></pre>
  
  <p>There is a weird quirk with compiling emp_dob_nested, however, where Oracle SQL Developer will display a new tab labeled "Output Variables - Log," and only show EMP_FNAME and EMP_LNAME. Despite that, everything compiles.</p>
  
  <p>Now I want to test the function and display its results to prove that it works, but when I try this:</p>
  
  <pre><code>DECLARE
      dobs emp_dobs_nested;
  BEGIN
      dobs := get_emp_dobs;
      DBMS_OUTPUT.PUT_LINE(dobs);
  END;
  /
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>Error report -
  ORA-06550: line 5, column 5:
  PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
  ORA-06550: line 5, column 5:
  PL/SQL: Statement ignored
  06550. 00000 -  "line %s, column %s:\n%s"
  *Cause:    Usually a PL/SQL compilation error.
  *Action:
  </code></pre>
  
  <p>What am I missing here? Thanks.</p>