Professional Web Applications Themes

Multi queries - MySQL

Hi all I have a great trubble with multi queries and api C. MySql database is 5.0 the connection is set as follow if (! mysql_real_connect(self->mysql, server, username, password, database, port, NULL, CLIENT_COMPRESS | CLIENT_MULTI_STATEMENTS)) { /* error message */ result = FALSE; } When I send multi-queries as follow insert into tab1 (columns....) values (values...); insert into tab1 (columns....) values (values...);insert into tab1 (columns....) values (values...);insert into tab1 (columns....) values (values...);insert into tab1 (columns....) values (values...);insert into tab1 (columns....) values (values...); For performance reason the query can be composed with up to 50 queries. Some queries succed Some queries ...

  1. #1

    Default Multi queries

    Hi all
    I have a great trubble with multi queries and api C.
    MySql database is 5.0
    the connection is set as follow

    if (! mysql_real_connect(self->mysql,
    server,
    username,
    password,
    database,
    port,
    NULL,
    CLIENT_COMPRESS | CLIENT_MULTI_STATEMENTS)) {

    /* error message */

    result = FALSE;
    }


    When I send multi-queries as follow

    insert into tab1 (columns....) values (values...); insert into tab1
    (columns....) values (values...);insert into tab1 (columns....) values
    (values...);insert into tab1 (columns....) values (values...);insert
    into tab1 (columns....) values (values...);insert into tab1
    (columns....) values (values...);

    For performance reason the query can be composed with up to 50 queries.

    Some queries succed
    Some queries are rejected but I find the lines in tables.
    Some queries are rejected and I do not find lines in tables.

    The same program works fine when I use Oracle or MSSql.

    Did I forget something, Is there something wrong.
    Do you know a problem with the multi-queries.
    Is there a restriction ?

    An Idea ?

    Thanks and best regards.

    Fagotto
    fagotto Guest

  2. #2

    Default Re: Multi queries

    fagotto wrote: 

    So why use multi queries?

    insert into tab1 (columns....) values (values...), (values...),
    (values...), (values...), ...

    --
    ==================
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    net
    ==================
    Jerry Guest

  3. #3

    Default Re: Multi queries

    Jerry Stuckle a écrit : 
    >
    > So why use multi queries?
    >
    > insert into tab1 (columns....) values (values...), (values...),
    > (values...), (values...), ...
    >[/ref]


    Thanks for the work around.

    The solution is there :
    http://dev.mysql.com/doc/refman/5.0/en/c-api-multiple-queries.html
    It Works fine. 100 Queries in a batch !!!!

    Best regards
    Fagotto
    fagotto Guest

  4. #4

    Default Re: Multi queries

    On 26 Feb, 19:30, fagotto <fr> wrote: [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]
    > [/ref]


    >
    > Thanks for the work around.
    >
    > The solution is there :http://dev.mysql.com/doc/refman/5.0/en/c-api-multiple-queries.html
    > It Works fine. 100 Queries in a batch !!!!
    >
    > Best regards
    > Fagotto- Hide quoted text -
    >
    > - Show quoted text -[/ref]

    I'm not sure that Jerry's suggestion was intended as a workaround so
    much as a suggestion for a better and more eficienct way of doing teh
    multiple inserts.

    Captain Guest

Similar Threads

  1. Queries with multi tables ?
    By V.R in forum MySQL
    Replies: 2
    Last Post: November 5th, 04:13 AM
  2. Implications for a multi lingual, multi curreny e commerce site ??
    By James Noon in forum Dreamweaver AppDev
    Replies: 1
    Last Post: April 17th, 09:27 PM
  3. Queries Of Queries Single Quote Problem
    By TimH2O in forum Macromedia ColdFusion
    Replies: 0
    Last Post: April 1st, 07:46 PM
  4. Form validation for multi-rows and multi-columns
    By Jean in forum ASP Database
    Replies: 12
    Last Post: November 4th, 02:02 PM
  5. Multi table queries with agregates
    By JoeProgrammer in forum Microsoft SQL / MS SQL Server
    Replies: 4
    Last Post: July 17th, 10:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139