Open GoogleCodeExporter opened 8 years ago
It appears to not get the lengths correctly because the pyodbc uses the actual
size of the input string as the length of the nvarchar. pypyodbc uses the
default of 255, and when it's larger than that, it switches to ntext.
Original comment by sp1d...@gmail.com
on 1 May 2013 at 11:51
It appears to be line 1048 that is the cause - My guess is it is assuming MS
Access. Changing that from uppercase U to lowercase, and returning the true
length of the field seems to fix it. Same thing with the S on line 1054. Line
1203 in _bind_params needs to be fixed as well.
Original comment by sp1d...@gmail.com
on 2 May 2013 at 12:15
Accepted. I will look into this issue during weekends.
Original comment by jiangwen...@gmail.com
on 2 May 2013 at 1:34
I've attached the modified pypyodbc.py that works. I don't know how to get a
patch, and it doesn't include the dev features from github, but you can see the
changes I made. I see that it makes queries to check data types... it's execing
sp_datatype_info 93, 91, and 92. Checking the datetime types or something.
Anyway, if you call sp_datatype_info with just the odbcver=3 you get a list of
the datatypes and their maximum sizes. The maximum size of a varchar in SQL
2000 (the version that I'm using) is 8000.
Original comment by sp1d...@gmail.com
on 2 May 2013 at 5:20
Attachments:
Original issue reported on code.google.com by
sp1d...@gmail.com
on 1 May 2013 at 11:31