[Zope-DB] Building SQL on the fly?

VanL vlindberg@verio.net
Tue, 12 Nov 2002 11:52:06 -0700


I have read through all of the documentation that I can find, but I 
can't see how to represent some needed SQL queries.  For example, having 
a variable number of parameters:


SELECT apples_harvested FROM appletrees
    <dtml-if bugvalue>
    WHERE has_bugs NOT IN (<dtml-in bugvalue><dtml-sqlvar 

So you could call it with the following query string:


and have it execute the following SQL:

SELECT apples_harvested FROM appletrees
    WHERE has_bugs NOT IN ('yes','maybe');

whereas a query string:

would execute
SELECT apples_harvested FROM appletrees;

Does anyone know how to build these sort of queries on the fly?