Environment =:
Linux Red Hat 7.1
Zope 2.4.0
MySQL 3.23.41
mySQLpython 0.9.0
ZMySQLDA 2.0.7
Installation ok. A warning at the start of Zope says ...
WARNING: Python C API version mismatch for module _mysql:
This Python has API version 1010, module _mysql has version 1007.
I tested _mysql by itself and worked.
I created a DB connection in Zope and tried to run a SELECT * From Members (a table with 580 records) I had this exception error:
Error, _mysql exceptions.OperationalError
Error, _mysql_exceptions.OperationalError: (1064, "You have an error in your SQL syntax near '; LIMIT 1000' at line 1") SQL used:
select * from Members;
Traceback (innermost last):
File /home/zope/zopeweb/lib/python/ZPublisher/Publish.py, line 223, in publish_module
File /home/zope/zopeweb/lib/python/ZPublisher/Publish.py, line 187, in publish
File /home/zope/zopeweb/lib/python/Zope/__init__.py, line 226, in zpublisher_exception_hook
(Object: prova)
File /home/zope/zopeweb/lib/python/ZPublisher/Publish.py, line 171, in publish
File /home/zope/zopeweb/lib/python/ZPublisher/mapply.py, line 160, in mapply
(Object: manage_test)
File /home/zope/zopeweb/lib/python/ZPublisher/Publish.py, line 112, in call_object
(Object: manage_test)
File /home/zope/zopeweb/lib/python/Shared/DC/ZRDB/DA.py, line 400, in manage_test
(Object: prova)
File /home/zope/zopeweb/lib/python/Shared/DC/ZRDB/DA.py, line 378, in manage_test
(Object: prova)
File /home/zope/zopeweb/lib/python/Shared/DC/ZRDB/DA.py, line 493, in __call__
(Object: prova)
File /home/zope/zopeweb/lib/python/Products/ZMySQLDA/db.py, line 252, in query
OperationalError: (see above)
I tried the same query in python, using MySQLdb and _mysql and they worked. The code of dp.py (def query) seems correct, but ....
Any help?
Thanks in advance
Marco Pancotti
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Also, don't put semicolons (;) in Z SQL Methods. If you must use multiple SQL statements, use <dtml-var sql_delimiter>. That is an undocumented Zope feature.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Environment =:
Linux Red Hat 7.1
Zope 2.4.0
MySQL 3.23.41
mySQLpython 0.9.0
ZMySQLDA 2.0.7
Installation ok. A warning at the start of Zope says ...
WARNING: Python C API version mismatch for module _mysql:
This Python has API version 1010, module _mysql has version 1007.
I tested _mysql by itself and worked.
I created a DB connection in Zope and tried to run a SELECT * From Members (a table with 580 records) I had this exception error:
Error, _mysql exceptions.OperationalError
Error, _mysql_exceptions.OperationalError: (1064, "You have an error in your SQL syntax near '; LIMIT 1000' at line 1") SQL used:
select * from Members;
Traceback (innermost last):
File /home/zope/zopeweb/lib/python/ZPublisher/Publish.py, line 223, in publish_module
File /home/zope/zopeweb/lib/python/ZPublisher/Publish.py, line 187, in publish
File /home/zope/zopeweb/lib/python/Zope/__init__.py, line 226, in zpublisher_exception_hook
(Object: prova)
File /home/zope/zopeweb/lib/python/ZPublisher/Publish.py, line 171, in publish
File /home/zope/zopeweb/lib/python/ZPublisher/mapply.py, line 160, in mapply
(Object: manage_test)
File /home/zope/zopeweb/lib/python/ZPublisher/Publish.py, line 112, in call_object
(Object: manage_test)
File /home/zope/zopeweb/lib/python/Shared/DC/ZRDB/DA.py, line 400, in manage_test
(Object: prova)
File /home/zope/zopeweb/lib/python/Shared/DC/ZRDB/DA.py, line 378, in manage_test
(Object: prova)
File /home/zope/zopeweb/lib/python/Shared/DC/ZRDB/DA.py, line 493, in __call__
(Object: prova)
File /home/zope/zopeweb/lib/python/Products/ZMySQLDA/db.py, line 252, in query
OperationalError: (see above)
I tried the same query in python, using MySQLdb and _mysql and they worked. The code of dp.py (def query) seems correct, but ....
Any help?
Thanks in advance
Marco Pancotti
http://www.zope.org/Members/adustman/Tips/no_limits
Also, don't put semicolons (;) in Z SQL Methods. If you must use multiple SQL statements, use <dtml-var sql_delimiter>. That is an undocumented Zope feature.
Thanks, you got it. I used ; after the SQL statement. Now it works.