You are on page 1of 3

declare

--tablou indexat de numere

type t_numbers is table of number index by binary_integer;

--tablou indexat de tablouri indexate de numere

type t_multinumbers is table of t_numbers index by binary_integer;

--vector de tablouri indexate de numere

type t_multivarray is varray(100) of t_numbers;

--tablou imbricat de tablouri indexate de numere

type t_multinested is table of t_numbers;

t1 t_numbers;

t2 t_multinumbers;

t3 t_multivarray;

t4 t_multinested;

t5 t_numbers;

t6 t_numbers;

begin

t1(1) := 1;

t1(2) := 2;

t1(3) := 3;

t5(1) := 4;

t5(2) := 5;

t5(3) := 6;

t6(1) := 7;

t6(2) := 8;

t6(3) := 9;

dbms_output.put_line('tablou indexat de numere: ');

for i in t1.first..t1.last loop

dbms_output.put_line(t1(i) || ' ');


end loop;

dbms_output.put_line('-----------------------------------');

t2(1) := t1;

t2(2) := t6;

t2(3) := t5;

dbms_output.put_line('tablou indexat de tablouri indexate de numere: ');

for i in t2.first..t2.last loop

if t2.exists(i) then

for j in t2(i).first..t2(i).last loop

if t2(i).exists(j) then

dbms_output.put(t2(i)(j) || ' ');

end if;

end loop;

dbms_output.new_line();

end if;

end loop;

dbms_output.put_line('-----------------------------------');

dbms_output.put_line('tablou imbricat de tablouri indexate de numere: ');

t4 := t_multinested(t6, t5, t1);

for i in t4.first..t4.last loop

if t4.exists(i) then

for j in t4(i).first..t4(i).last loop

if t4(i).exists(j) then

dbms_output.put(t4(i)(j) || ' ');

end if;

end loop;

dbms_output.new_line();
end if;

end loop;

dbms_output.put_line('-----------------------------------');

dbms_output.put_line('vector de tablouri indexate de numere: ');

t3 := t_multivarray(t5, t1, t6);

for i in t3.first..t3.last loop

for j in t3(i).first..t3(i).last loop

if t3(i).exists(j) then

dbms_output.put(t3(i)(j) || ' ');

end if;

end loop;

dbms_output.new_line();

end loop;

end;

set serveroutput on;

You might also like