summaryrefslogtreecommitdiff
path: root/libodbcpp/command.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libodbcpp/command.cpp')
-rw-r--r--libodbcpp/command.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libodbcpp/command.cpp b/libodbcpp/command.cpp
index 4ceb825..50dd679 100644
--- a/libodbcpp/command.cpp
+++ b/libodbcpp/command.cpp
@@ -11,6 +11,10 @@ ODBC::Command::Command(const Connection & c, const std::string & s) :
if (rc != SQL_SUCCESS) {
throw Error(rc, SQL_HANDLE_STMT, hStmt, "Allocate statement handle");
}
+ rc = SQLSetStmtAttr(hStmt, SQL_ATTR_CURSOR_TYPE, (SQLPOINTER)SQL_CURSOR_DYNAMIC, 0);
+ if ((rc != SQL_SUCCESS)) {
+ throw ConnectionError(rc, SQL_HANDLE_STMT, hStmt, "Set scrollable cursor");
+ }
rc = SQLPrepare(hStmt, (SQLCHAR*)sql.c_str(), sql.length());
if (rc != SQL_SUCCESS) {
SQLFreeHandle(SQL_HANDLE_STMT, hStmt);