The OPEN procedure is used to open an internal or external LOB in the specified mode. Valid modes include read-only and read/write.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition only provides MySQL-compatible mode.
Syntax
DBMS_LOB.OPEN (
lob_loc IN OUT NOCOPY BLOB,
open_mode IN BINARY_INTEGER);
DBMS_LOB.OPEN (
lob_loc IN OUT NOCOPY CLOB CHARACTER SET ANY_CS,
open_mode IN BINARY_INTEGER);
Parameters
| Parameter | Description |
|---|---|
| lob_loc | The LOB locator. For more information, see Use DBMS_LOB. |
| open_mode | The mode for opening the LOB. For BLOB and CLOB types, the mode can be: LOB_READONLY or LOB_READWRITE. |
Considerations
Note
If you open a LOB in read-only mode and attempt to write to it, an error will be returned.
The
OPENprocedure requires communication between the internal and externalLOBservers. For internalLOBtypes, theOPENprocedure triggers other code that depends on theOPENcall.It is not mandatory to wrap all
LOBoperations within an Open/Close interface. If you open aLOB, you must close it before committing the transaction, otherwise an error will occur. When closing an internalLOB, the function index and domain index on theLOBcolumn will be updated.Committing a transaction before closing all
LOBobjects opened by the transaction will result in an error. When an error occurs, the open state of theLOBwill be discarded, but the transaction will still be successfully committed, including all changes made toLOBand non-LOBdata within the transaction. However, domain-based and function-based indexes will not be updated. In such cases, you should rebuild the function index and domain index on theLOBcolumn.