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

Home -> Community -> Usenet -> c.d.o.misc -> Re: computing the difference between two big text files?

Re: computing the difference between two big text files?

From: Brian Peasland <peasland_at_edcmail.cr.usgs.gov>
Date: Fri, 10 Dec 1999 14:07:11 GMT
Message-ID: <3851090F.4A70A973@edcmail.cr.usgs.gov>


You can load the two text files into two different tables (table1 and table2). You can then use the MINUS operator to find those records that are in table1 and not in table2.   

   SELECT * FROM table1
   MINUS
   SELECT * FROM table2;

You can do the same thing to find records in table2 and not in table 1.

But this won't find the difference between two text files. I may be wrong in my assumption but when I want to find the difference between two text files, the order of the text in the files is important (like using 'diff' on Unix). There is no order in relational database tables (according to theory). So the above example will not do the same. If order is unimportant to you and you just want to find those records that are different, then use the above example.

HTH,
Brian

bing-du_at_tamu.edu wrote:
>
> Greetings all...
>
> We have Oracle7 Server Release 7.3.4.0.1.
>
> For some reason, we have to have people data (about 50,000 records)
> saved in a text file. Because people come and go frequently, this text
> file is updated periodically, e.g. monthly.
>
> We need to keep track changes between the old text file and the new text
> file. We wrote some Perl code on unix and computed the difference
> between two text files. I have to say this method led to low efficiency
> and a pain in the neck.
>
> Because we are able to load people data from text file to an Oracle
> table, I'm wondering if it's possible to first load the old and the new
> text data file into two separate tables respectively; then compute the
> difference between two tables?
>
> I'm not that familiar with Oracle. Can anybody advice me if my idea
> feasible? How to actually implement this, via SQL*PLUS script?
>
> Need your help badly,
>
> Thanks,
>
> Bing
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Fri Dec 10 1999 - 08:07:11 CST

Original text of this message

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