[Zope-DB] How to send comparison operations (such as > = ) to Z SQL?

Dieter Maurer dieter at handshake.de
Mon Jul 19 13:47:40 EDT 2004


ctb wrote at 2004-7-18 20:45 +0800:
>I followed your instruction to modify my code, but the it raise error
>like this:
>
>	Error, _mysql_exceptions.ProgrammingError: (1064, "You have an 	error
>in your SQL syntax near '; 500 LIMIT 1000' at line 3") 
>________________________________________________________________________
>	SQL used:
>        	select * from BAMD
>        	where
>        	MolecularWeight > 500
>        
>        
>        ________________________________________________________________
>	Error Value  
>        	(1064, "You have an error in your SQL syntax near '; 500 	LIMIT
>        1000' at line 3") 
>
>
>Note: The SQL code  it generated is correct, for it can be executed in
>other environment. I can't find any solution to such a problem. :(

When you carefully read the "Error value" (you should always do that),
you can recognize that the database sees a ";" in place of (maybe
in addition to) the ">".

I do not know where it comes from but you can
replace "&dtml-myOperation;" by "<dtml-var myOperation>"
and see whether it goes away.
If not, check that "myOperation" does not contain a trailing ";".

-- 
Dieter


More information about the Zope-DB mailing list