title: Oracle - subprogram or cursor c_tab is out of scope
body: <pre><code>create or replace procedure CV8_POCET_RADKU(p_schema VARCHAR2, p_razeni IN varchar2 default 'asc') as
  i_dotaz varchar2(200) := 'select count(*) from ';
  i_pocet number;  
  cursor c_tab is 
    select object_name
    from dba_objects where object_type = 'TABLE' 
    and owner = upper(p_schema) 
    order by object_name asc;
  
    i_tab c_tab%rowtype;
  begin 
  dbms_output.put_line('Tabulky ze schematu: ' ||p_schema);
  open c_tab;
  loop
    fetch c_tab into i_tab;
    exit when c_tab%notfound;
    execute immediate i_dotaz || p_schema||'.'||i_tab.object_name into i_pocet;
    dbms_output.put_line(c_tab.object_name || ' - '|| i_pocet || 'radku');
  end loop;
  close c_tab;
  end;
  </code></pre>
  
  <p>Oracle give me a error subprogram or cursor c_tab is out of scope. I think i have the cursor right.</p>