[Zope-DB] "Variable variables" (sort of)

Dieter Maurer dieter at handshake.de
Wed Sep 17 16:10:50 EDT 2003


Matthew Lindfield Seager wrote at 2003-9-17 17:18 +1000:
 > ...
 > When the user hits submit I'd like to automatically have all 10 sql 
 > queries executed with the different variables
 > 
 > UPDATE table
 >    SET name=<dtml-sqlvar name1 type=string>, gender=<dtml-sqlvar 
 > gender1 type=string>
 >    WHERE <dtml-sqltest id1 column=id type=int>;
 > UPDATE table
 >    SET name=<dtml-sqlvar name2 type=string>, gender=<dtml-sqlvar 
 > gender2 type=string>
 >    WHERE <dtml-sqltest id2 column=id type=int>;
 > etc...;

Thus, you have one Z SQL Method that you call in a loop.

Read about ZPublisher's ":records" packager:

  <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>

You must also use that Z SQL Methods accept keyword argument
(as an alternative to "REQUEST" argument passing).
The Zope Book should tell you more.


Dieter



More information about the Zope-DB mailing list