Pass NULL value to varray : Varray of Number « Collections « Oracle PL/SQL Tutorial






SQL>
SQL> declare
  2    Type numberVarray is VARRAY(5)OF NUMBER;
  3    v_numvarray2 numberVarray;
  4  begin
  5    v_numvarray2 :=numberVarray(NULL);
  6
  7    if v_numvarray2 IS NULL then
  8
  9      dbms_output.put_line('v_numvarray2 is null');
 10
 11    else
 12
 13      dbms_output.put_line('v_numvarray2 is not null');
 14
 15    end if;
 16
 17    if v_numvarray2(1) IS NULL then
 18
 19      dbms_output.put_line('The first element of v_numvarray2 is null');
 20
 21    end if;
 22  end;
 23  /
v_numvarray2 is not null
The first element of v_numvarray2 is null

PL/SQL procedure successfully completed.

SQL>
SQL>








26.6.Varray of Number
26.6.1.Defining a VARRAY
26.6.2.Initializing a VARRAY
26.6.3.NULL VARRAYS and NULL Elements
26.6.4.Is a varray null value
26.6.5.Pass NULL value to varray
26.6.6.Accessing VARRAY elements
26.6.7.Multilevel Collections