Re: Comparing two records

From: Engima_Cyanide <dovestarr_at_erols.com>
Date: Tue, 28 Aug 2001 15:19:36 -0400
Message-ID: <9mgqth$5vu$1_at_bob.news.rcn.net>


Use TOAD. It is faster and built in. Why recreate the wheel?

Chris

"M. Moiz" <moiznet2002_at_yahoo.com> wrote in message news:53b2483d.0108280027.136b7617_at_posting.google.com...
> Hi!...Vini
>
> Try creating a view for the two records and then compare the fields
> but before hand place a Bitmap index on the tables...
>
> Hope this resolves the problem.
>
> Moiz.
>
>
>
> vini_sethi_at_hotmail.com (Vini Sethi) wrote in message
 news:<c8cdde9.0108250114.3e83ae88_at_posting.google.com>...
> > Hi,
> >
> > I wish to compare two records in a table and identify the fields which
> > are different. The table will have 30-40 fields. It is always 2 rows
> > which i wish to compare.
> >
> > For eg.
> >
> > table company_detail
> > fields : field1 , field2 , field3 .... field 30
> >
> > This is the process i have in mind:
> >
> > step1 :
> > pick record1 : select * from company_detail where co_name='ABC' and
> > date_of_entry='01-jan-2001';
> >
> > step2:
> > pick record2: select * from company_detail where co_name='ABC' and
> > date_of_entry='01-feb-2001';
> >
> > step3 :
> > identify / compare each field in rec1 and rec2
> > add to array if different
> > return array of field_names which are diff.
> >
> > --- pseudo code snippet --
> > i=0;
> > if (rec1.field1 <> rec2.field1)
> > {
> > array[i]=rec1.field1
> > i=i+1;
> > }
> >
> > if (rec1.field2 <> rec2.field2)
> > {
> > array[i]=rec1.field2
> > i=i+1;
> > }
> > .....
> >
> > return addtoarray;
> >
> > --- snippet ends --
> >
> > however, i think this is a very long process and am looking for
> > something more efficient.
> >
> > Thanks in advance,
> >
> > Vini
Received on Tue Aug 28 2001 - 21:19:36 CEST

Original text of this message