querying multiple database

querying multiple database

am 21.06.2005 06:34:08 von Pradeep Bojan

Hi,

I have two database in different machine. The structure of the table in
both the database is the same. Only records are different. I want to
query records from both the database and process the results. How can I
do this ?

Database 1: abcd@host1.com
Database 2: abcd@host2.com

'abcd' has 4 tables. The structure is same in both machines.

Please let me know.

Thanks,
Pradeep





--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

RE: querying multiple database

am 21.06.2005 10:26:20 von Tim.Lloyd

Perhaps using the federated storage engine will be a technique for =
giving
you some degree of transparency for accessing remote tables.

http://dev.mysql.com/doc/mysql/en/federated-use.html

Tim.

-----Original Message-----
From: treffehn@brochier.de [mailto:treffehn@brochier.de]=20
Sent: 21 June 2005 07:53
To: win32@lists.mysql.com
Subject: WG: querying multiple database





I know of two possibilities.

1. If you have a C or C++ program, connect to host1 and fetch
result-set-1.
switch the connection to host2 and fetch result-set-2.
then merge the result-sets and process them

2. create a third database, copy the from host1 and host2 via mysqldump
and process it.
if possible, transfer only the data you want to process.


mit freundlichen Grüßen

Thomas Treffehn

Hans Brochier GmbH & Co KG

Abteilung S2 - Informationswesen
Marthastraße 16
90482 Nürnberg

Fon: +49 0911-9543-355
Fax: +49 0911-9543-383
www.brochier.de

----- Weitergeleitet von Thomas Treffehn/BROCHIER/DE am 21.06.2005 08:50
-----
=20

Pradeep Bojan


com> =
An

win32@lists.mysql.com

21.06.2005 06:34 =
Kopie

=20

=
Thema

querying multiple database

=20

=20

=20

=20

=20

=20





Hi,

I have two database in different machine. The structure of the table in
both the database is the same. Only records are different. I want to
query records from both the database and process the results. How can I
do this ?

Database 1: abcd@host1.com
Database 2: abcd@host2.com

'abcd' has 4 tables. The structure is same in both machines.

Please let me know.

Thanks,
Pradeep





--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: =
http://lists.mysql.com/win32?unsub=3Dtreffehn@brochier.de



--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: =
http://lists.mysql.com/win32?unsub=3Dtim.lloyd@biomni.com


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org

RE: querying multiple database

am 21.06.2005 10:41:34 von Tim.Lloyd

=20
You may also be able create links to your remote tables via federation
*and* then aggregate these tables (i.e. union them) via views. You would
then have a very transparent/aggregated view of your tables which was
dealt with at the MySQL level rather than in client code.

I'm not sure whether it's possible to create views of federated tables
though...

Tim.

-----Original Message-----
From: Tim Lloyd=20
Sent: 21 June 2005 09:26
To: treffehn@brochier.de; win32@lists.mysql.com
Subject: RE: querying multiple database

Perhaps using the federated storage engine will be a technique for =
giving
you some degree of transparency for accessing remote tables.

http://dev.mysql.com/doc/mysql/en/federated-use.html

Tim.

-----Original Message-----
From: treffehn@brochier.de [mailto:treffehn@brochier.de]
Sent: 21 June 2005 07:53
To: win32@lists.mysql.com
Subject: WG: querying multiple database





I know of two possibilities.

1. If you have a C or C++ program, connect to host1 and fetch
result-set-1.
switch the connection to host2 and fetch result-set-2.
then merge the result-sets and process them

2. create a third database, copy the from host1 and host2 via mysqldump
and process it.
if possible, transfer only the data you want to process.


mit freundlichen Grüßen

Thomas Treffehn

Hans Brochier GmbH & Co KG

Abteilung S2 - Informationswesen
Marthastraße 16
90482 Nürnberg

Fon: +49 0911-9543-355
Fax: +49 0911-9543-383
www.brochier.de

----- Weitergeleitet von Thomas Treffehn/BROCHIER/DE am 21.06.2005 08:50
-----
=20

Pradeep Bojan


com> =
An

win32@lists.mysql.com

21.06.2005 06:34 =
Kopie

=20

=
Thema

querying multiple database

=20

=20

=20

=20

=20

=20





Hi,

I have two database in different machine. The structure of the table in
both the database is the same. Only records are different. I want to
query records from both the database and process the results. How can I
do this ?

Database 1: abcd@host1.com
Database 2: abcd@host2.com

'abcd' has 4 tables. The structure is same in both machines.

Please let me know.

Thanks,
Pradeep





--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: =
http://lists.mysql.com/win32?unsub=3Dtreffehn@brochier.de



--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: =
http://lists.mysql.com/win32?unsub=3Dtim.lloyd@biomni.com


--=20
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: =
http://lists.mysql.com/win32?unsub=3Dtim.lloyd@biomni.com


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org