[web2py] Re: joins across databases

2011-12-03 Thread Jim Gregory
FWIW, this is what I ended up doing (for anyone's future reference): in controller: data = db(db.table1.field1=value).select(db.table1.field1, db.table1.field2) for (i, row) in enumerate(data): lookupvalue = row.table1.field2 data[i].field3 = db2.table2(field2=lookupvalue).field3 r

[web2py] Re: joins across databases

2011-12-02 Thread Jim Gregory
What's the easiest way to construct my own rows object from data across two databases? Can I create a class that inherits from the Rows class? Or is there something even simpler? -Jim On Dec 1, 6:15 pm, Vinicius Assef wrote: > I think you have to define 2 db objects. > > 1) Retrieve data from

[web2py] Re: joins across databases

2011-12-01 Thread lyn2py
Ouch I thought it's within the same database. Sorry. On Dec 2, 10:19 am, Vinicius Assef wrote: > Inner joins between two different databases?! > > I understood Jim were talking about a lagacy database and his app > database. Two different db's. > > If we're talking about the same database, I'm wi

Re: [web2py] Re: joins across databases

2011-12-01 Thread Bruno Rocha
With two databases will work only if you have linked-servers in your backend. I did it with MSSQL two databases linked and some views defined in DB. so in web2py I defined the views as tables.

Re: [web2py] Re: joins across databases

2011-12-01 Thread Vinicius Assef
Inner joins between two different databases?! I understood Jim were talking about a lagacy database and his app database. Two different db's. If we're talking about the same database, I'm with you, lyn2py. -- Vinicius Assef. On Thu, Dec 1, 2011 at 11:35 PM, lyn2py wrote: > Definitely possible

[web2py] Re: joins across databases

2011-12-01 Thread lyn2py
Definitely possible. Take a look at the examples here: http://web2py.com/book/default/chapter/06#Inner-Joins On Dec 2, 7:40 am, Jim Gregory wrote: > I have a legacy database that my app needs to connect to.  The data in > my app's table has a many-to-one relationship with the data in the > legac