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:

Code:

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

      

Mistake:

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.

+3


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 http://www.connectionstrings.com/sql-server/ 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.

0


source







All Articles