Link to home
Start Free TrialLog in
Avatar of mikeysmailbox1
mikeysmailbox1

asked on

Oracle SQL - clob compare

Hi

I am executing the following to compare a clog that is within 2 different tables.

select dbms_lob.compare(a.MESSAGE,b.MESSAGE)
  from CMS_MAIL a,CMR_MAIL b
where b.ORDERNO = '4'
   and a.JOBNO = '6';


I need the query to output if the same = 0 if different = 1

Not sure how to do this.

Thanks

Mike
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
According to the documentation here -> http://docs.oracle.com/cd/E16655_01/appdev.121/e17602/d_lob.htm#ARPLS66648

It should already return 0 if they are the same, non-zero if different and NULL if one (or both) of the LOBs are invalid.

If you must have 1, then I would add a simple case statement that would evaluate to 1 if it is non-zero.