[Zope-DB] PsycoPG adaptor problem?

Dieter Maurer dieter@handshake.de
Tue, 12 Nov 2002 20:40:07 +0100


VanL writes:
 > I have what appears to be a legal SQL query that gives me a valueerror 
 > when I try to run it from a ZSQL method.
 > 
 > SELECT * FROM account A,
 > customer C,
 > legacy L,
 > target T,
 > WHERE C.id = A.cid
 > AND LA.id = A.lid
 > AND TA.id = A.tid
 > AND A.name like <dtml-sqlvar name type="string">;
 > 
 > Running this from psql gives no error. Running this from the ZSQL Method 
 > gives:
 > 
 > *Error, /exceptions.ValueError/:* Duplicate column name, id
Zope wants to make the field values available as attributes
of the result object. This is made impossible because two fields
have the same id.

You might try: "SELECT C.*, L.* ...".
I am not sure whether it will work. But, you might try it.


Dieter