发布网友 发布时间:2022-04-25 18:16
共1个回答
热心网友 时间:2023-10-03 06:42
VARCHAR和VARCHAR2是一样的东西,都是可变长的(不会用空格填充的)
Varchar不推荐使用,Oracle公司以后可能会用Varchar做其他用途,但Varchar2肯定不会,Oracle公司做过保证
它们两个的定义如下:
VARCHAR
The VARCHAR datatype stores character strings of varying length. The first two bytes contain the length of the character string, and the remaining bytes contain the string. The specified length of the string in a bind or a define call must include the two length bytes, so the largest VARCHAR string that can be received or sent is 65533 bytes long, not 65535. For converting longer strings, use the LONG VARCHAR external datatype.
VARCHAR2
The VARCHAR2 datatype is a variable-length string of characters with a maximum length of 4000 bytes.