summaryrefslogtreecommitdiff
path: root/libodbcpp/odbc-modifycommand.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-12-29 02:42:43 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2015-12-29 06:00:07 +0000
commitbe237957454cd7a4e84a5a603bdef6ab3ab8b8e1 (patch)
treebfe7f06152b2d453bcd097d9913918473d8fecd7 /libodbcpp/odbc-modifycommand.cpp
parentRemove rebind (diff)
downloadlibdbpp-odbc-be237957454cd7a4e84a5a603bdef6ab3ab8b8e1.tar.bz2
libdbpp-odbc-be237957454cd7a4e84a5a603bdef6ab3ab8b8e1.tar.xz
libdbpp-odbc-be237957454cd7a4e84a5a603bdef6ab3ab8b8e1.zip
Reshuffle and add new exceptions
Diffstat (limited to 'libodbcpp/odbc-modifycommand.cpp')
-rw-r--r--libodbcpp/odbc-modifycommand.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/libodbcpp/odbc-modifycommand.cpp b/libodbcpp/odbc-modifycommand.cpp
index 5d483c5..cb6d3c0 100644
--- a/libodbcpp/odbc-modifycommand.cpp
+++ b/libodbcpp/odbc-modifycommand.cpp
@@ -15,26 +15,20 @@ ODBC::ModifyCommand::~ModifyCommand()
unsigned int
ODBC::ModifyCommand::execute(bool anc)
{
- if (connection.txIsAborted()) {
- throw Error("Transaction has been aborted, not issuing any more commands");
- }
RETCODE rc = SQLExecute(hStmt);
if (!SQL_SUCCEEDED(rc)) {
if (rc != SQL_NO_DATA || !anc) {
- connection.abortTx();
- throw Error(rc, SQL_HANDLE_STMT, hStmt, "ODBC::ModifyCommand::execute SQLExecute");
+ throw Error(rc, SQL_HANDLE_STMT, hStmt);
}
}
SQLLEN rows;
rc = SQLRowCount(hStmt, &rows);
- if (!SQL_SUCCEEDED(rc)) {
- connection.abortTx();
- throw Error(rc, SQL_HANDLE_STMT, hStmt, "ODBC::ModifyCommand::execute SQLRowCount");
+ if (!SQL_SUCCEEDED(rc)) {
+ throw Error(rc, SQL_HANDLE_STMT, hStmt);
}
if (rows > 0 || anc) {
return rows;
}
- connection.abortTx();
- throw Error("No rows affected");
+ throw DB::NoRowsAffected();
}