Character Large Object

from Wikipedia, the free encyclopedia

Character Large Object ( CLOB ) is a data type that is used to store very long strings in databases .

This data type is called CLOB in Oracle and DB2 , while other database systems use different names. In MySQL and PostgreSQL there is a corresponding type called TEXT. The database systems also differ in the type of data storage. While some systems only store a reference to the CLOB in the table, others store smaller CLOBs directly in the table and only use the reference mechanism from a certain size.

A CLOB has a specific character coding and can be sorted lexically. This differs from the binary large object (BLOB), which can only be sorted numerically according to the byte values. Like BLOBs, CLOBs have very high size restrictions, on the order of several GiB . Not all character string functions are also offered for CLOBs in all database systems. CLOBs can also be used in indexes , but only the first substring of a fixed length is used, otherwise the index would require as much storage space as the CLOB itself.

CLOBs are well suited for storing XML data in a database. Some database manufacturers now offer special data types for XML data that provide optimized access methods. For fast access to the XML components, special indices have been developed that support and accelerate access with XPath and XQuery .

In international projects it is often necessary to save Unicode data. Many database manufacturers offer special LOB data types in which several bytes can be used to store the individual characters. These are known as NCLOB (National Character Large Object) in Oracle and DBCLOB (Double Byte Character Large Object) in DB2. In this way, data can be saved in all common languages.

Individual evidence

  1. Large objects (LOBs). In: DB2 Version 9.1 for z / OS. February 2008, accessed January 21, 2014 .
  2. Oracle Built-in Datatypes. In: Oracle® Database SQL Language Reference 11g Release 2 (11.2). Retrieved February 5, 2014 .
  3. The column types BLOB and TEXT. (No longer available online.) In: MySQL 5.1 Reference Manual. Archived from the original on July 18, 2008 ; Retrieved July 19, 2008 . Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / dev.mysql.com