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"><<a href=3D"mailto:garry@schoo= lteachers.co.uk">[email protected]</a>></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> > Andreas Jung wrote:<br> >> -----BEGIN PGP SIGNED MESSAGE-----<br> >> Hash: SHA1<br> >><br> >> I would assume that you can use DTML-IN for looping and generating= <br> >> multiple SQL statements of the same kind. You have to ensure that<= br> >> the statements having a proper delimiter (there was something in D= TML?!<br> >> DTML-SQLDELIMITER?...no idea, you need to checks the docs of this<= br> >> ancient technology).<br> ><br> </div>oops:<br> <dtml-var sql_delimiter><br> code in snippets is correct though.<br> sorry<br> <font color=3D"#888888">Garry<br> </font><div class=3D"im"><br> > Andreas is correct but the delimiter is <dtml-sql_delimiter>.<br= > > Probably better to do this in python script, but here are some code<br= > > snippets to help you:<br> > In the form:<br> ><br> > <select name=3D"seasons:list" multiple=3D"multiple&q= uot;><br> ><br> > In the ZSQL method:<br> ><br> > <dtml-in seasons><br> > <dtml-var sql_delimiter><br> ><br> > insert statement goes here, don't forget the ; at the end.<br> ><br> > </dtml-in><br> ><br> > Hope this is of some help, others may want to chip in with other<br> > suggestions, such as doing the same in python. Anyway good luck.<br> > Garry<br> </div><div><div></div><div class=3D"h5">> ______________________________= _________________<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> ><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==--