Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem fetching NTEXT and NVARCHAR data #13

Closed
GoogleCodeExporter opened this issue Dec 5, 2015 · 6 comments
Closed

Problem fetching NTEXT and NVARCHAR data #13

GoogleCodeExporter opened this issue Dec 5, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Create NVARCHAR (or NTEXT) column in MSSQL 2005 Express database table.
   create table test_nvarchar (id int identity, nvarchar_col nvarchar(10))

   -- Insert capital U with double acute.
   insert into test_nvarchar values (N'Ű')
2. Run this python script on RedHat 9:

import pyodbc
cnxn = pyodbc.connect("DSN=SQLSERVER_SAMPLE")
cursor = cnxn.cursor()
cursor.execute("select * from test_nvarchar where id = 1")
for row in cursor:
    print row.nvarchar_col
    print repr(row.nvarchar_col

What is the expected output?
Ű
u'\u0170    '


What do you see instead?

u''

What version of the product are you using? On what operating system?
redhat 9
pyodbc 2.1.2
python 2.5.1 (UCS-2 build)
Easysoft SQL Server ODBC driver 1.1.4
SQL Server 2005 Express

Please provide any additional information below.
The script works as expected with the same setup if pyodbc 2.0.58 is used
or a "hybrid" 2.1.2 built with the 2.0.58 getdata.cpp.


Original issue reported on code.google.com by timothy....@gmail.com on 12 Dec 2008 at 4:50

@GoogleCodeExporter
Copy link
Author

OK, this is something wierd.  It works on Windows just fine, so there is 
something
about the combination of Easysoft and Linux.

Is it possible to get an ODBC trace of the 2.1.2 that fails and the 2.0.58 that 
works
so I can compare them?

Original comment by mkleehammer on 12 Dec 2008 at 7:18

  • Changed state: Investigating

@GoogleCodeExporter
Copy link
Author

Please find attached.

Original comment by timothy....@gmail.com on 15 Dec 2008 at 9:42

Attachments:

@GoogleCodeExporter
Copy link
Author

I'm not ignoring this, but I have not been able to get my Linux system to 
connect to
my test SQL Server instance.  Networking issues w/ Vista & Windows 7.  sigh.

The traces looked nearly identical, so it is clearly something in the 
GetDataString
function.  Unfortunately the newer function is more correct.  I'm concerned 
there is
a problem with the driver.

Original comment by mkleehammer on 18 Mar 2009 at 3:51

@GoogleCodeExporter
Copy link
Author

I'm using 
- pyodbx-2.1.6
- unixODBC 2.2.12
- python2.6
on a Red Hat Enterprise (32)
to talk to SQL Server 2005.

I just want to comment that I think you are right that this is a driver problem.
I initially tested pyodbc using Easysoft SQL Server ODBC driver 1.1.4 and had 
the
same problem with Tim. Since I don't want to pay for the license ($$$$$), I 
ended up
installing FreeTDS 0.82 and found that the problem goes away. Configuration was
definitely harder for FreeTDS but the result is awesome. Hail to pyodbc and 
FreeTDS.

Original comment by real.jav...@gmail.com on 28 Aug 2009 at 8:50

@GoogleCodeExporter
Copy link
Author

Original comment by mkleehammer on 1 Jan 2010 at 6:45

  • Changed state: Invalid

@GoogleCodeExporter
Copy link
Author

Original comment by mkleehammer on 21 Nov 2010 at 4:43

  • Changed state: NoFix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant