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

Dieter Maurer dieter@handshake.de
Fri, 12 Jul 2002 21:37:22 +0200


Thomas Weholt writes:
 > ...
 > <dtml-with expr="sqlViewMovieReview(emr_id='<dtml-var emr_id>')">
 >   <dtml-var title>
 > </dtml-with>
A standard error. It happened thousand of times...

You pass the literal string '<dtml-var emr_id>' to your Z SQL method.
This gives a funny SQL statement.

Use "emr_id=emr_id" instead to pass the value of "emr_id".

You said "emr_id" should be an integer?
Then, you should either use "emr_id:int=..." in your query string
(or as form variable name) or "emr_id=_.int(emr_id)" to convert
the string into an integer.


Dieter