我怎样才能将pqxx :: prepare :: invocation中的语句作为std :: string来获取?

时间:2017-09-29 12:06:04

标签: c++ postgresql libpqxx

示例:

    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);

0 个答案:

没有答案