summaryrefslogtreecommitdiff
path: root/libodbcpp/modifycommand.cpp
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2010-11-25 19:26:04 +0000
committerrandomdan <randomdan@localhost>2010-11-25 19:26:04 +0000
commitbf8c4b6990a203c28b92ca09e170d0cbea206092 (patch)
tree9591f50c8c39b7b33a4b4659b0c997545aa7c79a /libodbcpp/modifycommand.cpp
parentTidy up jam stuff (diff)
downloadlibdbpp-odbc-bf8c4b6990a203c28b92ca09e170d0cbea206092.tar.bz2
libdbpp-odbc-bf8c4b6990a203c28b92ca09e170d0cbea206092.tar.xz
libdbpp-odbc-bf8c4b6990a203c28b92ca09e170d0cbea206092.zip
Use proper ODBC SQL_SUCCEEDED macro, not SQL_SUCCESS comparison
Diffstat (limited to 'libodbcpp/modifycommand.cpp')
-rw-r--r--libodbcpp/modifycommand.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/libodbcpp/modifycommand.cpp b/libodbcpp/modifycommand.cpp
index 45022b0..84979e2 100644
--- a/libodbcpp/modifycommand.cpp
+++ b/libodbcpp/modifycommand.cpp
@@ -17,18 +17,16 @@ ODBC::ModifyCommand::execute(bool anc)
throw Error("Transaction has been aborted, not issuing any more commands");
}
RETCODE rc = SQLExecute(hStmt);
- if (rc != SQL_SUCCESS) {
- if (rc == SQL_SUCCESS_WITH_INFO) {
- // Log info
- }
- else if (rc != SQL_NO_DATA || !anc) {
+ if (!SQL_SUCCEEDED(rc)) {
+ if (rc != SQL_NO_DATA || !anc) {
connection.abortTx();
throw Error(rc, SQL_HANDLE_STMT, hStmt, "%s: SQLExecute",
__FUNCTION__);
}
}
SQLINTEGER rows;
- if ((rc = SQLRowCount(hStmt, &rows)) != SQL_SUCCESS) {
+ rc = SQLRowCount(hStmt, &rows);
+ if (!SQL_SUCCEEDED(rc)) {
connection.abortTx();
throw Error(rc, SQL_HANDLE_STMT, hStmt, "%s: SQLRowCount",
__FUNCTION__);