compare table of varchar2 : Table of Varchar2 « Collections « Oracle PL/SQL Tutorial






SQL>
SQL> DECLARE
  2     TYPE clientList IS TABLE OF VARCHAR2 (64);
  3
  4     group1   clientList := clientList ('Customer 1', 'Customer 2');
  5     group2   clientList := clientList ('Customer 1', 'Customer 3', NULL);
  6     group3   clientList := clientList ('Customer 3', NULL, 'Customer 1');
  7  BEGIN
  8     IF group1 = group2
  9     THEN
 10        DBMS_OUTPUT.put_line ('Group 1 = Group 2');
 11     ELSIF group1 != group2
 12     THEN
 13        DBMS_OUTPUT.put_line ('Group 1 != Group 2');
 14     END IF;
 15
 16     IF group2 != group3
 17     THEN
 18        DBMS_OUTPUT.put_line ('Group 2 != Group 3');
 19     ELSIF group2 = group3
 20     THEN
 21        DBMS_OUTPUT.put_line ('Group 2 = Group 3');
 22     END IF;
 23  END;
 24  /

PL/SQL procedure successfully completed.








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.