[Zope] Multiple SQL Updates

Thomas B. Passin tpassin@mitretek.org
Thu, 26 Apr 2001 13:24:57 -0400


This is really an SQL syntax question.  You probably want

where meeting_ref in (val1,val2,...)

You want to get Zope to create a comma-separated list for you, and insert it
into the update statement.

Tom P

Craig Stoddart asked -

I have a simple <DTML-Method> that displays multiple records as the result
of a
query. One of the fields displayed is to be updated. What I would like to
know
is how to get the form to work so that several records can have that one
field
updated at the same time. I can get it to work easily to update one record
at a
time, but would like to allow up to 25 records to be updated at once - is
this
possible?

This is the update query:

update cmin_meeting
set committee_code=<dtml-sqlvar committee_code type=int>
where meeting_ref=<dtml-sqlvar meeting_ref type=int>

But this code only works for one individual record on its own, not multiple
records.