本文介绍了dbms_lob.getlength()vs.length()在oracle中查找blob大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从

select length(column_name) from table

select dbms_lob.getlength(column_name) from table

但是,答案似乎更喜欢使用dbms_lob.getlength().

However, the answers tothis 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 dbms_lob.getlength 返回应用于 CLOB (字符LOB)的字符数.应用于 BLOB (二进制LOB)时,dbms_lob.getlength将返回字节数,该字节数可能与多字节字符集中的字符数不同.

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大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 10:04