FAQ
I will have to insert a couple of rows into a table. Exec only gives me the
option to do this by row. Is there any option to prepare an statement, bind
multiple rows and execute this at once? I would like to avoid to hit the
wire 50 times for inserting 50 rows.

Sure, I could assemble "INSERT INTO a(col1, col2) VALUES (1,2), (3,4) ... "
by hand, but I would loose the security of prepared statements.

Johann

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Brad Fitzpatrick at Mar 31, 2013 at 6:20 am
    Not currently.

    File a bug with what the API feels like it another language or two.


    On Sat, Mar 30, 2013 at 1:25 AM, Johann Höchtl wrote:

    I will have to insert a couple of rows into a table. Exec only gives me
    the option to do this by row. Is there any option to prepare an statement,
    bind multiple rows and execute this at once? I would like to avoid to hit
    the wire 50 times for inserting 50 rows.

    Sure, I could assemble "INSERT INTO a(col1, col2) VALUES (1,2), (3,4) ...
    " by hand, but I would loose the security of prepared statements.

    Johann

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Johann Höchtl at Mar 31, 2013 at 9:24 am

    On 03/31/2013 08:20 AM, Brad Fitzpatrick wrote:
    Not currently.

    File a bug with what the API feels like it another language or two.
    Thank you, http://code.google.com/p/go/issues/detail?id=5171
    Mentioning C# and Python DB API proposal 2.0
    On Sat, Mar 30, 2013 at 1:25 AM, Johann Höchtl wrote:

    I will have to insert a couple of rows into a table. Exec only gives
    me the option to do this by row. Is there any option to prepare an
    statement, bind multiple rows and execute this at once? I would like
    to avoid to hit the wire 50 times for inserting 50 rows.

    Sure, I could assemble "INSERT INTO a(col1, col2) VALUES (1,2),
    (3,4) ... " by hand, but I would loose the security of prepared
    statements.

    Johann

    --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to golang-nuts+unsubscribe@googlegroups.com
    For more options, visit https://groups.google.com/groups/opt_out.


    --
    Dr. Johann Höchtl
    http://www.facebook.com/myprivate42
    https://plus.google.com/109572797756514902540

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMar 30, '13 at 8:25a
activeMar 31, '13 at 9:24a
posts3
users2
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase