[Zope-DB] newbie DTML: multiple WHERE

Charlie Clark charlie at egenix.com
Sun May 22 17:12:17 EDT 2005

On 2005-05-22 at 19:43:31 [+0200], Michael Schwartz <mike at ziacom.us> wrote:
> UPDATE myTable
> SET Owner = foo
> Where Id IN (1,2,3,4,5)
> I wish there were more examples up online for ZSQL, especially for those
> of us who are using ZPT, and DTML is somewhat foreign. For example, could
> I use a dtml-sqlgroup or dtml-in to solve this?

Personally I would recommend you use as little DTML as possible in your 
ZSQL as it makes debugging it a lot easier.

The following should work

SET Owner = 'foo'
WHERE id IN <dtml-var ids>

you can user dtml-var to pass in a Python list that will not be quoted.

Charlie Clark

Professional Python Services directly from the Source
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::

More information about the Zope-DB mailing list