[Zope] Joins can be tricky (was "how to join two table?")
Anthony Baxter
Anthony Baxter <anthony@interlink.com.au>
Tue, 23 Nov 1999 22:49:54 +1100
>>> "Shalabh Chaturvedi" wrote
> | When you join two tables which have column names in common and do select
> | both columns from each table than Zope raises an error:
> |
> | Error, exceptions.ValueError: Duplicate column name, ID
> |
> | In this case "ID" was a common column name among the two tables. What
> | happens is logical and expected, Zope cannot deal with two variables with
> | the same name in the same namespace!
>
> This should probably be handled by zope as it is by SQL: the names of
> the variables become: tablename.columnname (clients.id and columns.id in
> the example below). No ?
It's up to the DB interface - what does it return in the description of
the column. I know it varies from RDBMS to RDBMS. You're safer to just
specify it explicitly with 'as foo', anyway.
(next time people are considering zope mailing list splits - probably
an aqueduct list (or zope-rdbms) would be one to split off... no?)
Anthony