List:MySQL++« Previous MessageNext Message »
From:Ana Johnson Date:July 1 2011 11:37pm
Subject:Re: ssqls and extend insert syntax? how?
View as plain text  
although I believe it may be bad form to reply to my own post...

I found an answer.  although my specific question isn't addressed
directly in the manual, the answer is there in the section labeled
"5.5. Harnessing SSQLS Internals".
referencing my own question...  the answer (that I came up with
anyway...  there may be a better one) goes something like this:

sql_create_3( mieeff, // this is the name of the struct and the table
    3, 3,
    sql_bigint, radius,
    sql_bigint, wavelength,
    sql_double, qext  /* .... */ )

mieeff effc( 1,2,3 );
mysqlpp::Query q = conn.query();

q <<  "insert into mieeff (" << effc.field_list() << ") values
(" <<
effc.value_list() << ")";

effcl[n] = yourmagic();

for( /*  all values in my list ...  */ )
{
    q << ",(" << effcl.value_list() << ")";
     //  there must be *some* concern about the length of the command.
    if( q.str().size() > whatever )
        break;
}

q.execute();  // pseudo code.  I don't remember the method name.


On Fri, Jul 1, 2011 at 2:55 PM, Ana Johnson <anajilly@stripped> wrote:
>
> Hi.
> I'm using the ssqls structures to setup my sql statements.  I like it.
> I believe I'm calling too many insert commands though.  I want to switch to
> using mysql's extended insert syntax.  I haven't found anything in the mysql++
> documentation about this server/protocol capability, or about how to use it through the
> mysql++ library.  (I haven't found any google results either.)
> to be clear, by "extended insert syntax" I mean:  "insert into blah (c1,c2)
> values (1,2),(1,3),(1,9823),(23,8923)"
> Is there support for mysql's extended insert syntax in mysql++?  How would I use
> it?  Do I need to switch to method which does not use the ssqls structures?
> Thanks!!
> - Ana
Thread
ssqls and extend insert syntax? how?Ana Johnson2 Jul
  • Re: ssqls and extend insert syntax? how?Ana Johnson2 Jul
    • Re: ssqls and extend insert syntax? how?Kemet3 Jul
      • Re: ssqls and extend insert syntax? how?Ana Johnson6 Jul
        • Re: ssqls and extend insert syntax? how?Warren Young6 Jul
          • Re: ssqls and extend insert syntax? how?Ana Johnson6 Jul
            • Re: ssqls and extend insert syntax? how?Warren Young7 Jul
              • Re: ssqls and extend insert syntax? how?Ana Johnson8 Jul
                • Re: ssqls and extend insert syntax? how?Warren Young8 Jul