The GETLENGTH function is used to obtain the length of a specified LOB. The returned length is in bytes or characters.
The length count includes 0 bytes or spaces generated by previous operations such as WRITE. The length of an empty internal LOB is 0.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
DBMS_LOB.GETLENGTH (
lob_loc IN BLOB
)
RETURN NUMBER;
DBMS_LOB.GETLENGTH (
lob_loc IN CLOB CHARACTER SET ANY_CS
)
RETURN NUMBER;
Parameters
| Parameter | Description |
|---|---|
| lob_loc | The locator of the LOB. For more information, see Use DBMS_LOB. |
Return value
The length of the LOB in bytes or characters, returned as an INTEGER. If the input LOB is NULL or the input lob_loc is NULL, NULL is returned.
Exceptions
| Exception | Description |
|---|---|
| BUFFERING_ENABLED | If buffering is enabled on the LOB, you cannot perform operations while buffering is enabled. |
