【引】http://hi.baidu.com/zzuhpc/blog/item/b3c5c138f08ebcf53a87cec8.html
1.char
2.varchar/varchar2
3.nvarchar/nvarchar2
orcale 中varchar2 和nvarchar2的區(qū)別
在sql ref書中介紹到
1 VARCHAR2(size)
[BYTE | CHAR]
Variable-length character string having maximum
length size bytes or characters. Maximum size is
4000 bytes, and minimum is 1 byte or 1 character.
You must specify size for VARCHAR2.
BYTE indicates that the column will have byte
length semantics; CHAR indicates that the column
will have character semantics.
1 NVARCHAR2(size) Variable-length character string having maximum
length size characters or bytes, depending on the
choice of national character set. Maximum size is
determined by the number of bytes required to store
each character, with an upper limit of 4000 bytes.
You must specify size for NVARCHAR2.
中文大意:
VARCHAR2(size),可變長(zhǎng)度的字符串,其最大長(zhǎng)度為 size 個(gè)字節(jié)。size 的最大值是 4000,而最小值是 1。您必須指定一個(gè) VARCHAR2 的 size。
NVARCHAR2(size),可變長(zhǎng)度的字符串,依據(jù)所選的國(guó)家字符集,其最大長(zhǎng)度為 size 個(gè)字符或字節(jié)。size 的最大值取決于存儲(chǔ)每個(gè)字符所需要的字節(jié)數(shù),其上限為 4000 個(gè)字節(jié)。您必須為 NVARCHAR2 指定一個(gè) size。
相同點(diǎn):都是可變長(zhǎng)度字符串(char類型是不變長(zhǎng)度),都必須指定大小
不同點(diǎn):VARCHAR2存放的英文字符只占一個(gè)字節(jié),而nvarchar2依據(jù)所選的字符集,大多為兩個(gè)