On Nov 8, 2007 7:30 PM, Paul Johnston <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> >I have isolated the problem a little bit more: my column is defined in
> >the MSSQL server as a user defined type which is based on VARCHAR.
> >
> >
> Ok, so in this case you'd like SA to return a python unicode object when
> a VARCHAR is fetched, by decoding using the database's encoding? While I

yep :)

> understand your requirement, this seems to me to be a special case. I
> think most people would expect a normal string in this case. I wonder if
> you should define a MyString class in your app and use that.

humm What bothers me is that I already get this comportement when
running my query program from a Linux host (using pyodbc same version)
but need the above mentioned patch on a windows host so there is
definitely a different behavior.

>
> If we do decide to implement this, does anyone know how python can find
> out what database encoding MSSQL is using?

in each mssql db there is a syscolumns table that references each
column by name and has a "collation" column that give the
corresponding collation name. This is far from perfect but I don't
know better at the moment :-/.

>From my point of view I am responsible to give the engine the right
encoding when I instantiate it. At the moment I have a master database
that provides me this info and so I feed it to the constructor at
engine creation time.

Florent.

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to