This content has been marked as final. Show 5 replies
Are you referring to different rows within the same table or from different tables or ?
Basically you have to tweak Odie's example so that the XMLDiff is retrieving the XML from the appropriate places in the DB, say something like
This avoids bringing the XML out of the DB into client code.
XMLDIFF(SELECT aXml FROM table WHERE ..., SELECT bXml FROM table WHERE ...)
Not sure if that is what you were looking for but hopefully it helps a bit.
I am talking about the same column in two different rows in the same table but also possibly similar column in two different tables.
From your suggested when I tried this query:
SELECT XMLDIFF (SELECT XMLCOLUMN1 FROM TABLE1 WHERE ID=302, SELECT XMLCOLUMN1 FROM TABLE1 WHERE ID=342);
in SQL Developer worksheet I get this error:
SQL Error: ORA-00936: missing expression
00936. 00000 - "missing expression"
ID is primary key and is a number.
This is an 11g R1 but if it helps we can try it on R2.
P.S. When I run this on two different columns in the same row I get success and a xmldiff result XML:
SELECT XMLDIFF(XMLCOLUMN1,XMLCOLUMN2) FROM TABLE1 WHERE ID=1;
But that is all in the same row, want something like this but across two different rows.
Sorry, got it to work now:
SELECT XMLDIFF ((SELECT XMLCOLUMN1 FROM TABLE1 WHERE ID=301),(SELECT XMLCOLUMN1 FROM TABLE1 WHERE ID=343)) FROM DUAL;
Is the output from both sqlplus and SQL Developer is not the entire xmldiff XML but is truncated, is there a way to get the output to a file or in the tool to cut and paste?
set long 5000