My favorites
▼
|
Sign in
pyodbc
Python ODBC library
Project Home
Downloads
Wiki
READ-ONLY: This project has been
archived
. For more information see
this post
.
Search
Search within:
All issues
Open issues
New issues
Issues to verify
for
Advanced search
Search tips
Subscriptions
Issue
149
attachment: pyodbc-issue-149.patch
(609 bytes)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/src/params.cpp b/src/params.cpp
index 4180bc0..17687f6 100644
--- a/src/params.cpp
+++ b/src/params.cpp
@@ -258,8 +258,15 @@ static bool GetIntInfo(Cursor* cur, Py_ssize_t index, PyObject* param, ParamInfo
{
info.Data.l = PyInt_AsLong(param);
+#if LONG_BIT == 64
+ info.ValueType = SQL_C_SBIGINT;
+ info.ParameterType = SQL_BIGINT;
+#elif LONG_BIT == 32
info.ValueType = SQL_C_LONG;
info.ParameterType = SQL_INTEGER;
+#else
+#error "unexpected LONG_BIT value"
+#endif
info.ParameterValuePtr = &info.Data.l;
return true;
}
Powered by
Google Project Hosting