Right...I understand that.... although, based on information from another post (yesterday I believe) I don't think that is working right now, unless the poster was doing something incorrectly... he hasn't answered my reply, so I'm not sure as of yet.
But in the case that one was using the same database backend, it would be nice to be able to do this, and in the case that all of the databases were on the same mysql server, and had the same login credentials, it would most likely work in the trunk too if all of the fields were fully qualified ... I'm not saying they'd want to officially support it or anything... it was just something I had thought about and figured I'd mention. We currently have all of our DBs on the same server, but at some point may have to move them to separate servers for legal reasons, at which point, my DBA's queries will of course break, but I had hoped to get the cross-db foreign key queries working by that time through the multi-db branch ( this requirement is a ways off for us ). On Jun 8, 10:51 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2007-06-08 at 14:49 +0000, [EMAIL PROTECTED] wrote: > > We had the need to run some reports across databases, and this > > limitation in the django multi-db branch prevented me from doing them > > correctly...so our DBA wrote up some code using mysqldb that executes > > queries across the dbs... not sure if it is just valid in mysql. Our > > dbs are currently all on the same server w/ the same login > > credentials.... this is his sql... some of it is being replaced by > > variable values in code...but he is doing queries across dbs...and it > > works... its much longer than what is below...but just pasted a part > > of it :) > > > select tag, office_name, state, loan_number, loan_amount from ( > > (select distinct(11) as tag, rtrim(concat(c.company_name,': > > ',o.office_name)) as office_name,'State' as state , 'Loan Number' as > > loan_number, 'Loan Amount' as loan_amount , concat( c.company_name, > > o.office_name ) as seq > > from mortgagedb.mortgage as m, > > mortgagedb.address as a , > > userdb.office as o, > > userdb.company as c > > where m.address_id = a.address_id > > and o.office_id = m.originator_office_id > > and c.company_id = m.originator_company_id ) > > As far as I remember from Jay's original work, multidb didn't require > that every database used the same backend server. So this sort of thing > won't work if some of the fields are in a MySQL database and some are in > a PostgreSQL database, for example. > > Regards, > Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
