All Products
Document Center

CLOB data type

Last Updated: Jun 18, 2021

CLOB is short for character large object. The CLOB data type stores single-byte and multi-byte character data. Fixed-width and variable-width character sets are supported. Single-byte and multi-byte character data use the database character set. CLOB does not support character sets that have different widths. The maximum length (characters) of bytes that can be stored is 48 MB and the character set is UTF8MB4.

CLOB objects provide full transactional support. Changes that are made by using DBMS_ LOB packages and SQL are fully involved in transactions. You can commit and roll back CLOB value operations. However, you cannot save a CLOB locator to PostgreSQL or SQL Server in one transaction and then use the locator in another transaction or session.

A field of the VARCHAR2 data type can be a maximum of 32,767 characters in length. If you need to store a field that is more than 32,767 characters in length, you can use the CLOB data type. In addition, you can use the CLOB data type to store CHAR data. For example, XML documents use CLOB data to store content.

In the following example, the table named temp is created and the data type of the temp_clob column is set to CLOB:

CREATE TABLE temp (temp_clob CLOB);