[Zope] Simple query using ZMySQLDA => (1064, "You have an error in your SQL syntax near ' LIMIT 1000' at line 2")

Thomas Weholt t-weh@online.no
Thu, 11 Jul 2002 23:50:46 +0200


I'm trying to use a very simple SQL query against a MySQL database, a
sql-method called sqlViewMovieReview taking one parameter emr_id, an
integer-value:

select * from elope_moviereviews
where emr_id = <dtml-var emr_id><dtml-var sql_delimiter>

It works great then tested in the ZMI-test interface, but fails when used in
a page, like when i test it like so :
http://localhost:8080/MovieReviews/dmMovieReviewDetails?emr_id=4

Error reported : (1064, "You have an error in your SQL syntax near ' LIMIT
1000' at line 2")

The DTML Method used over :

<dtml-with expr="sqlViewMovieReview(emr_id='<dtml-var emr_id>')">
  <dtml-var title>
</dtml-with>

Looked around on the net and found some references to the error, for
instance http://linux.bryanconsulting.com/stories/storyReader$75.

Added the <dtml-var sql_delimiter> but the error is still there. I'm using
Zope 2.5.1 and ZMySQLDA 2.0.9.

Any clues ??

Best regards,
Thomas Weholt