LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 08-22-2008, 08:16 AM   #1
chandanperl
LQ Newbie
 
Registered: Feb 2008
Posts: 4

Rep: Reputation: 0
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
 
Old 08-22-2008, 09:33 AM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,647

Rep: Reputation: 2575Reputation: 2575Reputation: 2575Reputation: 2575Reputation: 2575Reputation: 2575Reputation: 2575Reputation: 2575Reputation: 2575Reputation: 2575Reputation: 2575
Quote:
Originally Posted by chandanperl View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL - Query and compare 2 tables rookiepaul Programming 4 05-12-2008 09:05 AM
Mysql Compare two tables from different databases baddah Programming 4 04-20-2006 12:36 AM
How to compare records in two tables in seperate My Sql database using shell script sumitarun Programming 5 04-14-2005 09:45 AM
Import Database Function Script Using Perl?? domquem Programming 3 01-13-2005 09:05 AM
Import records to MySQL Database from a shell script chrisk5527 Linux - General 12 03-24-2004 09:49 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration