[egenix-users] Empty strings and executedirect

Tommi Auvinen tommi.auvinen at wicom.com
Mon May 14 18:01:05 CEST 2007


Environment: Windows client and SQLServer. Python 2.43 and mxODBC 2.0.7.

 

When I do the following insert using execute direct (C = char,
VC=varchar etc.)

"INSERT INTO Testi (C, VC, NC, NVC) VALUES (?,?,?,?)"

 

using parameters ("", "",""; "")

 

the resulting insert is as follows

exec sp_executesql N'INSERT INTO Testi (C, VC, NC, NVC) VALUES
(@P1, at P2, at P3, at P4)',N'@P1 char(8000), at P2 char(8000), at P3 char(8000), at P4
char(8000) ...

...and the data for each fields really is 8000 spaces.

 

The same using strings with one space (" ", " "," "; " ") works as
expected: 

exec sp_executesql N'INSERT INTO Testi (C, VC, NC, NVC) VALUES
(@P1, at P2, at P3, at P4)',N'@P1 char(1), at P2 char(1), at P3 char(1), at P4 char(1)','
',' ',' ',' '

 

So, am I missing something and or is this a bug? 

 

R:TAu

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: /mailman-archives/egenix-users/attachments/20070514/4df17cdb/attachment.htm


More information about the egenix-users mailing list