保留尾随空格 Sybase [英] Preserve trailing whitespace Sybase

查看:30
本文介绍了保留尾随空格 Sybase的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一大块文本数据,我将这些数据拆分并写入表的 varchar(255) 列的多行.有时,最后一个字符恰好是一个空格.当我读回这一行时,尾随空格被截断,我只得到 254 个字符.当我将下一行附加到这一行的末尾时,这会弄乱我的数据.

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. 我的代码将完整的 255 个字符(包括空间)发送到 DB API.如何检查尾随空格是否实际写入表中?

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

我无法重写/重新设计遗留代码.是否有任何设置 - 无论是在数据库、数据库接口、读/写调用等中 - 我可以用来保留尾随空间?

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?

推荐答案

这是 varchars 将剥离的设计行为.如果要保留所有填充空间,则必须使用 char 列.所以你唯一能做的就是改变方案

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

这篇关于保留尾随空格 Sybase的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆