Skip to content

Commit

Permalink
LONGVARCHAR/LONGWVARCHAR fix
Browse files Browse the repository at this point in the history
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
mkleehammer committed Jul 11, 2011
1 parent b4cf762 commit 606b573
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/params.cpp
Expand Up @@ -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;
}

Expand Down

0 comments on commit 606b573

Please sign in to comment.