diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2017-06-05 18:53:22 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2017-06-05 18:53:22 +0100 |
commit | 19609c41b15a818df30508576f50fc0eddc11636 (patch) | |
tree | b7b36a9e69689fd2be7c0660728af59eacb02d10 /libpqpp/pq-cursorselectcommand.cpp | |
parent | Add wrappers for PQgetvalue and PQgetlength in column to simplify access (diff) | |
download | libdbpp-postgresql-19609c41b15a818df30508576f50fc0eddc11636.tar.bz2 libdbpp-postgresql-19609c41b15a818df30508576f50fc0eddc11636.tar.xz libdbpp-postgresql-19609c41b15a818df30508576f50fc0eddc11636.zip |
Support fetching data in binary format (no numeric, datetime, interval support yet)
Diffstat (limited to 'libpqpp/pq-cursorselectcommand.cpp')
-rw-r--r-- | libpqpp/pq-cursorselectcommand.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libpqpp/pq-cursorselectcommand.cpp b/libpqpp/pq-cursorselectcommand.cpp index 54b843f..2b639c8 100644 --- a/libpqpp/pq-cursorselectcommand.cpp +++ b/libpqpp/pq-cursorselectcommand.cpp @@ -9,7 +9,7 @@ AdHocFormatter(PQCursorSelectClose, "CLOSE %?"); PQ::CursorSelectCommand::CursorSelectCommand(Connection * conn, const std::string & sql, const PQ::CommandOptions * pqco, const DB::CommandOptions * opts) : DB::Command(sql), - PQ::SelectBase(sql), + PQ::SelectBase(sql, pqco), PQ::Command(conn, sql, opts), executed(false), txOpened(false), @@ -50,7 +50,7 @@ PQ::CursorSelectCommand::execute() s_declare = mkdeclare(); } c->checkResultFree( - PQexecParams(c->conn, s_declare.c_str(), values.size(), NULL, &values.front(), &lengths.front(), &formats.front(), 0), + PQexecParams(c->conn, s_declare.c_str(), values.size(), NULL, &values.front(), &lengths.front(), &formats.front(), binary), PGRES_COMMAND_OK); fetchTuples(); createColumns(execRes); @@ -61,7 +61,7 @@ PQ::CursorSelectCommand::execute() void PQ::CursorSelectCommand::fetchTuples() { - execRes = c->checkResult(PQexec(c->conn, s_fetch.c_str()), PGRES_TUPLES_OK); + execRes = c->checkResult(PQexecParams(c->conn, s_fetch.c_str(), 0, NULL, NULL, NULL, NULL, binary), PGRES_TUPLES_OK); nTuples = PQntuples(execRes); tuple = -1; } |