Deleting internal elements from a collection : Nested Tables « Collections « Oracle PL/SQL Tutorial






SQL>
SQL> declare
  2      type month_nt is table of VARCHAR2(20);
  3      v_month_nt month_nt:=month_nt();
  4      i number;
  5  begin
  6      v_month_nt.extend(3);
  7      v_month_nt(1):='A';
  8      v_month_nt(2):='B';
  9      v_month_nt(3):='C';
 10
 11      v_month_nt.delete(2);
 12      DBMS_OUTPUT.put_line('Count:'||v_month_nt.count);
 13      DBMS_OUTPUT.put_line('Last:'||v_month_nt.last);
 14
 15      i:=v_month_nt.first;
 16      loop
 17          DBMS_OUTPUT.put_line(v_month_nt(i));
 18          i:=v_month_nt.next(i);
 19          if i is null
 20          then
 21              exit;
 22          end if;
 23      end loop;
 24  end;
 25  /
Count:2
Last:3
A
C

PL/SQL procedure successfully completed.

SQL>
SQL>
SQL>








26.8.Nested Tables
26.8.1.Nested Tables
26.8.2.Deleting internal elements from a collection
26.8.3.Creating a Nested Table Type
26.8.4.ANSI Support for Nested Tables
26.8.5.Nested type column
26.8.6.Insert value into table with nested type colunm
26.8.7.cardinality
26.8.8.Table with subquery
26.8.9.Type alias for user-defined type in select statement