jangbagu / pypyodbc

Automatically exported from code.google.com/p/pypyodbc
0 stars 0 forks source link

Trimmed varchar results. #44

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Create procedure which returns more than 2048 characters length varchar column.

What is the expected output? What do you see instead?

Result is trimmed.

What version of the product are you using? On what operating system?

MS SQL 2012 Express + Python 3.4

Please provide any additional information below.

After modifying pypyodbc.py I've managed to overcome this issue only by 
changing line:

SQL_VARCHAR         : (str,                 lambda x: x,                
SQL_C_CHAR,         create_buffer,      2048  ,         False         ),

to

SQL_VARCHAR         : (str,                 lambda x: x,                
SQL_C_CHAR,         create_buffer,      2048  ,         True          ),

I've also changed this for SQL_WVARCHAR. Now it's working.

Did I fix this right, or was that False value right and I should overcome this 
differently?

Original issue reported on code.google.com by dstan...@gmail.com on 16 Jul 2014 at 8:10