No you cannot join tables from two different databases.

On Thursday, 29 August 2013 08:45:49 UTC-5, Gallien Labeyrie wrote:
>
> Hi, 
>
> I'm connecting to multiple MySQL databases through Web2Py. So far 
> everything works fine! 
> But for some dumb reasons, my databases do not follow usual good design 
> practices. 
> For example some of  the tables foreign keys refer to a different database 
> (which is surprisingly possible (!) because MySql seem to understand  a 
> database more like a 'schema' ....)
>
> So I'm wondering, Is it possible to use the DAL functions to query them 
> and make JOIN even though they are referring another database?
> or will I still have to stick to the old school *db.executesql()* ?
>
> I tried : 
> * db1(db1.tableA.some_fk_id==**db2.tableB.primary_key_id).**select()*
> which returns : 
> * *** AttributeError: 'DAL' object has no attribute 'tableB'*
> which is true but.. perhaps there is a way to do it :/
>
> thanks for the help, 
> Gallien
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to