OceanBase Database currently supports the following two large object (LOB) data types: character large object (CLOB) and binary large object (BLOB).
A LOB object consists of data and related information called a locator. The locator includes details such as table ID and row ID, determining which table and row the object corresponds to. Currently, the storage of LOBs is similar to VARCHAR types, where only the data part is stored, and the upper-layer interface generates the locator part during queries.
LOB objects can be assigned to any object of the same type. In most cases, users can work with LOB objects in applications without considering the semantics of the locator. While in some scenarios, the locator is necessary, and in others, redundant locator information may be included.
When reading and modifying LOB objects, the use of a locator is optional.
Not using the locator
In many operations, LOB objects are treated like the VARCHAR2 and RAW types. These operations use only the data of LOB objects while ignoring their locators. Such operations include the following ones:
SQL and procedural language (PL) built-in functions
API operations that allow you to query data in a
LOBcolumn or insert data into aLOBcolumn:Insert character data into a
CLOBcolumn by binding variables of aLOBcolumn or insertRAWdata into aBLOBcolumn. For example, you can insert aVARCHAR2buffer into aCLOBcolumn in PL.Define the output in your application as character data queried from a
CLOBcolumn orRAWdata queried from aBLOBcolumn. For example, you can store queriedCLOBdata to aVARCHAR2buffer in PL.
Using the locator
Use LOB API operations provided by OceanBase Database and enter LOB objects as parameters. Most of the API operations are contained in the DBMS_LOB package, including DBMS_LOB.READ, DBMS_LOB.WRITE, and DBMS_LOB.UPDATE.