Re: ZSQL Question - Insert multiple rows in one statement?
Andreas Jung <[email protected]> Tue, 24 Aug 2010 17:06:21 +0200
| Newsgroups | gmane.comp.web.zope.database |
|---|---|
| Organization | ZOPYX Ltd & Co. KG |
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. --------------080602010906050008070204 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable -----BEGIN PGP SIGNED MESSAGE----- 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? >=20 > My specific example.... >=20 > 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. >=20 > 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 an= y > examples where one is inserting multiple rows into a table. >=20 > Thanks! >=20 > Mark >=20 >=20 > -----------------------------------------------------------------------= - >=20 > _______________________________________________ > Zope-DB mailing list > [email protected] > https://mail.zope.org/mailman/listinfo/zope-db - --=20 ZOPYX Limited | zopyx group Charlottenstr. 37/1 | The full-service network for Zope & Plone D-72070 T=FCbingen | Produce & Publish www.zopyx.com | www.produce-and-publish.com - -----------------------------------------------------------------------= - E-Publishing, Python, Zope & Plone development, Consulting -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQGUBAEBAgAGBQJMc9/tAAoJEADcfz7u4AZjlPwLwNiLG+kZUrlZ+BuFEWKL42eE bmzllHixdEq6qy2gHP3pbf5AmICS66JJGfqaI6Gv7JqxY6XM1N35oeXK7PzUk+gb PYPtIwN62HMQzrvYXB6JHyFEkyMuOd9MFyyHMgh24JqC6xtMBbYI3+yjiXJor1QP Xd56qoxWmhHZVnC2YhddpR3DLlAx/qebi2mk+C15g2C+LkVzz0J2rHb5FNB/Izdt uJmknn9pDjBewSQhtPIsX/rj7R4SUtJUZ78H8Isn2yoEftsG4ONtpzT3O9ICXF4R Y4V/iV9KepUoxU5dpH9YDTl00YA6UVvyafhDufkPzq5dnKUQL+QzPXFcmC9tSRux OIDiTOLZwYVS0a5hT/OUtYB1p+JGhITxLKxspXH4vJ5po8IJR7CmxO0FOooqGeOc muaWclDrxPIsyWEAEZg6+ahyydWgFCePuMLCrEEvhZRpx4DxvhisXRVB5V/h6Z7L OSSYDljCM/mu1mKIPRUuHqBlc0mB4qI=3D =3D1o0Q -----END PGP SIGNATURE----- --------------080602010906050008070204 Content-Type: text/x-vcard; charset=utf-8; name="lists.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="lists.vcf" begin:vcard fn:Andreas Jung n:Jung;Andreas org:ZOPYX Ltd. & Co. KG adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany email;internet:[email protected] title:CEO tel;work:+49-7071-793376 tel;fax:+49-7071-7936840 tel;home:+49-7071-793257 x-mozilla-html:FALSE url:www.zopyx.com version:2.1 end:vcard --------------080602010906050008070204 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Zope-DB mailing list [email protected] https://mail.zope.org/mailman/listinfo/zope-db --------------080602010906050008070204--