Coder Social home page Coder Social logo

Comments (10)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 20, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 20, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 20, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 20, 2024
I use pypyodbc 1.3.3 from pypi.

Original comment by [email protected] on 25 Jun 2014 at 7:49

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 20, 2024
Microsoft SQL Server Standard Edition (64-bit) 2008 R2 :-)

Original comment by [email protected] on 25 Jun 2014 at 9:32

from pypyodbc.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 20, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 20, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 20, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 20, 2024
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.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 20, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.