IBM Books

SQL Getting Started


Large Objects (LOBs)

The term large object and its acronym LOB are used to refer to three data types: BLOB, CLOB, or DBCLOB. These types can contain large amounts of data, for objects such as audio, photos and documents.

A Binary Large OBject (BLOB) is a varying-length string, measured in bytes, that can be up to 2 gigabytes long. A BLOB is primarily intended to hold nontraditional data such as pictures, voice, and mixed media.

A Character Large OBject (CLOB) is a varying-length string, measured in bytes, that can be up to 2 gigabytes long. A CLOB is used to store large single-byte character set data such as documents. A CLOB is considered to be a character string.

A Double-Byte Character Large OBject (DBCLOB) is a varying-length string of double-byte characters that can be up to 2 gigabytes long (1 073 741 823 double-byte characters). A DBCLOB is used to store large double-byte character set data such as documents. A DBCLOB is considered to be a graphic string.

Manipulating Large Objects (LOBs)

Since LOB values can be very large, transferring them from the database server to client application program can be time consuming. However, typically LOB values are processed one piece at a time, rather than as a whole. For those cases where an application does not need (or want) the entire LOB value to be stored in application memory, it can reference this value via a large object locator variable.

Subsequent statements can then use the locators to perform operations on the data without necessarily retrieving the entire large object. Locator variables are used to reduce the storage requirements for the applications, and improve the performance by reducing the flow of data between the client and the server.

Another mechanism is file reference variables. They are used to retrieve a large object directly to a file or to update a large object in a table directly from a file. File reference variables are used to reduce the storage requirements for the applications since they do not need to store the large object data. For more information refer to the Application Development Guide and the SQL Reference.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]