clear screen
set serveroutput on size unlimited
select banner from v$version
declare
type names_aa is table of varchar2(30) index by binary_integer;
l_names names_aa;
l_indx binary_integer;
begin
-- fill up the collection
l_names(1) := 'Hooly';
l_names(42) := 'Heddy';
l_names(10) := 'Hilder';
l_names(l_names.count + 1) := 'Holy';
l_names(-1) := 'Haley';
-- display the contents of the collection
l_indx := l_names.first;
while l_indx is not null loop
dbms_output.put_line(l_indx || ') ' || l_names(l_indx));
l_indx := l_names.next(l_indx);
end loop;
end;
declare
type names_aa is table of varchar2(30) index by binary_integer;
l_names names_aa;
l_indx binary_integer;
begin
-- fill up the collection
l_names := names_aa(1 => 'Hooly'
,42 => 'Heddy'
,10 => 'Hilder'
,(l_names.count + 1) => 'Holy'
,-1 => 'Haley');
-- display the contents of the collection
l_indx := l_names.first;
while l_indx is not null loop
dbms_output.put_line(l_indx || ') ' || l_names(l_indx));
l_indx := l_names.next(l_indx);
end loop;
end;