CREATE OR REPLACE procedure interne_tabelle IS
--
-- füllt die interne Tabelle link_tab mit tname aus dem Cusor c_tab
-- und gibt die ganze Tabelle per dbms_output aus.
--
   TYPE link_type IS RECORD
      (
      lfd           NUMBER,
      table_name    VARCHAR2(30)
      );

   TYPE link_array IS TABLE OF link_type
        INDEX BY BINARY_INTEGER;
        
   link_table link_array;
   
   cursor c_tab is select tname from tab;

   i number;
   j number;
   v_tname tab.tname%type;
begin
   i := 0;
   open c_tab;
   fetch c_tab into v_tname;
   while c_tab%found 
   loop
     i := i + 1;
     link_table(i).lfd := i;
     link_table(i).table_name := v_tname;
     fetch c_tab into v_tname;
   end loop;
   close c_tab;
   dbms_output.put_line('Anzahl: '||i);
   for j in 1..i
   loop
      dbms_output.put_line(j||' '||link_table(j).table_name);
   end loop;
END ;