ANYDATA特殊列,屬于Oracle内建列,對于Oracle資料庫,每一個值都是一種資料類型。當使用者建立表或聚簇時,需要為每一個列指定對應的資料類型。即使是建立存儲過程或函數的時,一樣需要為參數指定相應的資料類型。
一個資料類型可以是标量的或非标量的,标的包含一個原子值,非标量的(有時成為集合)包含一個集合值。LOB(Large Object)就是一個特殊形式的标量資料類型表示大量的标量、二進制或字元資料,
Oracle内建資料類型可分為如下幾類:

Oracle中通過Code代碼來指代相應的資料類型,如下表所示:
Table 2-1 Built-in Data Type Summary
Code | Data Type | Description |
---|---|---|
1 | ( [ | ]) | Variable-length character string having maximum length bytes or characters. You must specify for . Minimum is 1 byte or 1 character. Maximum size is:
initialization parameter. indicates that the column will have byte length semantics. indicates that the column will have character semantics. |
) | Variable-length Unicode character string having maximum length characters. You must specify . The number of bytes can be up to two times encoding and three times encoding. Maximum is determined by the national character set definition, with an upper limit of:
| |
2 | [ ( [, ]) ] | Number having precision and scale . The precision can range from 1 to 38. The scale can range from -84 to 127. Both precision and scale are in decimal digits. A value requires from 1 to 22 bytes. |
[( )] | A subtype of the data type having precision . A value is represented internally as can range from 1 to 126 binary digits. A value requires from 1 to 22 bytes. | |
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 parameter or implicitly by the parameter. The size is fixed at 7 bytes. This data type contains the datetime fields , , , and . It does not have fractional seconds or a time zone. |
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 is the number of digits in the fractional part of the datetime field. Accepted values of are 0 to 9. The default is 6. The default format is determined explicitly by the parameter. The size is 7 or 11 bytes, depending on the precision. This data type contains the datetime fields . It contains fractional seconds but does not have a time zone. |
181 | )] | All values of as well as time zone displacement value, where is the number of digits in the fractional part of the datetime field. Accepted values are 0 to 9. The default is 6. The default format is determined explicitly by the parameter. The size is fixed at 13 bytes. This data type contains the datetime fields . It has fractional seconds and an explicit time zone. |
231 | | , with the following exceptions:
parameter. The size is 7 or 11 bytes, depending on the precision. |
182 | | Stores a period of time in years and months, where is the number of digits in the datetime field. Accepted values are 0 to 9. The default is 2. The size is fixed at 5 bytes. |
183 | | Stores a period of time in days, hours, minutes, and seconds, where
|
23 | | Raw binary data of length bytes. You must specify for a value. Maximum is:
|
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 pseudocolumn. |
208 | | Base 64 string representing the logical address of a row of an index-organized table. The optional is the size of a column of type . The maximum size and default is 4000 bytes. |
96 | ])] | Fixed-length character data of length bytes or characters. Maximum is 2000 bytes or characters. Default and minimum is 1 byte. and have the same semantics as for . |
| characters. The number of bytes can be up to two times encoding. Maximum is determined by the national character set definition, with an upper limit of 2000 bytes. Default and minimum is 1 character. | |
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). |
| 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 Types
Any類型用于處理未知的過程參數和表列的實際類型。該資料類型可以讓你動态的封裝和通路類型描述,資料執行個體和任何SQL類的執行個體資料集,這些類型由OCI和PL/SQL接口構造和通路
ANYTYPE
該類型包含一個對任何SQL類型的名或未命名的臨時類型的類型描述。
ANYDATA
該類型包含一個給定的類型執行個體,資料類型加描述,ANYDATA可以向表中列的資料類型那樣使用,并且将各種混雜的值存于該列之中。這些值可以是SQL内建類型和使用者定義類型。
ANYDATASET
該類型包含一個給定的類型描述加類型執行個體集,ANYDATASET可靈活的用于過程參數資料類型,這些值同樣可以是SQL内建類型和使用者定義類型。
資料類型的介紹:
http://docs.oracle.com/database/121/SQLRF/sql_elements001.htm#SQLRF0021