Declare the varray with null values.
SQL>
SQL> DECLARE
2 TYPE integer_varray IS VARRAY(3) OF INTEGER;
3 intArray INTEGER_VARRAY := integer_varray(NULL,NULL,NULL);
4 BEGIN
5 dbms_output.put_line('Varray initialized as nulls.');
6 FOR i IN 1..3 LOOP
7 dbms_output.put ('Integer Varray:'||i);
8 dbms_output.put_line(':'||intArray(i));
9 END LOOP;
10
11 END;
12 /
Varray initialized as nulls.
Integer Varray:1:
Integer Varray:2:
Integer Varray:3:
PL/SQL procedure successfully completed.
Related examples in the same category