永发信息网

求解:db2 length函数疑问

答案:2  悬赏:70  手机版
解决时间 2021-04-26 10:48
  • 提问者网友:了了无期
  • 2021-04-26 05:59
求解:db2 length函数疑问
最佳答案
  • 五星知识达人网友:野慌
  • 2021-04-26 06:26
你的编码是多少???不同编码取的长度不一样的..

官网溜达了下..db2 9版本后的说明
LENGTH ( expression, CODEUNITS16/ CODEUNITS32/ OCTETS )

CODEUNITS16, CODEUNITS32, or OCTETS Specifies the string unit of the result.
CODEUNITS16 specifies that the result is to be expressed in 16-bit UTF-16 code units. CODEUNITS32 specifies that the result is to be expressed in 32-bit UTF-32 code units. OCTETS specifies that the result is to be expressed in bytes. If a string unit is explicitly specified, and if expression is not string data, an error is returned (SQLSTATE 428GC). If a string unit is specified as CODEUNITS16 or CODEUNITS32, and expression is a binary string or bit data, an error is returned (SQLSTATE 428GC). If a string unit is specified as OCTETS and expression is a binary string, an error is returned (SQLSTATE 42815). For more information about CODEUNITS16, CODEUNITS32, and OCTETS, see “String units in built-in functions” in “Character strings”.追问不同编码对decimal类型的长度会有影响吗?我认为不是这个的原因。追答官网就这么说的..

仔细看看..CODEUNITS16, CODEUNITS32, or OCTETS Specifies the string unit of the result.CODEUNITS16 specifies that the result is to be expressed in 16-bit UTF-16 code units. CODEUNITS32 specifies that the result is to be expressed in 32-bit UTF-32 code units.
全部回答
  • 1楼网友:像个废品
  • 2021-04-26 07:47
你标题上写的是DB2的length,下面说的是oracle的length两个数据一样吗,是不是你比较错了?
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯