ANYDATA介绍


ANYDATA特殊列,属于Oracle内建列,对于Oracle数据库,每一个值都是一种数据类型。当用户创建表或聚簇时,需要为每一个列指定对应的数据类型。即使是创建存储过程或函数的时,一样需要为参数指定相应的数据类型。一个数据类型可以是标量的或非标量的,标的包含一个原子值,非标量的(有时成为集合)包含一个集合值。LOB(Large Object)就是一个特殊形式的标量数据类型表示大量的标量、二进制或字符数据,Oracle内建数据类型可分为如下几类:Oracle中通过Code代码来指代相应的数据类型,如下表所示:Table 2-1 Built-in Data Type Summary1VARCHAR2(size[BYTE|CHAR])Variable-length character string having maximum lengthsizebytes or characters. You must specifysizeforVARCHAR2. Minimumsizeis 1 byte or 1 character. Maximum size is:32767 bytes or characters ifMAX_STRING_SIZE=EXTENDED4000 bytes or characters ifMAX_STRING_SIZE=STANDARDRefer to“Extended Data Types”for more information on theMAX_STRING_SIZEinitialization parameter.BYTEindicates that the column will have byte length semantics.CHARindicates that the column will have character semantics.1NVARCHAR2(size)Variable-length Unicode character string having maximum lengthsizecharacters. You must specifysizeforNVARCHAR2. The number of bytes can be up to two timessizeforAL16UTF16encoding and three timessizeforUTF8encoding. Maximumsizeis determined by the national character set definition, with an upper limit of:32767 bytes ifMAX_STRING_SIZE=EXTENDED4000 bytes ifMAX_STRING_SIZE=STANDARDRefer to“Extended Data Types”for more information on theMAX_STRING_SIZEinitialization parameter.2NUMBER[ (p[,s]) ]Number having precisionpand scales. The precisionpcan range from 1 to 38. The scalescan range from -84 to 127. Both precision and scale are in decimal digits. ANUMBERvalue requires from 1 to 22 bytes.2FLOAT[(p)]A subtype of theNUMBERdata type having precisionp. AFLOATvalue is represented internally asNUMBER. The precisionpcan range from 1 to 126 binary digits. AFLOATvalue requires from 1 to 22 bytes.8LONGCharacter data of variable length up to 2 gigabytes, or 231-1 bytes. Provided for backward compatibility.12DATEValid date range from January 1, 4712 BC, to December 31, 9999 AD. The default format is determined explicitly by theNLS_DATE_FORMATparameter or implicitly by theNLS_TERRITORYparameter. The size is fixed at 7 bytes. This data type contains the datetime fieldsYEAR,MONTH,DAY,HOUR,MINUTE, andSECOND. It does not have fractional seconds or a time zone.100BINARY_FLOAT32-bit floating point number. This data type requires 4 bytes.101BINARY_DOUBLE64-bit floating point numbe免费云主机域名r. This data type requires 8 bytes.180TIMESTAMP[(fractional_seconds_precision)]Year, month, and day values of date, as well as hour, minute, and second values of time, wherefractional_seconds_precisionis the number of digits in the fractional part of theSECONDdatetime field. Accepted values offractional_seconds_precisionare 0 to 9. The default is 6. The default format is determined explicitly by theNLS_TIMESTAMP_FORMATparameter or implicitly by theNLS_TERRITORYparameter. The size is 7 or 11 bytes, depending on the precision. This data type contains the datetime fieldsYEAR,MONTH,DAY,HOUR,MINUTE, andSECOND. It contains fractional seconds but does not have a time zone.181TIMESTAMP[(fractional_seconds_precision)]WITHTIMEZONEAll values ofTIMESTAMPas well as time zone displacement value, wherefractional_seconds_precisionis the number of digits in the fractional part of theSECONDdatetime field. Accepted values are 0 to 9. The default is 6. The default format is determined explicitly by theNLS_TIMESTAMP_FORMATparameter or implicitly by theNLS_TERRITORYparameter. The size is fixed at 13 bytes. This data type contains the datetime fieldsYEAR,MONTH,DAY,HOUR,MINUTE,SECOND,TIMEZONE_HOUR, andTIMEZONE_MINUTE. It has fractional seconds and an explicit time zone.231TIMESTAMP[(fractional_seconds_precision)]WITHLOCALTIMEZONEAll values ofTIMESTAMPWITHTIMEZONE, with the following exceptions:Data is normalized to the database time zone when it is stored in the database.When the data is retrieved, users see the data in the session time zone.The default format is determined explicitly by theNLS_TIMESTAMP_FORMATparameter or implicitly by theNLS_TERRITORYparameter. The size is 7 or 11 bytes, depending on the precision.182INTERVALYEAR[(year_precision)]TOMONTHStores a period of time in years and months, whereyear_precisionis the number of digits in theYEARdatetime field. Accepted values are 0 to 9. The default is 2. The size is fixed at 5 bytes.183INTERVALDAY[(day_precision)]TOSECOND[(fractional_seconds_precision)]Stores a period of time in days, hours, minutes, and seconds, whereday_precisionis the maximum number of digits in theDAYdatetime field. Accepted values are 0 to 9. The default is 2.fractional_seconds_precisionis the number of digits in the fractional part of theSECONDfield. Accepted values are 0 to 9. The default is 6.The size is fixed at 11 bytes.23RAW(size)Raw binary data of lengthsizebytes. You must specifysizefor aRAWvalue. Maximumsizeis:32767 bytes ifMAX_STRING_SIZE=EXTENDED2000 bytes ifMAX_STRING_SIZE=STANDARDRefer to“Extended Data Types”for more information on theMAX_STRING_SIZEinitialization parameter.24LONG RAWRaw binary data of variable length up to 2 gigabytes.69ROWIDBase 64 string representing the unique address of a row in its table. This data type is primarily for values returned by theROWIDpseudocolumn.208UROWID[(size)]Base 64 string representing the logical address of a row of an index-organized table. The optionalsizeis the size of a column of typeUROWID. The maximum size and default is 4000 bytes.96CHAR[(size[BYTE|CHAR])]Fixed-length character data of lengthsizebytes or characters. Maximumsizeis 2000 bytes or characters. Default and minimumsizeis 1 byte.BYTEandCHARhave the same semantics as forVARCHAR2.96NCHAR[(size)]Fixed-length character data of lengthsizecharacters. The number of bytes can be up to two timessizeforAL16UTF16encoding and three timessizeforUTF8encoding. Maximumsizeis determined by the national character set definition, with an upper limit of 2000 bytes. Default and minimumsizeis 1 character.112CLOBA 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).112NCLOBA 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.113BLOBA binary large object. Maximum size is (4 gigabytes – 1) * (database block size).114BFILEContains 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

相关推荐: linux7安装rac11.2.0.4 安装数据库软件选择不到节点

解决方式如下:[root@ora02std ContentsXML]# pwd/u01/app/oraInventory/ContentsXML[root@ora02std ContentsXML]#[root@ora0免费云主机域名2std Contents…

免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。

(0)
打赏 微信扫一扫 微信扫一扫
上一篇 01/01 19:00
下一篇 01/01 19:00