summaryrefslogtreecommitdiff
path: root/libodbcpp/command.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-12-24 04:08:56 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2015-12-24 04:08:56 +0000
commit63d9cbb434ec4f6e828083b99d638127cfce7a95 (patch)
tree2dfcf95372467a9119147265fccfba058c617b8a /libodbcpp/command.cpp
parentUse parent glibmm (diff)
downloadlibdbpp-odbc-63d9cbb434ec4f6e828083b99d638127cfce7a95.tar.bz2
libdbpp-odbc-63d9cbb434ec4f6e828083b99d638127cfce7a95.tar.xz
libdbpp-odbc-63d9cbb434ec4f6e828083b99d638127cfce7a95.zip
ODBC files prefixed with odbc-
Diffstat (limited to 'libodbcpp/command.cpp')
-rw-r--r--libodbcpp/command.cpp40
1 files changed, 0 insertions, 40 deletions
diff --git a/libodbcpp/command.cpp b/libodbcpp/command.cpp
deleted file mode 100644
index 801060f..0000000
--- a/libodbcpp/command.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "command.h"
-#include "error.h"
-#include "param.h"
-#include <sqlext.h>
-
-ODBC::Command::Command(const Connection & c, const std::string & s) :
- DB::Command(s),
- connection(c)
-{
- RETCODE rc = SQLAllocHandle(SQL_HANDLE_STMT, c.conn, &hStmt);
- if (!SQL_SUCCEEDED(rc)) {
- throw Error(rc, SQL_HANDLE_STMT, hStmt, "Allocate statement handle");
- }
- rc = SQLSetStmtAttr(hStmt, SQL_ATTR_CURSOR_TYPE, (SQLPOINTER)SQL_CURSOR_DYNAMIC, 0);
- if (!SQL_SUCCEEDED(rc)) {
- throw ConnectionError(rc, SQL_HANDLE_STMT, hStmt, "Set scrollable cursor");
- }
- rc = SQLPrepare(hStmt, (SQLCHAR*)sql.c_str(), sql.length());
- if (!SQL_SUCCEEDED(rc)) {
- SQLFreeHandle(SQL_HANDLE_STMT, hStmt);
- throw Error(rc, SQL_HANDLE_STMT, hStmt, "Prepare statement");
- }
- SQLSMALLINT pcount;
- rc = SQLNumParams(hStmt, &pcount);
- if (!SQL_SUCCEEDED(rc)) {
- SQLFreeHandle(SQL_HANDLE_STMT, hStmt);
- throw Error(rc, SQL_HANDLE_STMT, hStmt, "Parameter count");
- }
- params.resize(pcount);
-}
-
-ODBC::Command::~Command()
-{
- for (Params::iterator i = params.begin(); i != params.end(); ++i) {
- if (*i) {
- delete *i;
- }
- }
-}
-