Large objects

 

A large object (LOB) is a string data type with a size ranging from 0 bytes to 2 GB (GB equals 1 073 741 824 bytes).

The VARCHAR, VARGRAPHIC, and VARBINARY data types have a limit of 32 KB (where KB equals 1024 bytes) of storage. While this might be sufficient for small to medium-sized text data, applications often need to store large text documents. They might also need to store a wide variety of additional data types, such as audio, video, drawings, mixed text and graphics, and images. Some data types can store these data objects as strings of up to 2 GB.

These data types are binary large objects (BLOBs), single-byte character large objects (CLOBs), and double-byte character large objects (DBCLOBs). Each table can have a large amount of associated LOB data. Although a single row that contains one or more LOB values cannot exceed 3.5 GB, a table can contain nearly 256 GB of LOB data.

You can refer to and manipulate LOBs using host variables as you do any other data type. However, host variables use the program's storage that might not be large enough to hold LOB values, so you might need to manipulate large values in other ways. Locators are useful for identifying and manipulating a large object value at the database server and for extracting pieces of the LOB value. File reference variables are useful for physically moving a large object value (or a large part of it) to and from the client.

 

Parent topic:

Processing special data types