title: Using .count in for loop
body: <p>I'm new to oracle. I've come across table functions. The code for the function is</p>
  
  <pre><code>CREATE TYPE t_tf_row AS OBJECT (
  id           NUMBER,
  description  VARCHAR2(50));
  
  CREATE TYPE t_tf_tab IS TABLE OF t_tf_row;
  
  CREATE OR REPLACE FUNCTION get_tab_tf (p_rows IN NUMBER) RETURN t_tf_tab AS
  l_tab  t_tf_tab := t_tf_tab();
  BEGIN
    FOR i IN 1 .. p_rows LOOP
      l_tab.extend;
      l_tab(l_tab.last) := t_tf_row(i, 'Description for ' || i);
  END LOOP;
  
  RETURN l_tab;
  END;
  </code></pre>
  
  <p>Now, I want to create a procedure which will update the table type using for loop.
  The code for the procedure is</p>
  
  <pre><code>create or replace procedure add_n_rows(n_rows in number) is
    l_tab t_tf_tab := t_tf_tab();
  begin
  
  for i in t_tf_tab.count .. t_tf_tab.count + n_rows
  loop
    l_tab.extend;
    l_tab(l_tab.last) := t_tf_row(i, 'Description for '|| i);
  
  end loop;
  end;
  </code></pre>
  
  <p>I'm getting error saying that COUNT should be declared.</p>
  
  <pre><code>ORA-06550: line 1, column 37:
  PLS-00302: component 'COUNT' must be declared
  ORA-06550: line 1, column 7:
  PL/SQL: Statement ignored
  </code></pre>
  
  <p>Could you help me out in using the right procedure for .count in for loop.Thanks</p>