Comments (10)
I forget to mention, I am connecting to SQL Server 2008 R2
Original comment by [email protected]
on 4 Apr 2014 at 7:48
from pypyodbc.
I'm not able to reproduce this error under my Windows box.
But is this related to 64bit? Could you find a 32bit and test if problem
persist?
Original comment by [email protected]
on 24 May 2014 at 2:52
- Changed state: Started
from pypyodbc.
Same error on my OpenSuse server (32 bit, Python 2.7, unixODBC 2.2.12, FreeTDS
0.91) - pypyodbc truncates column names to their first chars.
pyodbc works fine - shows full column names.
On Windows 7 32bit, Python 2.6.7 both pypyodbc and pyodbc work fine - with full
column names.
I've got some inner parms pypyodbc uses:
Linux: odbc_decoding=utf_16 odbc_encoding=utf_16_le ucs_length=2
UNICODE_SIZE=4 SQLWCHAR_SIZE=2
Windows: odbc_decoding=utf_16 odbc_encoding=utf_16_le ucs_length=2
UNICODE_SIZE=2 SQLWCHAR_SIZE=2
Original comment by [email protected]
on 25 Jun 2014 at 7:45
from pypyodbc.
I use pypyodbc 1.3.3 from pypi.
Original comment by [email protected]
on 25 Jun 2014 at 7:49
from pypyodbc.
Microsoft SQL Server Standard Edition (64-bit) 2008 R2 :-)
Original comment by [email protected]
on 25 Jun 2014 at 9:32
from pypyodbc.
Same issue: only the first character for column name by description attribute.
with MS sqlserver 2008 R2 64bit.
unixODBC.i686 2.2.14-12.el6_3 @ol6_latest
unixODBC-devel.i686 2.2.14-12.el6_3 @ol6_latest
freetds.i686 0.91-2.el6 @epel
on RHEL6
Python 3.3.1
pypyodbc (1.3.3)
Original comment by [email protected]
on 2 Sep 2014 at 3:47
from pypyodbc.
I reproduced this problem too. The column names are good on Windows 7, but on
Linux it does not work.
I use the same Python 3.3.4 on both platforms, the same pypyodbc.
The only difference: ODBC drivers.
On Windows I obviously have the Microsoft ODBC stuff.
On Linux I use the FreeTDS 0.91.103.
So I think pypyodbc/FreeTDS has some problem with SQLServer metadata.
Is there any workaround? Can FreeTDS or pypyodbc be fixed to handle this
properly?
Any other driver we can use on Linux?
Original comment by [email protected]
on 29 Sep 2014 at 3:09
from pypyodbc.
I did one more test: downloaded Microsoft ODBC Driver 11 for SQL for RedHat.
The same problem.
So now I believe that this is not a driver problem, but rather a pypyodbc
problem in Linux environment.
Any ideas?
Original comment by [email protected]
on 29 Sep 2014 at 4:00
from pypyodbc.
I found what the problem is, and I have a workaround (or maybe this is the fix).
Apparently, even though the data from the character columns may come as
unicode, the column names in the descriptor are still plain ascii.
In pypyodbc.py, in _UpdateDesc() method, line 1735, I see:
force_unicode = self.connection.unicode_results
Based on this flag, few lines below, it will call ODBC_APY accordingly. So I
replaced that line above by:
force_unicode = False
and it fixed the problem.
I am not sure why it works properly on Windows, I cannot see the pypyodbc.py
code there, I only see pypyodbc-1.3.3-py3.4.egg file which is a binary file.
I hope this is enough information for the maintainers to fix this problem
properly in the next release.
Original comment by [email protected]
on 29 Sep 2014 at 7:12
from pypyodbc.
I think issues 43 and 52 are duplicates of this issue. This problem prevents
me to use pypyodbc in production.
I also took a quick look at the code, like leonidil... I noted at line 2400
self.unicode_results = False
although one of the arguments is 'unicode_results' and it is used line 2436 to
establish a connection. There are 50% chance of discrepancy between
self.unicode_results and the value used to get a connection.
Original comment by [email protected]
on 13 Nov 2014 at 4:02
from pypyodbc.
Related Issues (20)
- Description attribute returns only first char of name (as byte) using Oracle ODBC & Linux HOT 2
- Trimmed varchar results.
- Column names get wonky on 64-bit system using iSeries DB2 driver HOT 3
- Oracle and Decimal_cvt issue
- IronPython 2.7 StopIteration exception raised when retrieving SQL data set
- "invalid literal" exceptions querying empty numeric fields when using LinuxODBC with FreeTDS
- use mbdtools,chinese character encoded by gb charset can't access correctly
- Passing datetime.date returns TypeError: Wrong Type HOT 2
- Mapping bigint in sqlserver 2008 into float, instead of int in python3
- Bad cursor description (mixed bytes and strings) on Ubuntu 14.04 HOT 2
- Row objects don't raise KeyError for invalid fields
- Data source name not found on linux + unixodbc + as400 iseries driver HOT 1
- Cannot access column names by attribute HOT 4
- pypyodbc doesn't support the MSSQL datetimeoffset column type.
- state = err_list[0][0] Index out of range
- UnicodeDecodeError because UTF-16 surrogate pairs are not handled HOT 1
- Enhancement: Support for lists as SQL parameters
- executemany is very slow
- Sage Line 100 Odbc connect KO HOT 1
- Not working on Windows 7 64 bit 3.4.3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pypyodbc.