So, the problem that I am having is that when I try to do a query, I get
back the following error:

sqlalchemy.exc.ProgrammingError: (ProgrammingError) ('The SQL contains 0
parameter markers, but 1 parameters were supplied', 'HY000')

Yet, in the query output, it is clear that there is a value supplied.

Digging into this I found I could reproduce it at the pyodbc layer.
Messing around some more, I found that if I explicitly encoded the
strings, both the query and the bind param, to utf-8, that it would
succeed.  So:

cur.execute(u'select * from pk010033 where manufactureorder_i = ?',
(u'MO-MK25',))

fails, but

cur.execute(u'select * from pk010033 where manufactureorder_i =
?'.encode('utf-8'), (u'MO-MK25'.encode('utf-8'),))

worked.

I am now using a sqlalchemy.types.Unicode type for the bind param, and
am still getting the error.

So, I'm thinking that perhaps the query string emitted from the query
module isn't being explicitly encoded.  I don't really know where to
start looking in order to verify this, however.

Any help or pointers are greatly appreciated

-John

P.S.  I am using convert_unicode=True in the database connection string.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
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