Collections Oracle PLSQL 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>