Tuesday 25 September 2007

Lob package and error

User getting following error on the new 10g

ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual:
6254, maximum: 4000)


This works on 9i but givs error on 10g
select
TO_CHAR(detail_info_clob)
from nidb_tab where DBMS_LOB.GETLENGTH(detail_info_clob) = 6254 and rownum <>


Fix: Above works on 9i but result is cut off afte 4K data, for all 4K+ clob shuld be using DBMS_LOB pkg.

select
DBMS_LOB.GETLENGTH(detail_info_clob)
from nidb_ta;

select
DBMS_LOB.SUBSTR(detail_info_clob, 3998, 1)
from nidb_tab where DBMS_LOB.GETLENGTH(detail_info_clob) = 6254 and rownum <>

select
DBMS_LOB.SUBSTR(detail_info_clob, 3998, 3995)
from nidb_tab where DBMS_LOB.GETLENGTH(detail_info_clob) = 6254 and rownum <>

No comments: