There is a simple MySQL String function, to find the size of BLOB data, OCTET_LENGTH. This function returns the length of BLOB in bytes. You can also use LENGTH function, because OCTET_LENGTH is synonym for LENGTH.
Default. A BLOB without a specified length is defaulted to two gigabytes (2,147,483,647).
A CLOB (character large object) value can be up to 2,147,483,647 characters long.
LENGTHB returns the length in Bytes used by the string. You could say LENGTHB(TO_CHAR(DBMS_LOB. SUBSTR(<CLOB-Column>,3000,1)))+NVL(LENGTHB(TO_CHAR(DBMS_LOB.
length
and dbms_lob.getlength
return the number of characters when applied to a CLOB (Character LOB). When applied to a BLOB (Binary LOB), dbms_lob.getlength
will return the number of bytes, which may differ from the number of characters in a multi-byte character set.
As the documentation doesn't specify what happens when you apply length
on a BLOB, I would advise against using it in that case. If you want the number of bytes in a BLOB, use dbms_lob.getlength
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With