[Zope] multiple INSERT in one sql method

Craig Allen cba@mediaone.net
Fri, 02 Jul 1999 22:38:46 -0400


Larry Luther wrote:
> Yes, I'm using Gadfly and have:
> INSERT INTO table VALUES ( 'a', 'b', 'c', ... );
> INSERT INTO table VALUES ( 'd', 'e', 'f', ... );
> ...
> INSERT INTO table VALUES ( 'p', 'q', 'r', ... )
> * Note the semicolon after all INSERTs but the last.
> 
... And here's one way to implement this logic (ain't it great how all these
tricks are built into Zope for when you need them!):
<!--#with REQUEST-->
  delete from rests where rest_index in (
    <!--#in delkey-->
      '<!--#var sequence-item-->'
      <!--#unless sequence-end-->
        ,
      <!--#/unless-->
    <!--#/in-->
    )       
<!--#/with-->

Note that I'm deleting rows here, but same idea...
- Craig
-- 
Craig Allen  - Managing Partner - Mutual Alchemy
Web Architecture - http://alchemy.nu