dbms_lob.getlength()vs.length()在oracle中查找blob大小 [英] dbms_lob.getlength() vs. length() to find blob size in oracle
问题描述
我从
select length(column_name) from table
为
select dbms_lob.getlength(column_name) from table
However, the answers to
this question seem to favor using dbms_lob.getlength()
.
使用dbms_lob.getlength()
有什么好处吗?
如果它改变了答案,我知道所有blob都是.bmp图像(以前从未使用过blob).
If it changes the answer, I know all of the blobs are .bmp images (never worked with blobs before).
推荐答案
length
和
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.
由于文档中没有指定在BLOB上应用length
时会发生什么,因此我建议不要在这种情况下使用它.如果需要BLOB中的字节数,请使用dbms_lob.getlength
.
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
.
这篇关于dbms_lob.getlength()vs.length()在oracle中查找blob大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!