Extend and count attributes of varray : Varray Methods « Collections « Oracle PL/SQL Tutorial






SQL>
SQL> DECLARE
  2     TYPE lv_name_array IS VARRAY(5) OF VARCHAR2(10);
  3     lv_name_array_rec lv_name_array := lv_name_array('dave','pat','bob');
  4  BEGIN
  5     FOR lv_loop_num in 1..lv_name_array_rec.COUNT LOOP
  6        DBMS_OUTPUT.PUT_LINE(lv_name_array_rec(lv_loop_num));
  7     END LOOP;
  8     lv_name_array_rec.EXTEND;
  9     lv_name_array_rec(lv_name_array_rec.COUNT) := 'tony';
 10     DBMS_OUTPUT.PUT_LINE(lv_name_array_rec(4));
 11  END;
 12  /
dave
pat
bob
tony

PL/SQL procedure successfully completed.

SQL>








26.5.Varray Methods
26.5.1.Collection Methods
26.5.2.Extend and count attributes of varray
26.5.3.COUNT
26.5.4.LIMIT
26.5.5.EXTEND