gdenis has asked for the wisdom of the Perl Monks concerning the following question:

Hi guys, I am trying to write a perl script that will compare information in two sybase databases and print out the difference. Thanks for your help. gdenis

Replies are listed 'Best First'.
Re: Comparing information in 2 databases
by dbwiz (Curate) on Jan 14, 2005 at 12:26 UTC
Re: Comparing information in 2 databases
by EdwardG (Vicar) on Jan 14, 2005 at 12:18 UTC

    Could I trouble you to explain what kind of help you need?

     

Re: Comparing information in 2 databases
by dragonchild (Archbishop) on Jan 14, 2005 at 13:09 UTC
    I may be offbase, but doesn't Sybase have a facility for linking one database to another so that they seem to be on the same server? I can't imagine that Oracle is the only RDBMS with a DB_LINK type of feature ...

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

      You can, using various functionality, but this may require administrator privileges, which the user may not have.

      A perl script that pulls data and does an MD5 hash or something similar may be a reasonable way to do this (assuming the size of the tables isn't overly large).

      Another way (which only works if both servers are quiescent) is to bulk-copy all of the data to OS files and checksum the resulting files (be careful of row ordering, however). This won't tell you where the differences are, but it will tell you if the data is identical.

      Michael

Re: Comparing information in 2 databases
by pingo (Hermit) on Jan 14, 2005 at 12:20 UTC
    One relatively easy (but non-perl) solution could be to dump the information from the tables in the databases with bcp and then just do a diff on the files.