Here's the Online documentation concerning collections.
The principle's this:-- declare a varray type:
TYPE <I>type_name</I> IS VARRAY(<I>size_limit</I>) OF <I>datatype</I>;
your_varray type_name; -- declare a variable of this type and initialize it.
Datatype can be a simple data_type, but also a %TYPE, a %ROWTYPE a previously defined record type or SQL type... I'd suggest you read the docs carefully.
Here's what I do when I need a varray. I declare a PL/SQL index by table (no upper bound and no need to initialize it):SQL> declare
2 type tab_type is table of integer index by binary_integer;
3 my_table tab_type;
4 begin
5 for i in 1..12
6 loop
7 my_table(i) := i*i;
8 end loop;
9 for j in 1..my_table.count
10 loop
11 dbms_output.put_line(my_table(j));
12 end loop;
13* end;
14 /
1
4
9
16
25
36
49
64
81
100
121
144
PL/SQL procedure successfully completed.
SQL>
HTH,
MHE