SQL DB2 的 Varchar(Max) 等价物是多少?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2949668/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the Varchar(Max) equivalent for DB2?
提问by Zian Choy
In DB2, is there a datatype that allows the string to grow and shrink dynamically like the Varchar(Max) datatype in SQL Server database?
在 DB2 中,是否有一种数据类型允许字符串像 SQL Server 数据库中的 Varchar(Max) 数据类型一样动态增长和收缩?
采纳答案by Guffa
No, according to thisand this, DB2 doesn't have a large capacity text type.
You can use the VARCHAR(n)
data type for text. Please keep in mind that n
is the maximum length of bytesand not the character length. The maximum length is 32704 in byte. This is important if you are using a UTF-8 encoded database.
您可以将VARCHAR(n)
数据类型用于文本。请记住,这n
是字节的最大长度,而不是字符长度。最大长度为 32704 字节。如果您使用的是 UTF-8 编码的数据库,这一点很重要。
回答by gbn
It should be "CLOB"
应该是“CLOB”
Guffa's link does mention this but fails to match CLOB and VARCHAR.
Guffa 的链接确实提到了这一点,但未能匹配 CLOB 和 VARCHAR。