473,385 Members | 1,372 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

database links

Ike
Can someone show me how I might be able to connect to two separate
databases, and create a query from the two? I understand in Oracle this is
referred to as "database links" but is there a more general way to do this
(i.e. will work with, say, mysql and other DBs?) I want to comapre a field
that is present in two separate files on two seperat databases. Thanks, Ike
May 30 '06 #1
2 1391
Ike wrote:
Can someone show me how I might be able to connect to two separate
databases, and create a query from the two? I understand in Oracle this is
referred to as "database links" but is there a more general way to do this
(i.e. will work with, say, mysql and other DBs?) I want to comapre a field
that is present in two separate files on two seperat databases. Thanks,
Ike


Hi Ike,

AFAIK this cannot be done in a general reliable way.
Of course, you can always make 2 connections, pull in all the data you need,
and join/filter/etc the tables/results yourself in PHP (or whatever it is
your SQL-query should be doing).

Some databases however offer the possibility to make queries that span more
databases of the same kind, eg Oracle or Postgres. I think M$ Access can do
it too.

Maybe there are packages out that facilitate multiple different database
queries, I don't know them.
Possibly, if you make 2 ODBC-connections you can use them both. (not sure
either)

Whatever solution you find, I expect that the performance of such queries
will be low, simply because the data has to be gathered from different
places and cannot be run in one place unless all the data is pulled in,
which is also a lot of overhead.

I would approach this as I described above, just make 2 or more connections,
get in the data you need, and optimize where you can. At least you know
excactly what is going on in that way and you can use your knowledge of the
systems to optimize (eg, not pulling in all the data from all related
tables).

just my 2 cent.

Good luck.
Regards,
Erwin Moller
May 31 '06 #2
Usually I do it like this If I understand you question correctly...

select a.account, a.customer;
b.invoice ;
from db1.tbl1 a, db2.tbl2 b ;
where a.account = b.account

Erwin Moller wrote:
Ike wrote:
Can someone show me how I might be able to connect to two separate
databases, and create a query from the two? I understand in Oracle this is
referred to as "database links" but is there a more general way to do this
(i.e. will work with, say, mysql and other DBs?) I want to comapre a field
that is present in two separate files on two seperat databases. Thanks,
Ike


Hi Ike,

AFAIK this cannot be done in a general reliable way.
Of course, you can always make 2 connections, pull in all the data you need,
and join/filter/etc the tables/results yourself in PHP (or whatever it is
your SQL-query should be doing).

Some databases however offer the possibility to make queries that span more
databases of the same kind, eg Oracle or Postgres. I think M$ Access can do
it too.

Maybe there are packages out that facilitate multiple different database
queries, I don't know them.
Possibly, if you make 2 ODBC-connections you can use them both. (not sure
either)

Whatever solution you find, I expect that the performance of such queries
will be low, simply because the data has to be gathered from different
places and cannot be run in one place unless all the data is pulled in,
which is also a lot of overhead.

I would approach this as I described above, just make 2 or more connections,
get in the data you need, and optimize where you can. At least you know
excactly what is going on in that way and you can use your knowledge of the
systems to optimize (eg, not pulling in all the data from all related
tables).

just my 2 cent.

Good luck.
Regards,
Erwin Moller


Jun 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Roar | last post by:
Hi! I have got 1 access 2000 DB, one simple search form, and 3 .asp pages (one for deleting a record, one for inserting a record and one for listing searchresults). Deleting records works fine,...
0
by: Pentti | last post by:
Can anyone help to understand why re-parsing occurs on a remote database (using database links), even though we are using a prepared statement on the local database: Scenario: ======== We...
12
by: Gary | last post by:
I have a backend Database with just one main table in it (no form/queries etc) The network pc's have the front end database (with all the forms, queries,macros etc). These front ends are linked...
3
by: .Net Newbie | last post by:
I'm new to .Net and need to create a generic (free) way to update lookup tables in SQL Server (using C#) in ASP.Net pages. I found an article at:...
4
by: robert d via AccessMonster.com | last post by:
When my app starts up, it creates a temporary database. This temp database is created from a 'model' database that is in the same folder as the application. Because there is a model, the creation...
3
by: John Phelan-Cummings | last post by:
I have a front-end application called, “inbusiness.mdb” and three back-ends databases called, “inbusinessClient_be.mdb”, “inbusinessFund_be.mdb”, and, “inbusiness_be”. I created three back-ends...
5
by: Slant | last post by:
Here's a question that most will have different answers to. I'm just dying to find a solution that seems halfway automated!! There really are two seperate issues which might be answered by the...
14
by: mistral | last post by:
Need php script to create mySQL database programmatically; since hosting configuration may not allow create database from script, script also need eliminate/rewrite all restrictions in appropriate...
1
by: amygrant1701 | last post by:
Hi, I've done this before so I don't see what I could doing wrong here. I'm running mysql 5x on freebsd. I'm using the default data directory of "/var/db/mysql" In there I have several dozen...
25
by: pereges | last post by:
Hello, I'm trying to build a database driven website for a library management system. The database is stored on a remote server which all of my team mates can access. I've installed MySQL, PHP and...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.