[Zope-DB] HowTo access query fields of multiple tables?

Dieter Maurer dieter@handshake.de
Fri, 26 Apr 2002 22:15:32 +0200


maverick121@gmx.de writes:
 >  SELECT tableA.name, tableB.name
 >  FROM tableA, tableB 
 >  WHERE ...
 >  
 > The query works well in the ZSQL test view. 
 > But how can I access the content of the .name fields in a dtml-var tag?
 > I tried it with:
 >  
 >  <dtml-in myquery>
 >    <dtml-var tableA.name>
 >    <dtml-var tableB.name>
 >  </dtml-in>
 >  
 >  ... this doesn't work.
 >  I also tried renaming the fields in SQL:
 > 
 >  SELECT tableA.name AS Aname, tableB.name AS BName
 >  FROM tableA, tableB 
 >  WHERE ...
 >  
 >  <dtml-in myquery>
 >    <dtml-var Aname>
 >    <dtml-var Bname>
 >  </dtml-in>
 > 
 >  but this also results in an error.
Both should work.

  What error do you get?


Dieter