Re: Comparing tables in two DBs

From: Steven Seacord <sseacord_at_amp.com>
Date: 1996/08/24
Message-ID: <321EA441.1866_at_amp.com>#1/1


One note of warning, if there are differences, you need to do the compare BOTH ways to truly verify. If row counts are the same though, then you can do the compare in only one direction. One other problem I had once, was when I used this message, the actual difference was the column ORDER, so when I did a select * they were the same, but when the columns were referenced they gave different results. As such, it is ALWAYS better to specify the columns name (some dynamic (META) SQL will handle this).

Steven Seacord
Oracle DA/DBA
AMP, Inc.

Ted Goulden wrote:
>
> I never actually followed through and did this, but after discussions
> with other developers I think this is about the easiest approach of
> all:
>
> SELECT * FROM TABLE_at_INSTANCE1
> MINUS
> SELECT * FROM TABLE_at_INSTANCE2;
>
> This should give you both the missing/extra rows and rows with updates
> to some columns. Let me know if this actually works or if there is a
> better way.
>
Received on Sat Aug 24 1996 - 00:00:00 CEST

Original text of this message