Thứ Ba, 3 Tháng Mười, 2023
Trang chủCơ sở dữ liệuOracleKiểu dữ liệu (Data types) trong Oracle

Kiểu dữ liệu (Data types) trong Oracle

Đây là bài 2 của 2 trong series Oracle căn bản

Để tối ưu trong việc lưu trữ thì Oracle phân chia dữ liệu thành nhiều loại khác nhau, mỗi loại sẽ có đồ dài nhất định và phù hợp với từng trường hợp. Chúng ta có các nhóm chính như: Character, Numeric, Date/Time, Large Object (LOB).

1. Character Datatypes

Character Datatypes hay còn gọi là kiểu dữ liệu kí tự, nó là kiểu chuỗi và mỗi kiểu sẽ có độ dài khác nhau.

Data Type Syntax Oracle 9i Oracle 10g Oracle 11g
char(size) 2000 bytes. 2000 bytes. 2000 bytes.
nchar(size) 2000 bytes. 2000 bytes. 2000 bytes.
nvarchar2(size) 4000 bytes. 4000 bytes. 4000 bytes.
varchar2(size)

4000 bytes.

32KB in PLSQL.

4000 bytes.

32KB in PLSQL.

4000 bytes.

32KB in PLSQL.

long 2GB. 2GB. 2GB.
raw 2000 bytes. 2000 bytes. 2000 bytes.
long raw 2GB. 2GB. 2GB.

2. Numeric Datatypes

Data Type Syntax
number(p,s)
numeric(p,s)
float
dec(p,s)
decimal(p,s)
integer
int
smallint
real
double precision

3. Date/Time Datatypes

Data Type Syntax
date
timestamp (fractional seconds precision)
timestamp (fractional seconds precision) with time zone
timestamp (fractional seconds precision) with local time zone
interval year (year precision) to month
interval day (day precision) to second (fractional seconds precision)

4. Large Object (LOB) Datatypes

Data Type Syntax
bfile
blob
clob
nclob
Series Navigation<< Oracle là gì? Các phiên bản của Oracle
Bài viết liên quan
- Advertisment -

Phổ biến nhất