Re: Need to Compare two databases
Posted in 1997
Hi,
try to compile your current source code and compare the resulting
executable programm against the current one. ( i.e. by "cmp" )
If both programs will not differ, then I think your source code
matches to the executable.
Even if both executables will produce the same result in your
database, this does not mean that both programs are identical.
However, if you want to compare two databases:
For each table in your database run the following queries:
1.) select count(*) from A;
2.) select 1 from A, compdatabase:A aliasB where
A.primary_key = aliasB.primary_key
-- maybe you want to compare all fields ?? do it here.
into temp xtmp;
3.) Compare the result from 1.) with the # of rows returned
by 2.)
Bye
Stefan
KPonn wrote:
>
> Hi,
>
> During a long batch cycle, I took snap shots of production database (I used
> onunload) at different stages: before cycle, in the middle,and after cycle. We
> are trying to find out whether or not the current executable in production
> produced by the current source code we have. Our Idea is to generate another
> executable using the source code and load "before cycle" database and run. We
> will stop the cycle in the middle and compare this test database with the
> snap shot I took in the middle. We hope to see these two databases are exactly
> the same. And we finish the cycle and compare final database from this test
> with "after cycle" snap above. If they are same , then we know (???) that
> current executable in production was produced by the source code that we
> currently have. (Current executable in production works and source code is
> questionable !)
>
> Questions: 1. Is this the best way to do it ? If yes, how do I compare two
> databases (I mean entire database !).
> 2. If not, Is there any other alternative ?
>
> Thanks
>
> Keith Ponnapalli