Oracle's data type length collection

Source: Internet
Author: User

--Oracle's data type
The common database field types are as follows:
Field type chinese description restriction conditions Other description
CHAR fixed length string max length bytes
VARCHAR2 length of string maximum length 4000 bytes can be indexed up to 749
NCHAR the maximum length of a fixed-length string based on the character set bytes
NVARCHAR2 the maximum length of a variable-length string based on a character set 4000 bytes
Date Date (day-month-year) Dd-mm-yy (HH-MI-SS) has been rigorously tested with no bug problem
Long long string maximum length 2G (231-1) enough to store a large book
RAW fixed-length binary data maximum length of bytes can store multimedia image sound, etc.
Long RAW variable length binary data maximum length 2G ibid.
BLOB binary Data Maximum length 4G
CLOB character data Maximum length 4G
NCLOB character data maximum length 4G according to the character set
BFILE the maximum length of binary data stored outside the database 4G
ROWID Unique line number recorded in the datasheet bytes ********.****.**** format, * 0 or 1
Nrowid the maximum length of a unique row number recorded in a Binary data table 4000 bytes
Number (p,s) numeric type P is an integer digit, S is a decimal digit
Decimal (p,s) Number type P is an integer digit, S is a decimal digit
Integer of integer type Small
Float floating-point number type number (38), double-precision
Real real number Type number (63), higher precision

Data type parameter description
char (n) n=1 to 2000 byte fixed length string, n bytes long, if not specified length, default is 1 bytes long (one kanji is 2 bytes)

VARCHAR2 (n) n=1 to 4000 bytes variable length string, specifying the maximum length of n, which can be placed in numbers, letters, and ASCII character set (or the standard of character sets accepted by database systems such as EBCDIC).
If the data length does not reach the maximum n,oracle 8i automatically adjusts the field length based on the data size, and if there are spaces before and after your data, Oracle 8i automatically deletes it. VARCHAR2 is the most commonly used data type. The maximum length of the index can be 3209.
Number (M,n) M=1 to 38
n=-84 to 127 variable-length numeric columns that allow 0, positive and negative values, M is the number of digits of all valid digits, and n is the number of digits after the decimal point.
For example: Number (5,2), the maximum value for this field is 99,999, and if the value exceeds the number of digits, the extra digits are truncated.
such as number (5,2), but enter 575.316 in this field in a row of data, the value that is actually saved to the field is 575.32.
For example: Number (3,0), enter 575.316, the actual data saved is 575.
Date is not valid for all legal dates from January 1, 4712 to December 31, 4712 A.D., Oracle 8i actually stores date data internally by 7 bytes, including hours, minutes, and seconds in the definition.
The default format is Dd-mon-yy, such as July-November-00 for November 7, 2000.
Long has no variable long character column, the maximum length limit is 2GB, for a long string of data that does not need to be searched for strings, if the character search is to use the VARCHAR2 type. Long is an older type of data that will gradually be replaced by large object data types such as BLOBs, CLOB, NCLOB, and so on.
Raw (N) n=1 to 2000 variable-length binary data, which must be specified when specifying the field maximum length n,oracle 8i Use this format to save smaller graphic files or formatted text files, such as Miceosoft Word documents.
Raw is an older type of data that will gradually be replaced by large object data types such as BLOBs, CLOB, NCLOB, and so on.
Long raw has no variable long binary data, and the maximum length is 2GB. Oracle 8i uses this format to save large graphic files or formatted text files, such as Miceosoft Word documents, as well as non-text files such as audio and video.
You cannot have both long and long raw types in the same table, and long Raw is an older data type that will gradually be replaced by large object data types such as BLOBs, CLOB, NCLOB, and so on.
Blob/clob/nclob has no three large objects (lobs) to hold large graphics files or formatted text files, such as Miceosoft Word documents, as well as non-text files such as audio and video, with a maximum length of 4GB.
There are several types of lobs, depending on the type of bytes you use, Oracle 8i actually stores the data inside the database.
You can perform special operations such as read, store, write, and so on.
bfile no large binary object files saved outside the database, the maximum length is 4GB.
This external LOB type, which records changes through the database, but the data is kept in a specific place outside the database.
Oracle 8i can read, query bfile, but cannot write.
The size is determined by the operating system.

Oracle's data type length collection

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.