Traceback (most recent call last):
File "mini.py", line 13, in
cursor.execute("INSERT INTO strings VALUES (1, ?)", "²")
File "src\ceODBC\cursor.pyx", line 423, in ceODBC.driver.Cursor.execute
File "src\ceODBC\cursor.pyx", line 268, in ceODBC.driver.Cursor._execute
File "src\ceODBC\errors.pyx", line 31, in ceODBC.driver._check_stmt_error
File "src\ceODBC\errors.pyx", line 23, in ceODBC.driver._check_error
File "src\ceODBC\errors.pyx", line 67, in ceODBC.driver._raise_from_odbc
File "src\ceODBC\errors.pyx", line 83, in ceODBC.driver._raise_from_string
ceODBC.exceptions.DatabaseError: [Microsoft][ODBC Driver 13 for SQL Server]String data, right truncation
I don't have access to SQL Server, but it sounds like an encoding issue. Can you specify the use of UTF-8 in the connect string and does that resolve the issue?
EDIT: I created a new issue instead of commenting on a closed one...
EDIT: I'm running:
EDIT: Added ODBC trace: SQL.LOG
Given this table declaration:
And the following Python code::
I get the following error:
Traceback (most recent call last): File "mini.py", line 13, in
cursor.execute("INSERT INTO strings VALUES (1, ?)", "²")
File "src\ceODBC\cursor.pyx", line 423, in ceODBC.driver.Cursor.execute
File "src\ceODBC\cursor.pyx", line 268, in ceODBC.driver.Cursor._execute
File "src\ceODBC\errors.pyx", line 31, in ceODBC.driver._check_stmt_error
File "src\ceODBC\errors.pyx", line 23, in ceODBC.driver._check_error
File "src\ceODBC\errors.pyx", line 67, in ceODBC.driver._raise_from_odbc
File "src\ceODBC\errors.pyx", line 83, in ceODBC.driver._raise_from_string
ceODBC.exceptions.DatabaseError: [Microsoft][ODBC Driver 13 for SQL Server]String data, right truncation