ZSQL Question - Insert multiple rows in one statement?

Mark Phillips <[email protected]> Tue, 24 Aug 2010 08:03:21 -0700
Newsgroups gmane.comp.web.zope.database
Message-ID <[email protected]>
--===============7318708238220399644==
Content-Type: multipart/alternative; boundary=001485f5eb10e890b7048e93100f

--001485f5eb10e890b7048e93100f
Content-Type: text/plain; charset=ISO-8859-1

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

--001485f5eb10e890b7048e93100f
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

When I retrieve multiple values from a selection box, I need to create a lo=
op 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?<br>
<br>My specific example....<br><br>table 1 (Players) has information about =
players (i.e. team members for a sports team). There is a primary key - pla=
yerID<br>table 2 (Seasons) has information about each season - primary key =
is seasonID<br>
table 3 (PlayerSeasons) has two columns - playerID and seasonID. <br><br>Th=
e form to crud a player has a combobox where one can select multiple season=
s 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, o=
r can it be implemented in ZSQL? I looked at the &#39;multiple&#39; keyword=
, but all the examples indicate that it apples to sql tests, such as testin=
g against a set of values. I can&#39;t seem to find any examples where one =
is inserting multiple rows into a table.<br>
<br>Thanks!<br><br>Mark<br>

--001485f5eb10e890b7048e93100f--

--===============7318708238220399644==
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

--===============7318708238220399644==--