The OPEN stored procedure opens 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 provides only the MySQL 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 locator of the LOB. For more information, see Considerations. |
| open_mode | The mode to open the LOB in. 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 try to write to the LOB, an error will be returned.
OPENrequires a round trip to the server for both internal and externalLOBs. For internalLOBs,OPENtriggers other code that relies on theOPENcall.You can choose not to wrap all
LOBoperations inside the Open/Close API. If you open aLOB, you must close it before you commit the transaction. An error is produced if you do not. When an internalLOBis closed, the functional and domain indexes on theLOBcolumn are updated.If you commit a transaction before you close all the
LOBsopened by the transaction, an error will be returned. When an error occurs, the openness of the openLOBsis discarded, but the transaction is committed. That is, all the changes made to theLOBand non-LOBdata in the transaction are committed, but the domain-based and function-based indexes are not updated. If this happens, you must rebuild the functional and domain indexes on theLOBcolumn.