Oracle field type

Source: Internet
Author: User

Oracle field type

Http://www.cnblogs.com/lihan/archive/2010/01/06/1640547.html

Field type Describe Field length and its default value

CHAR (size)

String data used to hold the fixed length (size) byte.

The length of each line is fixed (the insufficient part is blank), the maximum is 2000 bytes per line, and the default value is 1 bytes per line. Consider the character set to be single-byte or multibyte before setting the length (size).

VARCHAR2 (size )

Used to save variable-length string data. Where the maximum byte length is specified by (size).

Each line is variable in length, with a maximum length of 4000 bytes per line. Consider the character set to be single-byte or multibyte before setting the length (size).

NCHAR (size)

The character or byte of a fixed length (size) is determined by the character set.

The length of each line is fixed (the insufficient part is blank). For a fixed-width character set, length (size) refers to the number of characters, and the length (size) is the number of bytes in the width of the character set. The maximum length (size) depends on the length of the bytes held in one character, and the maximum length of each line is 2000 bytes. The default value is 1 characters or 1 bytes, as determined by the character set.

NVARCHAR2 (size )

The character or byte of the variable length is determined by the character set. The maximum length is specified by (size).

Each line becomes longer. For a fixed-width character set, length (size) refers to the number of characters, and the length (size) is the number of bytes in the width of the character set. The maximum length (size) depends on the length of the bytes held in one character, and the maximum length of each line is 4000 bytes. The default value is 1 characters or 1 bytes, as determined by the character set.

LONG

Saves variable-length string data.

The length of each row in the table is variable, with a maximum length of 231-1 bytes per row or 2G.

Number (p, s )

Save the variable length number. Where the maximum value of precision is p, and/or the maximum value of a valid number of digits S is 38.

Each line becomes longer. The maximum length for each row is 21 bytes.

DATE

Save a fixed-length date or time data, in the range of 4712/01/01 BC to A.D. 9999/12/31.

Each row is fixed to a length of 7 bytes, and the default value of the date description (for example, Dd-mon-yy) is set by the Nls_date_format parameter.

RAW (size )

Saves the variable-length binary data. The maximum length is specified by size.

The length of each row in the table is variable, with a maximum length of 2000 bytes per line.

LONG RAW

Saves the variable-length binary data.

The length of each row in the table is variable, with a maximum length of 231-1 bytes per row or 2G.

Blob

Save the binary data.

The maximum length is 232-1 bytes or 4G.

Clob

Saves single-byte character data.

The maximum length is 232-1 bytes or 4G.

NCLOB

Saves the single-byte or fixed-width multibyte or wide multibyte character data specified by the character set.

The maximum length is 232-1 bytes or 4G.

BFILE

Binary data saved in an external file.

The maximum length is 232-1 bytes or 4G.

Char is used to describe fixed-length character data, length <=2000 bytes
VARCHAR2 for describing variable-length character data, <=4000 bytes
NCHAR the fixed-length character data used to store the Unicode character set, length <=1000 bytes
NVARCHAR2 variable-length character data used to store Unicode character sets, length <=1000 bytes
Number is used to store integer or floating-point values
Date used to store data for dates
Long is used to store variable-length character data up to 2GB long
Raw used to store the variable-length character data for unstructured data, length <=2000 bytes
Long Raw is used to store the variable-length character data for unstructured data, length <=2GB
ROWID binary data used to store the physical address of a column in a table, taking up a fixed 10 bytes
BLOBs are used to store up to 4GB of unstructured binary data
Clob used to store up to 4GB of character data
Nclob used to store up to 4GB of Unicode character data
Bfile is used to store unstructured binary data in operating system files other than the database
Urowid used to store binary data representing any type of column address
Float is used to store floating-point numbers



Field type Chinese description Restriction conditions Other instructions
CHAR Fixed-length strings Maximum Length 2000 bytes
VARCHAR2 Variable-length strings Maximum Length 4000 Bytes, maximum length of index can be done 749
NCHAR Fixed-length strings based on character set Maximum Length 2000 bytes
NVARCHAR2 Variable-length strings based on character set Maximum Length 4000 bytes
DATE Date (day-month-year) Dd-mm-yy (HH-MI-SS) After rigorous testing, no problem of thousand worms
LONG Super Long string Maximum length 2G (231-1) Enough to store big data
RAW Fixed-length binary data Maximum Length 2000 Bytes can store multimedia image sound, etc.
LONG RAW Variable-length binary data Maximum length 2G Ditto
Blob Binary data Maximum length 4G Greater capacity, ibid.
Clob Character data Maximum length 4G
NCLOB Character data based on the character set Maximum length 4G
BFILE Binary data stored outside the database Maximum length 4G
ROWID Unique line number recorded in the datasheet Ten bytes . ****.**** format, * is 0 or 1
Nrowid Unique line number recorded in a Binary data table Maximum Length 4000 bytes
Number (P,s) Number Type P is the integer digit, S is the decimal digit
DECIMAL (P,s) Number Type P is the integer digit, S is the decimal digit
INTEGER Integer type A small integer
FLOAT Floating-point type Number (38), double precision
REAL Real type Number (63), higher accuracy

===================================================================

Character Char range Max 2000 byte fixed length
char (10) ' Zhang San ' after adding space 6 to fill 10 bytes of ' Zhang San '
Sex char (2) ' Male '

Varchar2 range maximum 4,000 bytes longer
VARCHAR2 (10) ' Zhang San ' in the database ' Zhang San '

Large object character type large object >4000 byte Max 4G
CLOB (Character Large OBject)

Number range 10-38 square to 10 38-time
You can represent decimals or integers
Number (4) maximum represents 4-bit integer-9999 to 9999
Number (5,2) represents a fraction of 2 decimal places for 5 significant digits-999.99 to 999.99

Date dates include month and day and time Division 7 bytes
Picture blob binary Large object image/sound 4G

Oracle field type

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.