Byte String Too Long Error In Python Using Pypyodbc 1.3.4
Getting byte string too long error while saving more than 127 characters in Unix environment while using pypyodbc 1.3.4 and Python Anaconda 3.5. Gone through this link Byte string
Solution 1:
I ran into the same issue with NVARCHAR(MAX) on MS SQL and pypyodbc 1.3.4:
cursor.execute("insert into mytable (my_nvarchar_max_column) values (?)", "some long text here......")
fails with 'byte string too long' error.
Passing the string as a byte array works:
cursor.execute("insert into mytable (my_nvarchar_max_column) values (?)",
"some long text here......".encode('utf8'))
Post a Comment for "Byte String Too Long Error In Python Using Pypyodbc 1.3.4"