Re: ZSQL Question - Insert multiple rows in one statement?

Mark Phillips <[email protected]> Tue, 24 Aug 2010 13:32:29 -0700
Newsgroups gmane.comp.web.zope.database
Message-ID <[email protected]>
--===============2737924233143685889==
Content-Type: multipart/alternative; boundary=0015175cd592f9dcd4048e97a991

--0015175cd592f9dcd4048e97a991
Content-Type: text/plain; charset=ISO-8859-1

Thanks everyone for their help. I decided to do the looping in the Python
Controller Script instead of dtml...much easier and faster to put it
together!

Mark

On Tue, Aug 24, 2010 at 9:48 AM, Garry Saddington <
[email protected]> wrote:

> Garry Saddington wrote:
> > Andreas Jung wrote:
> >> -----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).
> >
> oops:
> <dtml-var sql_delimiter>
> code in snippets is correct though.
> sorry
> Garry
>
> > Andreas is correct but the delimiter is <dtml-sql_delimiter>.
> > Probably better to do this in python script, but here are some code
> > snippets to help you:
> > In the form:
> >
> > <select name="seasons:list" multiple="multiple">
> >
> > In the ZSQL method:
> >
> > <dtml-in seasons>
> > <dtml-var sql_delimiter>
> >
> > insert statement goes here, don't forget the ; at the end.
> >
> > </dtml-in>
> >
> > Hope this is of some help, others may want to chip in with other
> > suggestions, such as doing the same in python. Anyway good luck.
> > Garry
> > _______________________________________________
> > Zope-DB mailing list
> > [email protected]
> > https://mail.zope.org/mailman/listinfo/zope-db
> >
>
> _______________________________________________
> Zope-DB mailing list
> [email protected]
> https://mail.zope.org/mailman/listinfo/zope-db
>

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

Thanks everyone for their help. I decided to do the looping in the Python C=
ontroller Script instead of dtml...much easier and faster to put it togethe=
r!<br><br>Mark<br><br><div class=3D"gmail_quote">On Tue, Aug 24, 2010 at 9:=
48 AM, Garry Saddington <span dir=3D"ltr">&lt;<a href=3D"mailto:garry@schoo=
lteachers.co.uk">[email protected]</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class=3D"im"=
>Garry Saddington wrote:<br>
&gt; Andreas Jung wrote:<br>
&gt;&gt; -----BEGIN PGP SIGNED MESSAGE-----<br>
&gt;&gt; Hash: SHA1<br>
&gt;&gt;<br>
&gt;&gt; I would assume that you can use DTML-IN for looping and generating=
<br>
&gt;&gt; multiple SQL statements of the same kind. You have to ensure that<=
br>
&gt;&gt; the statements having a proper delimiter (there was something in D=
TML?!<br>
&gt;&gt; DTML-SQLDELIMITER?...no idea, you need to checks the docs of this<=
br>
&gt;&gt; ancient technology).<br>
&gt;<br>
</div>oops:<br>
&lt;dtml-var sql_delimiter&gt;<br>
code in snippets is correct though.<br>
sorry<br>
<font color=3D"#888888">Garry<br>
</font><div class=3D"im"><br>
&gt; Andreas is correct but the delimiter is &lt;dtml-sql_delimiter&gt;.<br=
>
&gt; Probably better to do this in python script, but here are some code<br=
>
&gt; snippets to help you:<br>
&gt; In the form:<br>
&gt;<br>
&gt; &lt;select name=3D&quot;seasons:list&quot; multiple=3D&quot;multiple&q=
uot;&gt;<br>
&gt;<br>
&gt; In the ZSQL method:<br>
&gt;<br>
&gt; &lt;dtml-in seasons&gt;<br>
&gt; &lt;dtml-var sql_delimiter&gt;<br>
&gt;<br>
&gt; insert statement goes here, don&#39;t forget the ; at the end.<br>
&gt;<br>
&gt; &lt;/dtml-in&gt;<br>
&gt;<br>
&gt; Hope this is of some help, others may want to chip in with other<br>
&gt; suggestions, such as doing the same in python. Anyway good luck.<br>
&gt; Garry<br>
</div><div><div></div><div class=3D"h5">&gt; ______________________________=
_________________<br>
&gt; Zope-DB mailing list<br>
&gt; <a href=3D"mailto:[email protected]">[email protected]</a><br>
&gt; <a href=3D"https://mail.zope.org/mailman/listinfo/zope-db" target=3D"_=
blank">https://mail.zope.org/mailman/listinfo/zope-db</a><br>
&gt;<br>
<br>
_______________________________________________<br>
Zope-DB mailing list<br>
<a href=3D"mailto:[email protected]">[email protected]</a><br>
<a href=3D"https://mail.zope.org/mailman/listinfo/zope-db" target=3D"_blank=
">https://mail.zope.org/mailman/listinfo/zope-db</a><br>
</div></div></blockquote></div><br>

--0015175cd592f9dcd4048e97a991--

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

--===============2737924233143685889==--