I'm using Python to read and write SAS datasets, using pyodbc
and the SAS ODBC drivers. I can load the data perfectly well, but when I save the data, using something like:
cursor.execute('insert into dataset.test VALUES (?)', u'testing')
... I get a pyodbc.Error: ('HY004', '[HY004] [Microsoft][ODBC Driver Manager] SQL data type out of range (0) (SQLBindParameter)')
error.
The problem seems to be the fact I'm passing a unicode string; what do I need to do to handle this?