Collections Oracle PLSQL Tutorial

Equal and Not-Equal Operators
You use the equal (=) and not-equal () operators to compare nested tables.
Two nested tables are considered equal when they satisfy all the following conditions:
All the tables are the same type.
All the tables are the same cardinality-that is, they contain the same number of elements.
All the elements are equal.

SQL>
SQL> CREATE OR REPLACE PROCEDURE equal_example AS
  2    TYPE nestedTableType IS TABLE OF VARCHAR2(10);
  3    myTable1 nestedTableType;
  4    myTable2 nestedTableType;
  5    myTable3 nestedTableType;
  6    result BOOLEAN;
  7  BEGIN
  8    myTable1 := nestedTableType('A', 'F', 'G');
  9    myTable2 := nestedTableType('B', 'E', 'H');
 10    myTable3 := nestedTableType('C', 'D', 'I');
 11
 12    result := myTable1 = myTable2;
 13    IF result THEN
 14      DBMS_OUTPUT.PUT_LINE('myTable1 equal to myTable2' );
 15    END IF;
 16
 17    result := myTable1 <> myTable3;
 18    IF result THEN
 19      DBMS_OUTPUT.PUT_LINE('myTable1 not equal to myTable3');
 20    END IF;
 21  END equal_example;
 22  /
Procedure created.
SQL>
SQL> CALL equal_example();
myTable1 not equal to myTable3
Call completed.
SQL>