I would like to ask about the values of LAST and COUNT of the varray after operation TRIM.
In the documentation is written, that " For varrays, COUNT always equals LAST." [
https://docs.oracle.com/cd/B19306_01/appdev.102/b14261/collection_method.htm] However, when I trim the varray, the values are not the same, value of LAST is incorrect, in my opinion.
What happened? How to solve it?
declare
type t_pole is varray(40) of integer;
pole t_pole;
begin
pole:=t_pole(10,20,30,40,50,60,70,80,90,100,
110,120,130,140,150,160,170,180,190,200,
210,220,230,240,250,260,270,280,290,
300,310,320,330,340,350);
dbms_output.put_line('LIMIT '||' '||pole.limit);
dbms_output.put_line('last '||' '||pole.last);
dbms_output.put_line('count '||' '||pole.count);
dbms_output.put_line('***trim 10 ** ');
pole.trim(11);
dbms_output.put_line('LIMIT '||' '||pole.limit);
dbms_output.put_line('last '||' '||pole.last);
dbms_output.put_line('count '||' '||pole.count);
end;
/