Comparing two databases

Peter Haworth pete at lcsql.com
Mon Apr 29 13:18:37 EDT 2013


Hi Skip,
I'd say it would be quite easy to open both dbs in LC, do a SELECT on each
one for the primary key  and the three fields you're interested in, then
use LC to compare the results.  One way to do it might be to put the
results of the first SELECT into an array keyed by the primary key, do the
second select, then have a repeat loop on the data from the second SELECT
comparing the results with the array built from the first SELECT.

The best answer would depend on more info I think - how many entries in
each table, how many are likely to be discrepancies, stuff like that.

Is the local db merged into the remote db on a regular basis?  If so, you
could probably implement some sort of timestamp mechanism in each entry to
indicate the last time it was updated/inserted and compare that to the time
the db was last merged to narrow down the number of rows to be compared.
 Whether that's worth the hassle is, once again, a factor of how much data
is involved.

Pete
lcSQL Software <http://www.lcsql.com>


On Sun, Apr 28, 2013 at 2:58 PM, Magicgate Software - Skip Kimpel <
skip at magicgate.com> wrote:

> I have two remote databases that need to be compared every once in a while
> for discrepancies.   What would be the best approach for this in LC?  One
> is a remote MySQL DB and the other is a local Access DB.
>
> Is there a way to do a live comparison of the two or would it be best to
> import data from the two DBs into two separate tables locally and then do
> some type of comparison?  I am really only comparing about 3 fields from
> each DB.
>
> Any guidance here would be greatly appreciated, as I have a feeling I am
> tryring to make it more difficult than it needs to be.
>
> SKIP
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list