[Zope-DB] Re: How to import SQL in python script?

Martin Gebert Murphy@members.netsolution-net.de
Mon, 10 Feb 2003 17:21:46 +0100


eijgnit@netscape.net schrieb:
> Charlie Clark <charlie@begeistert.org> wrote:
> I am trying to query a database using a SQL statement whose WHERE clause
> is dependent on some variables. For example, if this condition is true, I would use this WHERE clause and use another WHERE clause if the condition is false (Actually it's not only the WHERE clause that is dynamic, I might query another table based on some other parameters). Previously I created a ZSQLMethod object with a lot of <dtml-if>s inside and it worked for me. However, I find modifying the object very confusing after a while. Basically my requirement is to build up a sql statement "on-the-fly" and, query the database with it and finally display the results
> 
What about using dtml-sqlgroup? See the appropriate chapter in the ZopeBook...

Martin