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

ctb qlli at ctb.pku.edu.cn
Sun Jul 18 08:45:42 EDT 2004


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. :(
Many thanks for your kindly reply.
        
        


在2004年07月17日的02:43,Dieter Maurer写道:
> Qingliang Li wrote at 2004-7-16 21:15 +0800:
> >Thanks for your relply. Maybe I can't state my question clearly.
> >I mean it raise error when i try the following example:
> >
> >    select * from BAMD
> >       <dtml-sqlgroup where>
> >            .....
> >       <dtml-sqltest ID op=<dtml-var myOperation> type=nb optional>
> >            .....
> >
> >where the myOperation is a variable (it could be "eq", "gt", etc.).
> >Is there a method that can handle such a problem?
> 
> You cannot use "dtml-sqltest" when the operator is not a constant.
> 
> In this case, must must emulate it by more primitive constructs,
> e.g.
> 
>    <dtml-if ID>ID &dtml-myOperation; <dtml-sqlvar ID type=string></dtml-if>
-- 
Qingliang Li
Center for Theoretical Biology,
Peking University, Beijing,
P.R.China, 100871
                                                                                
Email: qlli at ctb.pku.edu.cn
Tel: +86-010-6275-9669




More information about the Zope-DB mailing list