RE: cross database queries?

John Scoles <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Message-ID <[email protected]>
 
> Date: Wed, 26 Jun 2013 08:26:36 -0400
> From: [email protected]
> To: [email protected]
> Subject: cross database queries?
> 
> I want to write a query like:
> 
> select clients.client.client_id, columnar.sales.total_sales, 
> web.page_hits from clients, columnar, web
> where clients.client_id = columnar.client_id
> and  clients.client_id = web.client_id
> 
> in a system where 'clients' is actually one or more relational 
> databases, 'columnar' is one or columnar databases, and 'web' is the 
> Apache logs on one or more web servers.  The dbi driver would be 
> configured to connect to the correct databases and filter web hits based 
> on 'client_id'.
> 
> Has somebody written that already?
>  Yes but it depends largely on what  DB you are hitting against.  Really has nothing to do with DBI. The above query would work perfectly fine in oracle as long as the connection user has permission on all the schema.  Now if you are asking if the above will work across one or more DBDs and different Databases (oracle, files MySQL) then the answer is no. There are drivers out there for example that let Oracle hit LDAP tables and do joins but that is part of the Oracle DB not DBI and DBD.  DBI does not do the join it is the DB that does that. DBI only issues the command Cheers John
> Thanks,
> Andrew
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.