declare
type McDodd_rec is record
( firstname varchar2(32)
, type number(2)
);
type McDodd_AA is table of McDodd_rec index by pls_integer;
l_McDodd McDodd_AA;
l_indx pls_integer;
begin
-- fill up the collection
l_McDodd := McDodd_AA(1 => McDodd_rec(firstname => 'Hooly', type => 18)
,42 => McDodd_rec(firstname => 'Heddy', type => 18)
,10 => McDodd_rec(firstname => 'Hilder', type => 18)
,4 => McDodd_rec(firstname => 'Holy', type => 18)
,-1 => McDodd_rec(firstname => 'Haley', type => 18));
-- display the contents of the collection
l_indx := l_McDodd.first;
while l_indx is not null loop
dbms_output.put_line(l_indx || ') ' || l_McDodd(l_indx).firstname);
l_indx := l_McDodd.next(l_indx);
end loop;
end;