title: PL/SQL FIRST LAST EXISTS - (cannot show table contents)
body: <p>First, I have read the PL/SQL documentation repeatedly, no help.  Second, I have googled for hours (usually being led here) and still cannot figure this out. </p>
  
  <p>I have created an index table, which seems to have been successful - at least it did not throw any errors...</p>
  
  <pre><code>DECLARE
  CURSOR cur_emps IS
    SELECT employee_id, last_name, job_id, salary FROM employees ORDER BY employee_id;
    TYPE t_emp_rec IS TABLE OF cur_emps%ROWTYPE
    INDEX BY BINARY_INTEGER;
    v_emp_rec_tab  t_emp_rec;
  BEGIN
    FOR emp_rec IN cur_emps LOOP
      v_emp_rec_tab(emp_rec.employee_id) := emp_rec;
    END LOOP;
  </code></pre>
  
  <p>However, when I try to show what is in my index table.  I fail...</p>
  
  <p>Documentation says do something like this...</p>
  
  <pre><code>DECLARE
    CURSOR cur_emps IS
      SELECT employee_id, last_name, job_id, salary FROM employees ORDER BY employee_id;
    TYPE t_emp_rec IS TABLE OF cur_emps%ROWTYPE
    INDEX BY BINARY_INTEGER;
    v_emp_rec_tab  t_emp_rec;
  BEGIN
    FOR emp_rec IN cur_emps LOOP
      v_emp_rec_tab(emp_rec.employee_id) := emp_rec;
    END LOOP;
    FOR i IN v_emp_rec_tab.FIRST..v_emp_rec_tab.LAST LOOP
      IF v_emp_rec_tab.EXISTS(i)
        THEN DBMS_OUTPUT.PUT_LINE(v_emp_rec_tab(i));
      END IF;
    END LOOP;
  END;
  </code></pre>
  
  <p>... which gives me this...</p>
  
  <p>ORA-06550: line 13, column 12:
  PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
  ORA-06550: line 13, column 12:
  PL/SQL: Statement ignored</p>
  
  <p>In place of </p>
  
  <pre><code>THEN DBMS_OUTPUT.PUT_LINE(v_emp_rec_tab(i));
  </code></pre>
  
  <p>. I have tried 
  emp_rec.last_name, v_emp_rec.last_name, cur_emps.last name</p>
  
  <p>... it has been days now trying, can anyone help?</p>
  
  <p>Thanks.
  Daniel</p>