Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dbms_lob.getlength() vs. length() to find blob size in oracle

Tags:

sql

oracle

blob

People also ask

How do I know the size of my BLOB?

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.

What is the default size of BLOB in Oracle?

Default. A BLOB without a specified length is defaulted to two gigabytes (2,147,483,647).

What is the length of CLOB in Oracle?

A CLOB (character large object) value can be up to 2,147,483,647 characters long.

How do you find the size of a CLOB in a byte?

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.