Permalink
Browse files

LONGVARCHAR/LONGWVARCHAR fix

Was passing the incorrect length when binding, causing SQLPut errors when using long strings
(usually when inserting long strings) for some drivers.
  • Loading branch information...
1 parent b4cf762 commit 606b57323cdd7824a194a2047817afbee469d0e2 @mkleehammer committed Jul 11, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/params.cpp
View
@@ -174,7 +174,7 @@ static bool GetUnicodeInfo(Cursor* cur, Py_ssize_t index, PyObject* param, Param
// Too long to pass all at once, so we'll provide the data at execute.
info.ParameterType = SQL_WLONGVARCHAR;
- info.StrLen_or_Ind = SQL_LEN_DATA_AT_EXEC((SQLLEN)len);
+ info.StrLen_or_Ind = SQL_LEN_DATA_AT_EXEC((SQLLEN)(len * sizeof(SQLWCHAR)));
info.ParameterValuePtr = param;
}

0 comments on commit 606b573

Please sign in to comment.