ANYDATA特殊列,屬於Oracle內建列,對於Oracle數據庫,每個值都是一種數據類型。當用戶建立表或聚簇時,須要爲每個列指定對應的數據類型。即便是建立存儲過程或函數的時,同樣須要爲參數指定相應的數據類型。git
一個數據類型能夠是標量的或非標量的,標的包含一個原子值,非標量的(有時成爲集合)包含一個集合值。LOB(Large Object)就是一個特殊形式的標量數據類型表示大量的標量、二進制或字符數據,sql
Oracle內建數據類型可分爲以下幾類:數據庫
Oracle中經過Code代碼來指代相應的數據類型,以下表所示:session
Table 2-1 Built-in Data Type Summaryoracle
Code | Data Type | Description |
---|---|---|
1ide |
|
Variable-length character string having maximum length
Refer to "Extended Data Types" for more information on the
|
1 |
|
Variable-length Unicode character string having maximum length
Refer to "Extended Data Types" for more information on the |
2 |
|
Number having precision |
2 |
|
A subtype of the |
8 |
|
Character data of variable length up to 2 gigabytes, or 231 -1 bytes. Provided for backward compatibility. |
12 |
|
Valid date range from January 1, 4712 BC, to December 31, 9999 AD. The default format is determined explicitly by the |
100 |
|
32-bit floating point number. This data type requires 4 bytes. |
101 |
|
64-bit floating point number. This data type requires 8 bytes. |
180 |
|
Year, month, and day values of date, as well as hour, minute, and second values of time, where |
181 |
|
All values of |
231 |
|
All values of
The default format is determined explicitly by the |
182 |
|
Stores a period of time in years and months, where |
183 |
|
Stores a period of time in days, hours, minutes, and seconds, where
The size is fixed at 11 bytes. |
23 |
|
Raw binary data of length
Refer to "Extended Data Types" for more information on the |
24 |
|
Raw binary data of variable length up to 2 gigabytes. |
69 |
|
Base 64 string representing the unique address of a row in its table. This data type is primarily for values returned by the |
208 |
|
Base 64 string representing the logical address of a row of an index-organized table. The optional |
96 |
|
Fixed-length character data of length
|
96 |
|
Fixed-length character data of length |
112 |
|
A character large object containing single-byte or multibyte characters. Both fixed-width and variable-width character sets are supported, both using the database character set. Maximum size is (4 gigabytes - 1) * (database block size). |
112 |
|
A character large object containing Unicode characters. Both fixed-width and variable-width character sets are supported, both using the database national character set. Maximum size is (4 gigabytes - 1) * (database block size). Stores national character set data. |
113 |
|
A binary large object. Maximum size is (4 gigabytes - 1) * (database block size). |
114 |
|
Contains a locator to a large binary file stored outside the database. Enables byte stream I/O access to external LOBs residing on the database server. Maximum size is 4 gigabytes. |
Any類型用於處理未知的過程參數和表列的實際類型。該數據類型能夠讓你動態的封裝和訪問類型描述,數據實例和任何SQL類的實例數據集,這些類型由OCI和PL/SQL接口構造和訪問
該類型包含一個對任何SQL類型的名或未命名的臨時類型的類型描述。
該類型包含一個給定的類型實例,數據類型加描述,ANYDATA能夠向表中列的數據類型那樣使用,而且將各類混雜的值存於該列之中。這些值能夠是SQL內建類型和用戶定義類型。
該類型包含一個給定的類型描述加類型實例集,ANYDATASET可靈活的用於過程參數數據類型,這些值一樣能夠是SQL內建類型和用戶定義類型。
數據類型的介紹:
http://docs.oracle.com/database/121/SQLRF/sql_elements001.htm#SQLRF0021