[Zope-DB] newbie DTML: multiple WHERE

Michael Schwartz mike at ziacom.us
Sun May 22 13:43:31 EDT 2005


I'd like to pass in a string and a list to a ZSQL method.
For example:
    user: foo
    ids: [1, 2, 3, 4, 5]

I'd like to create a ZSQL method that does an update on multiple rows.
For example:

Arguments: user, ids
            (string, list)

UPDATE myTable
SET Owner = <dtml-sqlvar user type="string">
WHERE Id IN <dtml-sqltest ids type=int multiple>


I'd like the SQL to look like this:

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?

tia!

- Mike


More information about the Zope-DB mailing list