mxODBC support sql command in Unicode? 
Author Message
 mxODBC support sql command in Unicode?

Hi,

Just downloaded latest mxODBC module, and have a problem here:
#I'm on Win2K, latest ActivePython binary distro
conn = Windows.connect(...)
cursor = conn.cursor()
cursor.execute(u'select * from my table')
...
I get an error message like:
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: SQL command must be a string

so, does mxODBC cursor support a sql command string in unicode? I got
the same error message regardless of underlying database driver I'm
using ( I used ODBC drivers from Oracle 8.1.7, MS SQL 7.0, Sybase ASE
11.x), so I wonder if it's a limitation of mxODBC?

Is there a work around for this?

Thanks.

--Li Lin



Sun, 16 Nov 2003 02:38:53 GMT  
 mxODBC support sql command in Unicode?

Quote:

> Hi,

> Just downloaded latest mxODBC module, and have a problem here:
> #I'm on Win2K, latest ActivePython binary distro
> conn = Windows.connect(...)
> cursor = conn.cursor()
> cursor.execute(u'select * from my table')
> ...
> I get an error message like:
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: SQL command must be a string

> so, does mxODBC cursor support a sql command string in unicode? I got
> the same error message regardless of underlying database driver I'm
> using ( I used ODBC drivers from Oracle 8.1.7, MS SQL 7.0, Sybase ASE
> 11.x), so I wonder if it's a limitation of mxODBC?

> Is there a work around for this?

mxODBC currently only supports Unicode in parameters passed
to the statement and columns fetched from the result set and
then only if the ODBC driver supports this (most don't).

The reason for not supporting Unicode as statement is that
this would require using ODBC Unicode APIs which is currently
not supported.

BTW, why would you want to write SQL in Unicode ?

--
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Company & Consulting:                           http://www.egenix.com/
python Software:                        http://www.lemburg.com/python/



Sun, 16 Nov 2003 04:47:52 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. mxODBC SQL Type error with MS SQL Server

2. Support for UNICODE in "binary" command

3. ANNOUNCE: unicode 0.4, command line unicode database query tool

4. mxODBC -- InterfaceError: SQL type (code -9) not implemented

5. mxODBC and MS SQL Server

6. mxODBC and SQL-Server

7. Bug in mxODBC setconnectoption() with SQL.ATTR_CURRENT_CATALOG?

8. Unicode problem from SQL Server DB

9. Q: Unicode support for text edit control? (D5)

10. APL2 support for Unicode

11. UNICODE support

12. CW 2.0 and unicode support

 

 
Powered by phpBB® Forum Software