On Sat, 22 Jun 2013 15:49:07 -0600 Jordan Woehr <[email protected]> wrote:
JW> However, for inserting I'm having difficulty. What I want to achieve is
JW> something as follows:
JW>
JW> int vals[NUM_VALS];
JW> statement st = s.prepare << "INSERT INTO table (c0, c1, c2, ...) VALUES (";
JW> for(int i = 0; i < NUM_VALS; ++i)
JW> st << vals[i];
JW> st << ")";
JW> st.execute();
JW>
JW> Is anything like this possible?
Why not? You just need to postpone the statement construction until after
you build the full SQL script in this loop. And you can call
statement::use() in the loop too.
Regards,
VZ
pgpm31Ni0AKG3.pgp
Description: PGP signature
------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev
_______________________________________________ soci-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/soci-users
