summaryrefslogtreecommitdiff
path: root/libodbcpp/column.cpp
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2010-09-13 19:57:25 +0000
committerrandomdan <randomdan@localhost>2010-09-13 19:57:25 +0000
commit95bc5ac789c2f29220f76c94fc93d6379dcd00c6 (patch)
tree2af19c25a48dfb13b2db681544ad6fa82407c567 /libodbcpp/column.cpp
parentUse the right header for BUFSIZ (diff)
downloadlibdbpp-odbc-95bc5ac789c2f29220f76c94fc93d6379dcd00c6.tar.bz2
libdbpp-odbc-95bc5ac789c2f29220f76c94fc93d6379dcd00c6.tar.xz
libdbpp-odbc-95bc5ac789c2f29220f76c94fc93d6379dcd00c6.zip
Remove duplication in ODBC::Connection constructors
Remove pointless specialisation on _Column for strings Set cursor type to scrollable (required to refetch a row) Resize binds if fetched data is truncated Support scrolling fetch (default is old 'next record' behaviour)
Diffstat (limited to 'libodbcpp/column.cpp')
-rw-r--r--libodbcpp/column.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/libodbcpp/column.cpp b/libodbcpp/column.cpp
index 6e517a6..3d37e50 100644
--- a/libodbcpp/column.cpp
+++ b/libodbcpp/column.cpp
@@ -1,3 +1,4 @@
+#include <sqlext.h>
#include <stdio.h>
#include <stdlib.h>
#include "column.h"
@@ -17,6 +18,21 @@ ODBC::Column::~Column()
delete composeCache;
}
+void
+ODBC::Column::resize(SQLHANDLE hStmt)
+{
+}
+
+void
+ODBC::StringColumn::resize(SQLHANDLE hStmt)
+{
+ if (bindSize < bindLen) {
+ value.resize(bindLen + 1);
+ bindSize = bindLen;
+ bind(hStmt, colNo + 1, SQL_C_CHAR, &value[0], bindSize + 1);
+ }
+}
+
bool
ODBC::Column::isNull() const
{