[Zope-DB] DCOracle2 problems with Duplicate column names

Mark Evans wavecat01@attbi.com
Fri, 05 Jul 2002 10:31:37 -0700


Hi,

I have looked through the archives and I don't see a problem like this, so
here
goes.

We are using Zope 2.5.1 on Solaris8 with Python2.1.1  We have several Oracle
8.1.7 databases running on W2K platforms that we are trying to access from
Zope.
If you have the following situation in Oracle:

SQL> desc table1
 Name            Type
 ----------------------
 FIELD1          VARCHAR2(10)
 FIELD2          VARCHAR2(10)

SQL> desc table2
 Name            Type
 --------------- ------------
 FIELD1          VARCHAR2(10)
 FIELD2          VARCHAR2(10)

SQL> insert into table1 values ('Tom', '1');
SQL> insert into table2 values ('Clancy','1');
SQL> insert into table1 values ('David','2');
SQL> insert into table2 values ('Eddings','2');

Then you commit and execute this SQL from the SQL prompt

SELECT a.field1, b.field1
FROM   table1 a, table2 b
WHERE  a.field2=b.field2;

you get the result:

FIELD1     FIELD1
---------- ----------
Tom        Clancy
David      Eddings

However, when we execute this through a Z SQL Method, using a database
connection that we have proven works in other cases, we get the following
error:

Error, exceptions.ValueError: Duplicate column name, FIELD1
SQL used:
select a.field1, b.field1
from table1 a, table2 b
where a.field2=b.field2

Traceback (innermost last):
  File
/ulocal/local/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publis
h.py,

line 150, in publish_module
  File
/ulocal/local/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publis
h.py,

line 114, in publish
  File
/ulocal/local/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/Zope/__init__.py,
line 158, in zpublisher_exception_hook
    (Object: tabletest1)
  File
/ulocal/local/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publis
h.py,

line 98, in publish
  File
/ulocal/local/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/mapply
.py,
line 88, in mapply
    (Object: manage_test)
  File
/ulocal/local/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/ZPublisher/Publis
h.py,

line 39, in call_object
    (Object: manage_test)
  File
/ulocal/local/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/Shared/DC/ZRDB/DA
.py,
line 328, in manage_test
    (Object: tabletest1)
  File
/ulocal/local/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/Shared/DC/ZRDB/DA
.py,
line 306, in manage_test
    (Object: tabletest1)
  File
/ulocal/local/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/Shared/DC/ZRDB/DA
.py,
line 436, in __call__
    (Object: tabletest1)
  File
/ulocal/local/zope/Zope-2.5.0-solaris-2.6-sparc/lib/python/Shared/DC/ZRDB/Re
sults.py,

line 52, in __init__
ValueError: (see above)

Can someone explain what is happening here?  It seems that Zope/DCOracle is
not
properly recognizing table ownership. Our actual problem resulted from
accessing
tables across different owners schemas, but it boils down to this and is
reproducible on multiple database machines.

Thanks,

Mark Evans

mark.evans.b@bayer.com