From: Vadim Zeitlin Date: Thu, 24 May 2007 00:27:40 +0000 (+0000) Subject: use a different indicator when binding parameters and columns (patch 1718474) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d71a2d786386b75b184b7a4947e153d51b1af091 use a different indicator when binding parameters and columns (patch 1718474) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46188 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/dbtable.h b/include/wx/dbtable.h index 06d695d8c3..8d7de7322c 100644 --- a/include/wx/dbtable.h +++ b/include/wx/dbtable.h @@ -55,8 +55,9 @@ public: bool Updateable; // Specifies whether this column is updateable bool InsertAllowed; // Specifies whether this column should be included in an INSERT statement bool DerivedCol; // Specifies whether this column is a derived value - SQLLEN CbValue; // Internal use only!!! + SQLLEN CbValue; // Internal use only!!! For parameter bindings bool Null; // NOT FULLY IMPLEMENTED - Allows NULL values in Inserts and Updates + SQLLEN CbValueCol; // Internal use only!!! For column bindings wxDbColDef(); diff --git a/src/common/dbtable.cpp b/src/common/dbtable.cpp index e51af36535..6f867a1bdb 100644 --- a/src/common/dbtable.cpp +++ b/src/common/dbtable.cpp @@ -87,6 +87,7 @@ bool wxDbColDef::Initialize() DerivedCol = false; CbValue = 0; Null = false; + CbValueCol = 0; return true; } // wxDbColDef::Initialize() @@ -552,7 +553,7 @@ bool wxDbTable::bindCols(HSTMT cursor) for (i = 0; i < m_numCols; i++) { if (SQLBindCol(cursor, (UWORD)(i+1), colDefs[i].SqlCtype, (UCHAR*) colDefs[i].PtrDataObj, - colDefs[i].SzDataObj, &colDefs[i].CbValue ) != SQL_SUCCESS) + colDefs[i].SzDataObj, &colDefs[i].CbValueCol ) != SQL_SUCCESS) return (pDb->DispAllErrors(henv, hdbc, cursor)); } @@ -586,7 +587,7 @@ bool wxDbTable::getRec(UWORD fetchType) // of each column just read in. int i; for (i = 0; i < m_numCols; i++) - colDefs[i].Null = (colDefs[i].CbValue == SQL_NULL_DATA); + colDefs[i].Null = (colDefs[i].CbValueCol == SQL_NULL_DATA); } } else @@ -606,7 +607,7 @@ bool wxDbTable::getRec(UWORD fetchType) // of each column just read in. int i; for (i = 0; i < m_numCols; i++) - colDefs[i].Null = (colDefs[i].CbValue == SQL_NULL_DATA); + colDefs[i].Null = (colDefs[i].CbValueCol == SQL_NULL_DATA); } }