By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
DECLARE
TYPE myarrtype is table of integer;
my_array myarrtype;
BEGIN
select level bulk collect into my_array from dual
connect by level <= 4;
dbms_output.put_line('OLD COUNT '||my_array.count);
if my_array.count <= 6 then
my_array.extend(6 - my_array.count);
dbms_output.put_line('NEW COUNT '||my_array.count);
end if;
END;
/
1 rows affected
dbms_output:
OLD COUNT 4
NEW COUNT 6