[python-sybase] Unicode SQL

Marcos Sánchez Provencio rapto at arrakis.es
19 Feb 2003 13:28:15 +0100

Hi there.

¿Is it possible to issue a query such as "select 'año' "? (in case it
does not show, between the a and the o there is a n with a ~ on top, a
very usual char in Spain/España).

It works from tsql (include with freetds)::

marcos@cynar:/usr/local/Webware/WebKit$ tsql -Scazalla -Usa
locale is "es_ES@euro"
charset is "ISO-8859-15"
Msg 5703, Level 0, State 1, Server CAZALLA, Line 0
Changed language setting to us_english.
1> select 'año'
2> go


Using Python

SELECT 'año' from usuarios 
Traceback (most recent call last):
  File "etcPythonSybase.py", line 227, in ?
  File "etcPythonSybase.py", line 203, in lookup
  File "etcPythonSybase.py", line 122, in lookupRS
  File "/usr/lib/python2.2/site-packages/Sybase.py", line 381, in
  File "/usr/lib/python2.2/site-packages/Sybase.py", line 547, in
    status, result = self._cmd.ct_results()
  File "/usr/lib/python2.2/site-packages/Sybase.py", line 145, in
    raise DatabaseError(_fmt_server(msg))
Sybase.DatabaseError: Msg 105, Level 15, State 1, Line 1
Unclosed quotation mark before the character string
'a???????????????..?'.Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'a???????????????..?'.

I appreciate any pointers. The client is linux, freetds, the server is

Marcos Sánchez Provencio <rapto@arrakis.es>