OceanBase Database supports character large object (CLOB) and binary large object (BLOB) data types.
A large object (LOB) consists of data and a locator. The locator contains a table ID and a row ID so that you can locate the row in the table on which the data corresponding to the LOB object is stored. Similar to the VARCHAR type, only the data part of a LOB object is stored, and the locator part is generated by the upper-layer interface during queries.
LOB objects can be assigned to any objects of the same type. Generally, you can use LOB objects in your applications regardless of the locator semantics. In some scenarios, the locator is required. In other scenarios, redundant locator information is allowed.
You can read and modify a LOB object by using or without using its locator.
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:
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.