Python - pyodbc parameter to increase package size in stored procedure parameters

I am using Python2.7 s pyodbc==3.0.7

to connect to SQL Server.

Everything is ok, but when I call the stored procedure with a string parameter that is 480 characters long, it returns below the error:


cursor.execute("{CALL SP_NAME(?)}", (param))



There were no errors in the driver!

But when I call SP

with fewer characters it works.

So how do I increase the transmission packet size in pyobbc?

Note . This issue does not exist on Windows, but it does show up on Unix.


source to share

1 answer

The maximum module length pyodbc

is 255 characters per transfer to Unix. I have checked some type attributes packet size

in the connection string via this link but it has no effect.

If you need to increase this, you need to modify the unixODBC-devel package on base Unix systems. Or reduce the size of your packet in every SP call.



All Articles