Replies: 2 comments
-
You do it like this: soci::statement st(session);
st.alloc();
st.prepare("insert into ...");
st.exchange(use(value1));
st.exchange(use(value2));
st.exchange(use(value3));
st.define_and_bind();
st.execute(); |
Beta Was this translation helpful? Give feedback.
0 replies
-
I checked your suggestion and it works for me. Thank You! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In this example all holes get filled at once:
I want to append the "use" step by step.
Something like this:
Details
I am writing convince functions which are build on soci and boost::fusion.
For example "insertStruct" to add one row into the EasyClass table.
Creating the sql expresion is done by iterating over the members of EasyClass.
So for "insertStruct (sql, EasyClass{ "222", "someValue" });" the sql is:
This allows sql injections. So I want to use "use()" instead of copying the values of the struct into VALUES().
Is it possible to create the query with holes and fill them by appending?
Beta Was this translation helpful? Give feedback.
All reactions