This is a little late but for people looking at this now and in the future. I think now you would want to do something like this Documentation
Basically instead of prepared statements you would still do the $1 , $2, ... stuff in a query string and then you would build a pqxx::params and then pass that with the query.
int values[] = {1,2,3};
std::string query = "INSERT into mytable (a, b, c) VALUES ($1, $2, $3)";
pqxx::params p;
for (int i = 0; i < num_values; i++) {
p.append(values[i])
}
pqxx::nontransaction ntxn(c);
ntxn.exec(query, p);
and your c would be your pqxx::connection.
Note: This code my not be exactly syntatically correct but this is the general idea I think.