Z SQL Method: Error in select with limit (mysql)
On Tuesday, May 20, 2003, at 03:08 AM, Patrick Ulmer wrote:
the select-statement for mysql i used in a "Z SQL Method"-object
select gruppe as art from test order by gruppe limit 0, 1
produce the following errormessage
Error Value: (1064, "You have an error in your SQL syntax near 'LIMIT 1000' at line 1")
why?
Because Zope will automatically add the LIMIT 1000 to every ZSQL method as a precaution. To explicitly disable this so that you can set your own limit clause, you have to follow a little trick. In your ZSQL method, make the first line a comment, and then write your SQL. Like this: # ; select gruppe as art from test order by gruppe limit 0, 1 ___/ / __/ / ____/ Ed Leafe http://leafe.com/ http://opentech.leafe.com
participants (2)
-
Ed Leafe -
Patrick Ulmer