Declaring a VARRAY of scalar variable
SQL>
SQL> DECLARE
2 TYPE number_varray IS VARRAY(10) OF NUMBER;
3 list NUMBER_VARRAY := number_varray(1,2,3,4,5,6,7,8,NULL,NULL);
4 BEGIN
5 FOR i IN 1..list.LIMIT LOOP
6 dbms_output.put('['||list(i)||']');
7 END LOOP;
8 dbms_output.new_line;
9 END;
10 /
[1][2][3][4][5][6][7][8][][]
PL/SQL procedure successfully completed.
Related examples in the same category