hmm...
dynamic array means that it can expand according to the to number of records going to insert.
in varray, i normally do this:
type Record_type is varray(50) of varchar2(500);
Record_varray Record_type := Record_type();
as u notice i have to declare the size of the varray.
is there any other way that do not need to declare the size instead, expand when u are going to add data in.
thanks
declare
type
my_tab_type is table of varchar2(500)
index by binary_integer;
my_tab my_tab_type;
v_tab_index number := 0;
begin
--
for <loop condition>
loop
v_tab_index := v_tab_index + 1;
my_tab(v_tab_index) := 'whatever goes here';
end loop;
end;
Unless you are still using 8i, Oracle recommends PLS_INTEGER in place of the old BINARY_INTEGER.
I think I read somewhere that the 9i compiler actually substitutes PLS_INTEGER anyway, but all the same I get a feeling of confidence when I'm reading code that uses the recommended type