summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2010-06-11 12:30:06 +0000
committerrandomdan <randomdan@localhost>2010-06-11 12:30:06 +0000
commit016533505b79290b43bb89b3beee569c7fb033f5 (patch)
tree2b0f27a947bbb72c4e3e8a15caefdcd4bf2f235d
parentUse Glib::ustring in libodbcpp for data and std::string for non-data (diff)
downloadlibdbpp-odbc-016533505b79290b43bb89b3beee569c7fb033f5.tar.bz2
libdbpp-odbc-016533505b79290b43bb89b3beee569c7fb033f5.tar.xz
libdbpp-odbc-016533505b79290b43bb89b3beee569c7fb033f5.zip
Fix odbc select destructor when cursor not opened
Add support for subqueries
-rw-r--r--libodbcpp/selectcommand.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/libodbcpp/selectcommand.cpp b/libodbcpp/selectcommand.cpp
index 26b6b45..a1a5531 100644
--- a/libodbcpp/selectcommand.cpp
+++ b/libodbcpp/selectcommand.cpp
@@ -16,10 +16,12 @@ ODBC::SelectCommand::~SelectCommand()
delete *i;
}
}
- RETCODE rc;
- if ((rc = SQLCloseCursor(hStmt)) != SQL_SUCCESS) {
- throw Error(rc, SQL_HANDLE_STMT, hStmt, "%s: SQLCloseCursor",
- __FUNCTION__);
+ if (columns.size()) {
+ RETCODE rc;
+ if ((rc = SQLCloseCursor(hStmt)) != SQL_SUCCESS) {
+ throw Error(rc, SQL_HANDLE_STMT, hStmt, "%s: SQLCloseCursor",
+ __FUNCTION__);
+ }
}
}