The ERASE stored procedure is used to erase part or all of an internal LOB.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
DBMS_LOB.ERASE (
lob_loc IN OUT NOCOPY BLOB,
amount IN OUT NOCOPY INTEGER,
offset IN INTEGER := 1);
DBMS_LOB.ERASE (
lob_loc IN OUT NOCOPY CLOB CHARACTER SET ANY_CS,
amount IN OUT NOCOPY INTEGER,
offset IN INTEGER := 1);
Parameters
| Parameter | Description |
|---|---|
| lob_loc | The locator of the LOB to be deleted. For more information, see DBMS_LOB. |
| amount | The number of bytes (BLOB) or characters (CLOB) to be erased. |
| offset | The absolute offset (starting from 1) from the beginning of the LOB, in bytes (BLOB) or characters (CLOB). |
Considerations:
When erasing data from the middle of a
LOB, zero-byte fillers are written forBLOBand spaces are written forCLOB.If the end of the
LOBvalue is reached before the specified number of bytes or characters is erased, the actual number of bytes or characters erased may differ from the value specified in theamountparameter. The actual number of characters or bytes erased is returned in theamountparameter.Notice
When only part of the
LOBis erased, the length of theLOBdoes not change. To reduce the length of theLOBvalue, see TRIM.
Exceptions
| Exception | Description |
|---|---|
| VALUE_ERROR | All input parameters are NULL. |
| INVALID_ARGVAL | The following conditions are met:
|
| QUERY_WRITE | The LOB write cannot be performed in a query. |
| BUFFERING_ENABLED | If buffering is enabled on the LOB, the operation cannot be performed while LOB buffering is enabled. |
