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

Egon Frerich e.frerich@nord-com.net
Sat, 13 Jul 2002 08:26:43 +0200


Am 12 Jul 2002, um 12:00 hat zope-request@zope.org geschrieben:

> --__--__--
> 
> Message: 8
> From: "Thomas Weholt" <t-weh@online.no>
> To: <zope@zope.org>
> Date: Thu, 11 Jul 2002 23:50:46 +0200
> Subject: [Zope] Simple query using ZMySQLDA => (1064, "You have an error in your SQL syntax near ' LIMIT 1000' at line 2")
> 
> 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>

Did you try?
where emr_id = <dtml-sqlvar emr_id type="int">

Egon


> 
> 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
> 
> 
> 
> 
> --__--__--
>