I've got read-only access to a database containing two schema with tables like this:
schema1.A.unique_id, schema1.A.content
schema2.B.unique_id, schema2.B.content
A.unique_id
and B.unique_id
will match while A.content
and B.content
are *LOB
columns that should match (wasn't my idea lol). What I'd like to do is compare the contents of the content
fields and see how many are equal. However, one is a CLOB
and one is a BLOB
.
DBMS_LOB.COMPARE()
is an obvious helper, however it only compares two *LOB
s of the same type (e.g. CLOB
vs. CLOB
).
In lieu of writing a script to get the content of the fields and compare them in memory, how can I perform this comparison in straight-up PL/SQL? Is there some way I can convert one of the fields on-the-fly so that the types match (again keep in mind I only have read-only access)?
Thanks!