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 -~----------~----~----~----~------~----~------~--~---
