diff options
Diffstat (limited to 'libpqpp/pq-cursorselectcommand.cpp')
-rw-r--r-- | libpqpp/pq-cursorselectcommand.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/libpqpp/pq-cursorselectcommand.cpp b/libpqpp/pq-cursorselectcommand.cpp index 29e29f5..fbc14eb 100644 --- a/libpqpp/pq-cursorselectcommand.cpp +++ b/libpqpp/pq-cursorselectcommand.cpp @@ -1,12 +1,11 @@ #include "pq-cursorselectcommand.h" #include "pq-connection.h" -#include "pq-column.h" #include "pq-error.h" #include <compileTimeFormatter.h> PQ::CursorSelectCommand::CursorSelectCommand(Connection * conn, const std::string & sql, unsigned int no) : DB::Command(sql), - DB::SelectCommand(sql), + PQ::SelectBase(sql), PQ::Command(conn, sql, no), executed(false), txOpened(false), @@ -19,9 +18,6 @@ PQ::CursorSelectCommand::CursorSelectCommand(Connection * conn, const std::strin PQ::CursorSelectCommand::~CursorSelectCommand() { - if (execRes) { - PQclear(execRes); - } if (executed && PQtransactionStatus(c->conn) != PQTRANS_INERROR) { c->checkResultFree((PQexec(c->conn, s_close.c_str())), PGRES_COMMAND_OK); } @@ -65,10 +61,7 @@ PQ::CursorSelectCommand::execute() PQexecParams(c->conn, s_declare.c_str(), values.size(), NULL, &values.front(), &lengths.front(), NULL, 0), PGRES_COMMAND_OK); fetchTuples(); - unsigned int nFields = PQnfields(execRes); - for (unsigned int f = 0; f < nFields; f += 1) { - insertColumn(DB::ColumnPtr(new Column(this, f))); - } + createColumns(execRes); executed = true; } } |