Chapter 2 Oracle Datatype
Chapter 2 Oracle Datatype
ORACLE DATATYPES
Amoud University
Faculty of Computing and ICT
Junior classes – BSc IT
Data Types
Char
Varchar2
Date
Number , integer
Long
Raw
Long Raw
LOB
CLOB
BLOB
BFILE
Datatypes
• What is DATA TYPE ?
Vii. LOB/BLOB/CLOB:
-------------------
-> These datatypes also accepts images, audio files and video files.
-> Max. Limit is 4GB.
ex: Photo
long
• 5. LONG is an Oracle data type for storing character data of variable length up to 2 Gigabytes in
length (bigger version of the VARCHAR2 datatype). Note that a table can only have
one LONG column.
• LONG: Similar to varchar2 data type. Maximum size 2 GB.
• Example
• create table dv1(data long);
• insert into dv1 values(12345);
CLOB
• 8.CLOB:(character large object) used to store characters. Maximum size 4 GB.
• CLOB Character Large Object To store large continuous text Max 4GB
• A character large object containing single-byte characters. Both fixed-width and variable-width
character sets are supported, both using the CHAR database character set. Maximum size is
4 gigabytes.
example
create table dv(data clob);
insert into dv values('mako cumar hanfi')
BLOB(binary large object)
• 9. Binary Large Object (BLOB) Definition - What does Binary Large Object (BLOB) mean?
A binary large object (BLOB) is a data type that can store binary objects or data.
• The BLOB(Binary Large Object) datatype stores unstructured binary data in the database. BLOBs
can store up to 128 terabytes of binary data.
• BLOB:(binary large object) used to store binary data. Maximum size 4 GB.
• BLOB To store audio / video files Max 4 GB
example
• create table dv3(data blob);
• insert into dv3 values('123abc');
Raw datatype
• 6. RAW: used to store Images, logos, digital signatures etc.
• Raw To store images (photographs). Max 2000 Bytes
• example
create table dv2(data raw(100));
insert into dv2 values('123abc');
LONG RAW
• 7.LONG RAW: Similar to RAW data type. Maximum size 2 GB.
• Long Raw -> These datatypes supports To store images of larger size Images, audio files and
video files. Max 2GB
• -> Max. limit for RAW(2000 Bytes), LONG RAW(2GB)
• EX: Photo Long RAw;
BFILE (binary file)
• 10. BFILE:(binary file) Contains a locator to a large binary file stored outside the database.
• Enables byte stream I/O acc4 gigabytes.
• ess to external LOBs residing on the database server.
Maximum size is