Let us say I have two table types (tables of object types) that I want to compare for equality…
The object types have multiple fields, say, an integer, varchar2, and date.
I have seen examples where people use MULTISET EXCEPT in order to effectively do a MINUS on two tables of INTEGER.
But this does not work with two tables of complex object types.
Also I have seen mentioned the use of MAP MEMBER FUNCTION in order to make complex collections work when using the SET operator, but no mention of MULTISET functionality.
The current way I am comparing for equality is to take table type 1 (TT1) and table type 2 (TT2) and say they are equal if TT1 MINUS TT2 = 0 AND TT2 MINUS TT1 = 0. But here I am just selecting the PK from both tables for the MINUS, I would also like to be able to compare more than one field.
I am hoping MULTISET is faster?
Thanks.
Yes, you can use a
MAP MEMBER FUNCTIONto support comparing nested tables of types.I don’t know if this would be faster than manually comparing each attribute. But I would guess the difference won’t be significant.