Oracle Built-in Data Types

 

The table that follows summarizes 总结 Oracle built-in data types. Refer to the syntax in the preceding sections for the syntactic elements. The codes代码 listed for the data types are used internally by Oracle Database. The data type code of a column or object attribute is returned by the DUMP function.

Table 3-1 Built-in Data Type Summary

CodeData TypeDescription

1

VARCHAR2(size [BYTE | CHAR])

length size Variable-length character string having maximum bytes字节 or characters. 字符Maximum sizeis 4000 bytes or characters, and minimum is 1 byte or 1 character. You must specify指定size forVARCHAR2.

BYTE indicates表示 that the column will have byte length semantics语义CHAR indicates that the column will have character semantics.

1

NVARCHAR2(size)

Variable-length Unicode character string having maximum length size characters. The number of bytes can be up to two times size for AL16UTF16 encoding and three times size for UTF8 encoding. Maximumsize is determined决定 by the national character set definition定义, with an upper limit of上限4000 bytes. You must specify指定 size forNVARCHAR2.

2

NUMBER [ (p [, s]) ]

Number having precision精度 p and scale标度 s. The precision p can range范围 from 1 to 38. The scale s can range from -84 to 127. Both precision and scale are in decimal digits小数位. A NUMBERvalue requires需要 from 1 to 22 bytes.

2

FLOAT [(p)]

subtype图表类型 of the NUMBER data type having precision p. A FLOAT value is represented internally代表内部 as NUMBER. The precision p can range from 1 to 126 binary digits二进制. A FLOATvalue requires需要from 1 to 22 bytes.

8

LONG

Character data of variable length up to 2 gigabytes, or 231 -1 bytes. Provided提供 for backwardcompatibility兼容性.

12

DATE

Valid有效 date range from January 1, 4712BC , to December 31, 9999 AD. The default format isdetermined explicitly确定明确 by theNLS_DATE_FORMAT parameter参数 or implicitly暗示by the NLS_TERRITORY parameter. The size is fixed固定 at 7 bytes. This data type contains包含 the datetime fields YEARMONTHDAYHOURMINUTE, andSECOND. It does not have fractional分数的 seconds or a time zone年代.

21

BINARY_FLOAT

32-bit floating point浮点 number. This data typerequires需要 4 bytes.

22

BINARY_DOUBLE

64-bit floating point number. This data type requires 8 bytes.

180

TIMESTAMP[(fractional_seconds_precision)]

Year, month, and day values of date, as well as以及 hour, minute, and second values of time, wherefractional_seconds_precision is the number ofdigits in the fractional part位数小数部分 of the SECOND datetime field领域. Accepted values offractional_seconds_precision are 0 to 9. The default is 6. The default format is determined explicitly明确确定 by the NLS_TIMESTAMP_FORMATparameter参数 or implicitly暗示by theNLS_TERRITORY parameter. The size is 7 or 11 bytes,depending on根据 the precision精度. This data type contains包含 the datetime fields领域 YEAR,MONTHDAYHOURMINUTE, and SECOND. It containsfractional分 seconds but does not have a time zone时区.

181

TIMESTAMP [(fractional_seconds)]WITH TIME ZONE

All values of TIMESTAMP as well as time zonedisplacement value位移值, wherefractional_seconds_precision is the number ofdigits in the fractional part位数小数部 of theSECOND datetime fields领域. Accepted values are 0 to 9. The default is 6. The default format isdetermined explicitly明确确定 by theNLS_TIMESTAMP_FORMAT parameter参数 or implicitly暗示by the NLS_TERRITORY parameter. The size isfixed固定 at 13 bytes. This data type contains the datetime fields YEARMONTHDAYHOURMINUTE,SECONDTIMEZONE_HOUR, and TIMEZONE_MINUTE. It has fractional seconds and an explicit明确 time zone.

231

TIMESTAMP [(fractional_seconds)]WITH LOCAL TIME ZONE

All values of TIMESTAMP WITH TIME ZONE, with thefollowing下面 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 the NLS_TIMESTAMP_FORMAT parameter参数 orimplicitly暗示by the NLS_TERRITORY parameter. The size is 7 or 11 bytes, depending on根据 theprecision精度.

182

INTERVAL间隔 YEAR[(year_precision)] TO MONTH

Stores a period of time一段时间 in years and months, where year_precision is the number ofdigits数字 in the YEAR datetime field领域. Accepted values are 0 to 9. The default is 2. The size is fixed固定 at 5 bytes.

183

INTERVAL DAY [(day_precision)] TOSECOND [(fractional_seconds)]

Stores a period of time in days, hours, minutes, and seconds, where

  • day_precision is the maximum number ofdigits数 in the DAY datetime field领域. Accepted values are 0 to 9. The default is 2.

  • fractional_seconds_precision is the number of digits in the fractional part位数小数部分of the SECOND field领域. Accepted values are 0 to 9. The default is 6.

The size is fixed固定at 11 bytes.

23

RAW(size)

Raw binary原二进制 data of length size bytes. Maximum size is 2000 bytes. You must specify指定size for a RAW value.

24

LONG RAW

Raw binary原二进制 data of variable length up to 2 gigabytes.

69

ROWID

Base 64 string representing代表 the unique address of a row in its table. This data type is primarily for values returned by the ROWID pseudocolumn伪列.

208

UROWID [(size)]

Base 64 string representing代表the logical address of a row of an index-organized table. The optional可选项 size is the size of a column of type UROWID. The maximum size and default is 4000 bytes.

96

CHAR [(size [BYTE | CHAR])]

Fixed-length character data of length size bytes or characters. Maximum size is 2000 bytes or characters. Default and minimum size is 1 byte.

BYTE and CHAR have the same semantics语义 as forVARCHAR2.

96

NCHAR[(size)]

Fixed-length character data of length sizecharacters. The number of bytes can be up to two times size for AL16UTF16 encoding and three timessize for UTF8 encoding. Maximum size isdetermined根据 by the national character setdefinition决定, with an upper limit of上限 2000 bytes. Default and minimum size is 1 character.

112

CLOB

A character large object containing single-byte ormultibyte多字符 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

NCLOB

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.最大为4G字节

113

BLOB

binary二进制 large大 object. Maximum size is (4 gigabytes - 1) * (database block size).

114

BFILE

Contains包含 a locator定位器 to a large binary file stored存储 outside除啦 the database.Enables实现 byte stream字节 I/O access使用 toexternal外部 LOBs residing on居住 the database server. Maximum size is 4 gigabytes.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值