开发者

Preserve trailing whitespace Sybase

开发者 https://www.devze.com 2023-01-01 09:49 出处:网络
I have a big chunk of textual data which I split and write multiple rows of a varchar(255) column of a table. Sometimes, the last character happens to be a space. When I read back this row, the traili

I have a big chunk of textual data which I split and write multiple rows of a varchar(255) column of a table. Sometimes, the last character happens to be a space. When I read back this row, the trailing space is chopped and I get only 254 characters. This messes up my data when I append the next row to the end of this one.

  1. My code sends the full 255 char (incl space) to the DB API. Ho开发者_StackOverfloww can I check that the trailing space is actually written to the table?

  2. I am not in a position to rewrite/redesign legacy code. Is there any setting - either in the DB, DB interface, read/write calls etc - that I can use to preserve the trailing space?


This is designed behaviour varchars will strip. If you want to keep all the filling spaces you have to use char columns. So the only thing you can do is change the schems

0

精彩评论

暂无评论...
验证码 换一张
取 消