oracle資料類型-1,oracle資料類型

來源:互聯網
上載者:User

oracle資料類型-1,oracle資料類型
在Oracle資料庫中,每個關係表都由許多列組成。給每一列指派特定的資料類型來定義將在這個列中儲存得資料類型。

1、CHAR
最多可以以固定長度的格式儲存2000個字元或位元組。預設指定為以字元形式進行儲存,這個資料類型是固定長度的,並且當位元不夠時,需要在其右邊添加空格來補滿。

2、VARCHAR和VARCHAR2
最多可以以可變長度來儲存4000B,因此不需要空格來作補充。VARCHAR2 比 VARCHAR 更適合使用,由於相容性的原因,所以仍然在 Oracle 資料庫中保留著 VARCHAR 。

3、NCHAR
NLS(national language support , 國際語言支援)的資料類型僅可以儲存由資料庫 NLS 字元集定義的 Unicode 字元集。該資料類型最多可以儲存2000B。NCHAR 的列在位元不夠時需要在右邊填充空格。例如:

4、NVARCHAR2
NLS 的資料類型與 VARCHAR2 資料類型等價。這個資料類型最多可儲存4000B 。例如:

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.