示例:
pqxx::connection c("dbname=mydb user=user");
pqxx::work w(c);
c.prepare("Prepared_Statement", "SELECT id FROM mytable WHERE id = $1 or id = $2");
pqxx::prepare::invocation w_invocation = w.prepared("Prepared_Statement");
但我无法使用此语句声明游标,它希望查询为std :: string:
pqxx::stateless_cursor<pqxx::cursor_base::read_only, pqxx::cursor_base::loose> cursor(w, w_invocation , "cname", false);