AFAIK, there's nothing in SQLA that will address this -- the issue sounds
new to me, and it seems to me that it's pretty clearly some kind of
pyodbc/FreeTDS issue. Check your character encoding settings, there's quite
a few reported issues with MSSQL + pyodbc + unicode statements. You may want
to browse the FreeTDS lists as well. Please report back anything pertinent
that you find.



On Tue, May 12, 2009 at 4:13 PM, Yannick Gingras <yging...@ygingras.net>wrote:

>
>
> Hi, I also reported this problem on the pyodbc mailing list but maybe
> one of you know a workaround.
>
> I'm trying to use pyodbc on RHEL 5.3 64 bit but all my strings are
> filled with garbage after position 1024.  Here is an example:
>
>  import pyodbc
>  conn = pyodbc.connect('DRIVER={SQL
> Server};UID=foo;PWD=bar;DATABASE=qux;SERVER=quux;TDS_Version=8.0')
>  conn.execute("select %r" % ("=" * 1030))
>
> This is what I get back:
>
>
> [('===============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================\x00\x01\x00i;S+',
> )]
>
> This is the content of my /etc/odbcinst.ini:
> ------------------------------
> [SQL Server]
> Description = FreeTDS Driver
> Driver = /usr/lib64/libtdsodbc.so.0
> UsageCount = 1
> ------------------------------
>
> When I try to do the same on Ubuntu 8.10, both 32 bit and 64 bit, I
> get expected result, that is, a string of "=" 1030 character long.
>
> On RHEL 5.3, unixodbc is 2.2.11-7.1, on Ubuntu it's 2.2.11-16build2,
> what ever that means.  I'm running Pyodbc 2.1.5 on Python 2.5.
>
> I get the same error with SQLAlchemy 0.5.3 with the following:
>
>  from sqlalchemy import create_engine
>  eng = create_engine("mssql://foo:b...@qux/quux?DRIVER={SQL
> Server}&TDS_Version=7.0")
>  conn = eng.connect()
>  conn.execute(...).fetchall()
>
> Anyone has an idea on what can cause this and how it can be solved?
>
> My idea was to fall back on pymssql but Alchemy 0.5.3 does not seem to
> like pymssql 1.0.2 and I find 0.8 has documented problems on 64 bit
> systems.  What do you guys recommend?  Running the experimental 0.6
> Alchemy branch?
>
> --
> Yannick Gingras
> http://ygingras.net/
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to