[Zope] SQL-Query works with MySQL-monitor but not with ZMySQLDA

2000-05-29 Thread Andy Pahne



Hi, there,

if I use my mysq-monitor to execute the following query, everything works
fine:

 SELECT YEAR(START_DATE) FROM EVENT;

but it doesn't work via the ZMySQLDA!?!

Here's the traceback:

Error, exceptions.KeyError: unhandled

Traceback (innermost last):
  File /zope/ttl/Zope-2.0.1-src/lib/python/ZPublisher/Publish.py, line 214,
in publish_module
  File /zope/ttl/Zope-2.0.1-src/lib/python/ZPublisher/Publish.py, line 179,
in publish
  File /zope/ttl/Zope-2.0.1-src/lib/python/Zope/__init__.py, line 201, in
zpublisher_exception_hook
(Object: sql_get_years_unique)
  File /zope/ttl/Zope-2.0.1-src/lib/python/ZPublisher/Publish.py, line 165,
in publish
  File /zope/ttl/Zope-2.0.1-src/lib/python/ZPublisher/mapply.py, line 160,
in mapply
(Object: manage_test)
  File /zope/ttl/Zope-2.0.1-src/lib/python/ZPublisher/Publish.py, line 102,
in call_object
(Object: manage_test)
  File /zope/ttl/Zope-2.0.1-src/lib/python/Shared/DC/ZRDB/DA.py, line 316,
in manage_test
(Object: sql_get_years_unique)
  File /zope/ttl/Zope-2.0.1-src/lib/python/Shared/DC/ZRDB/DA.py, line 297,
in manage_test
(Object: sql_get_years_unique)
  File /zope/ttl/Zope-2.0.1-src/lib/python/Shared/DC/ZRDB/DA.py, line 401,
in __call__
(Object: sql_get_years_unique)
  File /zope/ttl/Zope-2.0.1-src/lib/python/Products/ZMySQLDA/db.py, line
191, in query
KeyError: (see above)





Andy Pahne
ap@net22

net22 GmbH
Bad Meinberger Strasse 1
32760 Detmold
Tel.: 05231 - 580 640



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] SQL-Query works with MySQL-monitor but not with ZMySQLDA

2000-05-29 Thread Tino Wildenhain

Hi Andy,



Andy Pahne wrote:
 
 Hi, there,
 
 if I use my mysq-monitor to execute the following query, everything works
 fine:
 
  SELECT YEAR(START_DATE) FROM EVENT;
 
 but it doesn't work via the ZMySQLDA!?!
 
 Here's the traceback:
 
 Error, exceptions.KeyError: unhandled
 
Please try:

SELECT YEAR(START_DATE) AS START_YEAR FROM EVENT

in your query.
(I hope MySQL supports renaming)
The problem seems zope does not get a name for the calculated column.

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )