diff options
author | randomdan <randomdan@localhost> | 2010-09-13 19:57:25 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2010-09-13 19:57:25 +0000 |
commit | 95bc5ac789c2f29220f76c94fc93d6379dcd00c6 (patch) | |
tree | 2af19c25a48dfb13b2db681544ad6fa82407c567 /libodbcpp/column.h | |
parent | Use the right header for BUFSIZ (diff) | |
download | libdbpp-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.h')
-rw-r--r-- | libodbcpp/column.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libodbcpp/column.h b/libodbcpp/column.h index 67dd0c4..c9e65ca 100644 --- a/libodbcpp/column.h +++ b/libodbcpp/column.h @@ -10,6 +10,7 @@ namespace ODBC { Column(const Glib::ustring &, unsigned int); virtual ~Column(); void bind(SQLHANDLE, SQLUINTEGER, SQLSMALLINT, void*, size_t); + virtual void resize(SQLHANDLE); operator int () const; operator unsigned int () const; operator long long () const; @@ -32,8 +33,7 @@ namespace ODBC { const Glib::ustring name; protected: mutable Glib::ustring * composeCache; - private: - SQLUINTEGER bindSize; // Allocated memory + SQLLEN bindSize; // Allocated memory friend class SelectCommand; }; template <class t> @@ -47,6 +47,12 @@ namespace ODBC { int writeToBuf(char ** buf) const; int writeToBuf(char ** buf, const char * fmt) const; }; + class StringColumn : public _Column<SQLCHARVEC> { + public: + StringColumn(const Glib::ustring & n, unsigned int i) : + _Column<SQLCHARVEC>(n, i) { } + void resize(SQLHANDLE); + }; } void operator << (SQL_TIMESTAMP_STRUCT & target, const struct tm &); |