Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Can blob be compared?

Re: Can blob be compared?

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 7 Apr 2003 07:17:09 -0700
Message-ID: <2687bb95.0304070617.3d3416eb@posting.google.com>


Simon Hall <Simon.Hall_at_logicacmg.com> wrote in message news:<3E914190.A7157298_at_logicacmg.com>...
> Mark D Powell wrote:
> >
> > "NewYorker" <newyorker777_at_hotmail.com> wrote in message news:<3e8e4e7f$1_4_at_corp-goliath.newsgroups.com>...
> > > I have used Sql here and there and never in the situation where by join
> > > comparison of a blob, can blob be compared? Example,
> > >
> > > select table_a.* from table_a a, table_b b
> > > where a.someblob = b.someblob;
> > >
> > > someblob is a blob column.
> > >
> > > Thanks!!!!!
> > >
> >
> > My first thought when I read your post was "Man, if that is possible
> > the query is going to be slower than Christmas."
> >
> > The dbms_lob package provides a compare procedure that can compare
> > full lobs so you should be able to reference it in the where clause
> > testing the return value = 0 for equal and non-zero for unequal.
> >
> > HTH -- Mark D Powell --
>
> Just a thought - when you create (or change) the blob create a checksum.
> Then when you want to compare blobs, compare the length and the checksum
> instead. Only if both match do you then need to compare the blobs byte
> for byte.
>
> HTH
>
> Simon

Simon, I am not sure that what you suggested will work because LOB segments can contain rollback information along with the current data, and I do not remember and am not currently in position to test if the length of the lob segment includes this. If it does then two identical lob values would have different lenghts.

Just a thought. -- Mark -- Received on Mon Apr 07 2003 - 09:17:09 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US