LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   How to compare records in two tables in seperate My Sql database using perl script (http://www.linuxquestions.org/questions/programming-9/how-to-compare-records-in-two-tables-in-seperate-my-sql-database-using-perl-script-664585/)

chandanperl 08-22-2008 08:16 AM

How to compare records in two tables in seperate My Sql database using perl script
 
Hi,
I have two different databases on two different servers one is local server and another is remote server.
i have to fetch data i.e job status from remote server database table and compare that job status to local server database table.
And update job status fields to local server database table.

example:
remote server->database->table->jobstatus(say jobstatus Running R )


local server->database->table->jobstatus(say jobstatus completed C)

so i have to update R to C on local server.


Thanks

TB0ne 08-22-2008 09:33 AM

Quote:

Originally Posted by chandanperl (Post 3255954)
Hi,
I have two different databases on two different servers one is local server and another is remote server.
i have to fetch data i.e job status from remote server database table and compare that job status to local server database table.
And update job status fields to local server database table.

example:
remote server->database->table->jobstatus(say jobstatus Running R )


local server->database->table->jobstatus(say jobstatus completed C)

so i have to update R to C on local server.


Thanks

Ok...are you asking if this is possible, or are you having a specific problem doing it?

Using the DBI modules for Perl will let you access the MySQL databases. Making a connection and reading a record is very simple, and there's lots of docs and examples on how to do it in the DBI module (search CPAN for it). Once you get the records you need, just compare them, and take action.


All times are GMT -5. The time now is 10:02 PM.