DB2 VARCHAR unicode数据存储 [英] DB2 VARCHAR unicode data storage

查看:109
本文介绍了DB2 VARCHAR unicode数据存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用VARCHAR在DB2中存储文本数据,但是我们遇到了指定的VARCHAR长度与文本长度不相同的问题,因为在指定的DB2 VARCHAR长度中,UTF-8的数据长度可能会根据存储文本数据。例如,一些文本包含来自不同语言的字符,并且因为它具有500个字符的一些文本不能保存在VARCHAR(500)等中。

We are currently using VARCHAR for storing text data in DB2 however we are hitting the problem that length of VARCHAR specified is not the same as length of text because in DB2 VARCHAR length specified is UTF-8 data length which can vary depending on stored text data. For example some texts contain characters from different languages and because of it some texts with 500 characters can't be saved in VARCHAR(500) and etc.

现在我们正在规划迁移到VARGRAPHIC。我需要知道使用VARGRAPHIC在DB2中存储unicode文本数据有什么限制。
使用VARGRAPHIC有什么问题吗?

Now we are planning to migrate to VARGRAPHIC. I need to know what are limitations of using VARGRAPHIC for storing unicode text data in DB2. Are there any problems with using VARGRAPHIC?

推荐答案

DB2不检查数据实际上是双字节字符串,但它假定它必须是。通常,驱动程序将为您做适当的转换,但您可能有一天会碰到一些错误。不太可能。

DB2 doesn't check that the data is in fact double-byte String, but it assumes it must be. Usually the drivers will do proper conversions for you but you might one day bump into some bug. It is unlikely though.

如果使用联合数据库查询中的Vargraphic支持可能会完全失败。总体上,vargraphic数据类型的错误报告的数量有所增加。支持它不会像其他数据类型一样被测试和尝试。

If you use federated databases Vargraphic support in queries might fail completely. In overall the amount of bug reports for vargraphic data types is somewhat high. Support for it isn't probably as well tested and tried as for other data types.

Varic将与unicode数据库(即UTF-8是要求) endian UCS-2,这意味着你对这些列的空间要求是双倍的。 Vargraphic是DB2专有数据类型。如果您有时迁移DB2,您将不得不进行额外的转换。

Vargraphic will with unicode database (ie. UTF-8 is requirement) use big-endian UCS-2, meaning your space requirements for those columns double. Vargraphic is DB2 properietary data type. If you migrate off DB2 some day you will have to do an extra conversion.

这篇关于DB2 VARCHAR unicode数据存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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