Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between CLOB and NCLOB?

Tags:

sql

oracle

lob

Can you state any difference between the CLOB and NCLOB?

like image 525
Loga Avatar asked Jul 28 '11 05:07

Loga


People also ask

What is an Nclob?

NCLOB (National Character Large Object) is an Oracle data type that can hold up to 4 GB of character data. It's similar to a CLOB, but characters are stored in a NLS or multibyte national character set.

What is LOB and Nclob?

CLOB: A LOB whose value is composed of character data that corresponds to the database character set defined for the Oracle database. NCLOB: A LOB whose value is composed of character data that corresponds to the national character set defined for the Oracle database.

What is the difference between VARCHAR2 and CLOB?

The difference between the 2 types is that in VARCHAR2 you have to specify the length of the stored string and that length is limited to 4000 characters while CLOB can store up to 128 terabytes of character data in the database.


2 Answers

A CLOB stores character data encoded in the database character set. A NCLOB stores character data encoded in the national character set

SELECT parameter, value   FROM v$nls_parameters  WHERE parameter LIKE '%CHARACTERSET' 

will show you the database and national character sets of your database.

like image 113
Justin Cave Avatar answered Sep 21 '22 01:09

Justin Cave


BLOB, CLOB, NCLOB and BFILE The built-in LOB data types BLOB, CLOB and NCLOB (stored internally), and BFILE (stored externally), can store large and unstructured data such as text, images and spatial data up to 4 gigabytes in size.

BLOB

The BLOB data type stores binary large objects. BLOB can store up to 4 gigabytes of binary data.

CLOB

The CBLOB data type stores character large objects. CLOB can store up to 4 gigabytes of character data.

NCLOB

The NCBLOB data type stores character large objects in multibyte national character set. NCLOB can store up to 4 gigabytes of character data.

BFILE

The BFILE data type enables access to binary file LOBs that are stored in file systems outside the Oracle database. A BFILE column stores a locator, which serves as a pointer to a binary file on the server's file system. The maximum file size supported is 4 gigabytes.

like image 32
rajesh Avatar answered Sep 18 '22 01:09

rajesh