DECLARE
TYPE mytyp IS RECORD (
vorname VARCHAR2(100),
nachname VARCHAR2(100)
);
TYPE numarray IS
TABLE OF mytyp INDEX BY BINARY_INTEGER;
l_data numarray;
BEGIN
l_data(1).vorname := 'Marco';
l_data(1).nachname := 'Patzwahl';
l_data(0).vorname := 'Hans';
l_data(0).nachname := 'Wurst';
FOR i IN 0..l_data.count - 1 LOOP
dbms_output.put_line('Name='
|| l_data(i).vorname
|| ' '
|| l_data(i).nachname);
END LOOP;
END;
/
DECLARE TYPE mytyp IS RECORD ( vorname VARCHAR2(100), nachname VARCHAR2(100));
TYPE numarray IS TABLE OF mytyp INDEX BY BINARY_INTEGER;
l_data numarray;
l_rtyp mytyp;
BEGIN
l_rtyp.vorname:='Peter';
l_rtyp.nachname:='Kraus';
l_data(2):=l_rtyp;
for i in 0 .. l_data.count-1 LOOP
dbms_output.put_line('Name='||l_data(i).vorname||' '||l_data(i).nachname);
END LOOP;
END;
/
DECLARE TYPE mytyp IS RECORD ( owner VARCHAR2(30), name VARCHAR2(30), text VARCHAR2(4000) );
TYPE numarray IS TABLE OF mytyp INDEX BY BINARY_INTEGER;
l_data numarray; l_rtyp mytyp;
BEGIN dbms_output.put_line('Zeit:'||systimestamp);
FOR r in (SELECT owner,name,text,rownum as rn from all_source)
loop l_rtyp.owner := r.owner;
l_rtyp.name := r.name;
l_rtyp.text := r.text;
l_data(r.rn) := l_rtyp;
end loop;
dbms_output.put_line('Anzahl:' || l_data.count);
dbms_output.put_line('Zeit:' || systimestamp);
END;
/