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 ) On Jun 8, 9:45 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2007-06-08 at 13:08 +0000, [EMAIL PROTECTED] wrote: > > It would be nice if both the trunk as well as multi db fully > > qualilfied all field names with db.table.field name.... > > Where would you want it to do that? > > You can't just do it everywhere that the field name is used in SQL, > because it would lead to (a) invalid SQL and (b) would not avoid the > problem that you can only talk to one database at a time, so you need to > collect fields together based on their database name. > > 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 -~----------~----~----~----~------~----~------~--~---
