I have two PLSQL Arrays of type nested table:
TYPE nested_typ IS TABLE OF VARCHAR2(21);
nt1 nested_typ := nested_typ('abc','def','123');
nt2 nested_typ := nested_typ('123');
I want to have the difference of these two collections, for above Ex: ‘def’, ‘abc’
Please suggest any simple way to do this?
Thanks…
These are simple types, so you can use PL/SQL’s set comparison operators. In your case you want to use
MULTISET EXCEPT(works the same way as the SQLMINUSoperator). Given a third nested table you would code something like:Find out more.
Yes, use
multiset except distinct.There are lots of collection operators. As we would expect they are covered in the PL/SQL documentation. Find it here.