The ERASE stored procedure erases all or part of an internal LOB.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL mode.
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 erased. For more information, see Considerations. |
| amount | The amount of data to be erased. The value is in bytes for BLOBs and in characters for CLOBs. |
| offset | The absolute offset from the beginning of the LOB, with 1 as the origin. The value is in bytes for BLOBs and in characters for CLOBs. |
Take note of the following considerations:
When data in the middle of the
LOBis erased, theBLOBis filled with zero bytes and theCLOBis filled with spaces.If the end of the
LOBvalue is reached before the specified amount of data is erased, the number of bytes or characters actually erased can be different from that specified by theamountparameter. The number of characters or bytes actually erased will be returned in theamountparameter.Notice
If only part of the
LOBis erased, the length of theLOBwill not be smaller. For information about how to shorten theLOB, see TRIM.
Exceptions
| Exception | Description |
|---|---|
| VALUE_ERROR | Any input parameters are NULL. |
| INVALID_ARGVAL | Several possibilities:
|
| QUERY_WRITE | LOB write is not allowed in the query. |
| BUFFERING_ENABLED | The operation cannot be performed because LOB buffering is enabled. |