Oracle Basic data Type "on"

Source: Internet
Author: User

1. Character data type (Char,varchar2,long)

CHAR: To store an alphanumeric value, the column length of this data type can be between 1 and 2000 bytes. If not specified, it consumes one byte by default, if the user enters a

value is small at the specified length, the database is padded with spaces to a fixed length .

VARCHAR2: In fact, it is varchar, but there is a number behind a 2,varchar2 is a synonym of varchar, also known as aliases. Data type size

at 1 to 4,000 bytes, but a little different from Char Yes, when you define a VARCHAR2 length of 30, but you only enter 10 characters,

At this point, the VARCHAR2 is not populated like char, only 10 bytes in the database.

LONG: This data type is used to store variable-length character data and can store up to 2GB. But there are some limitations: only one column in a table can be a long type, long

A column cannot be defined as a primary key or a unique constraint and cannot establish a cable A parameter of the Long data type cannot be accepted by a lead, procedure, or stored procedure:

2. Numeric data type (only number type)

Number:number function is not small, it can store positive numbers, negative numbers, 0, fixed-point numbers and 30-bit precision floating-point number. The format is (p=38,s=0), where P is

Precision, which represents the total number of digits, which is between 1-38, S is a range that represents the number of digits to the right of the decimal point, which is between 84 and 127.
3. Date-time data type (with date data type, timestamp data type)
Date: Used to store dates and time data in tables, Oracle stores dates in its own format, uses 7-byte fixed lengths, each byte is stored for centuries,

day, hour, minute and second, date data type value from A.D. before January 1, 4712 to December 31, 9999. The Sysdate function in Oracle

to return the current date and time:

The timestamp data type differs from date: It also returns the current time zone.
4.RAW and long RAW data types (this data type is primarily used to store binary data)
RAW: Used to store byte-based data, can store up to 2000 bytes, it does not have a default size, so when used to specify the size, you can establish the index:
long RAW: Used to store variable-length binary data, which can store up to 2GB, and it is subject to the same restrictions as the long type.
5.LOB Data Types
lobs are also known as "large object" data types: mainly Clob,blob,bfile, three seed types.

the CLOB representative (CHARACTER LOB), which stores a large number of character data, can store unstructured XML documents.

The blog represents (binary LOB), which can store large binary objects, shape, audio and video clips.

The BFILE representative (binary file), which is capable of storing binaries in operating system files outside the database, note that it is a binary file, not a generic data,

                                                    bfile column stores a bfile locator that points to the service

4 GB. However, the ORACLE10 above will be larger , which also requires hardware support.

Oracle Basic data Type "on"

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.