With the following query where POSTAL is a varray I get the error:

ORA-00932: inconsistent datatypes

Can anyone tell me how I can compare them? I can't find any documentation on creating a comparator for either varray's or object types. I see that object types have an order by member, but I couldn't find documentation on a comparator member.

Thanks for all the help. When I finish this project, I'm going to have to write a mini howto on varrays and post it. There's too little information out there from what I can find.


SELECT
T1.*
FROM
T_TEST1 T1,
T_TEST2 T2
WHERE
T1.POSTAL = T2.POSTAL;




CREATE TYPE POSTAL_ARRAY AS VARRAY(15) OF NUMBER (15);
/

CREATE TABLE T_TEST1 (
PRODUCT_ID NUMBER(19),
POSTAL POSTAL_ARRAY
);


INSERT INTO T_TEST1 (PRODUCT_ID, POSTAL) VALUES (1, POSTAL_ARRAY(1, 2, 3));
INSERT INTO T_TEST1 (PRODUCT_ID, POSTAL) VALUES (2, POSTAL_ARRAY(4, 5, 6));
INSERT INTO T_TEST1 (PRODUCT_ID, POSTAL) VALUES (3, POSTAL_ARRAY(7, 8, 9));


CREATE TABLE T_TEST2 (
PRODUCT_ID NUMBER(19),
POSTAL POSTAL_ARRAY
);


INSERT INTO T_TEST2 (PRODUCT_ID, POSTAL) VALUES (1, POSTAL_ARRAY(1, 2, 3));
INSERT INTO T_TEST2 (PRODUCT_ID, POSTAL) VALUES (2, POSTAL_ARRAY(4, 5, 6));
INSERT INTO T_TEST2 (PRODUCT_ID, POSTAL) VALUES (4, POSTAL_ARRAY(7, 8, 9));