[Zope-DB] ZSQL Question - Insert multiple rows in one statement?

Andreas Jung lists at zopyx.com
Tue Aug 24 11:06:21 EDT 2010

Hash: SHA1

I would assume that you can use DTML-IN for looping and generating
multiple SQL statements of the same kind. You have to ensure that
the statements having a proper delimiter (there was something in DTML?!
DTML-SQLDELIMITER?...no idea, you need to checks the docs of this
ancient technology).

- -aj

Mark Phillips wrote:
> When I retrieve multiple values from a selection box, I need to create a
> loop somewhere to insert the multiple values (rows) into a table. Is
> there a way to do this within a ZSQL statement, or is it best to do the
> looping in a Python script?
> My specific example....
> table 1 (Players) has information about players (i.e. team members for a
> sports team). There is a primary key - playerID
> table 2 (Seasons) has information about each season - primary key is
> seasonID
> table 3 (PlayerSeasons) has two columns - playerID and seasonID.
> The form to crud a player has a combobox where one can select multiple
> seasons for a player. When I do an add or update, I have to add one or
> more rows to the PlayerSeasons table. Does this loop have to be in a
> Python script, or can it be implemented in ZSQL? I looked at the
> 'multiple' keyword, but all the examples indicate that it apples to sql
> tests, such as testing against a set of values. I can't seem to find any
> examples where one is inserting multiple rows into a table.
> Thanks!
> Mark
> ------------------------------------------------------------------------
> _______________________________________________
> Zope-DB mailing list
> Zope-DB at zope.org
> https://mail.zope.org/mailman/listinfo/zope-db

- -- 
ZOPYX Limited           | zopyx group
Charlottenstr. 37/1     | The full-service network for Zope & Plone
D-72070 Tübingen        | Produce & Publish
www.zopyx.com           | www.produce-and-publish.com
- ------------------------------------------------------------------------
E-Publishing, Python, Zope & Plone development, Consulting

Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: lists.vcf
Type: text/x-vcard
Size: 316 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-db/attachments/20100824/7935a0d8/attachment.vcf 

More information about the Zope-DB mailing list