Demonstrate Associative Arrays : Table of Varchar2 « Collections « Oracle PL/SQL Tutorial






SQL> declare
  2    type varchar_array is table of varchar2(100) index by binary_integer;
  3    array1  varchar_array;
  4    v_index number;
  5  begin
  6    array1(1) := 'T';
  7    array1(2) := 'R';
  8    array1(5) := 'B';
  9
 10    v_index := array1.first;
 11
 12    for x in 1..array1.count loop
 13      dbms_output.put_line(array1(v_index) );
 14      v_index := array1.next(v_index);
 15    end loop;
 16  end;
 17  /

PL/SQL procedure successfully completed.

SQL>
SQL>








26.27.Table of Varchar2
26.27.1.Demonstrate Associative Arrays
26.27.2.compare table of varchar2
26.27.3.Constructor of table collection
26.27.4.for index between first and last
26.27.5.Initialize table collection of varchar2
26.27.6.Table collection variable assignment
26.27.7.Loading and accessing an array of varchar2
26.27.8.A procedure that uses an implicit cursor loop to load an array with employee number and name.