标签:ica start report 数据库 ast raw xxxx to_char from
1 create or replace Function BlobToVarchar (Blob_In In Blob) Return clob 2 Is 3 V_Varchar Varchar2(32767); 4 V_Varchar1 Varchar2(32767); 5 V_Start Pls_Integer := 1; 6 V_Buffer Pls_Integer := 4000; 7 Begin 8 9 If Dbms_Lob.Getlength(Blob_In) Is Null Then 10 Return ‘‘; 11 End If; 12 V_Varchar1 := ‘‘; 13 --return to_char(Ceil(Dbms_Lob.Getlength(Blob_In) / V_Buffer)); 14 For I In 1..Ceil(Dbms_Lob.Getlength(Blob_In) / V_Buffer) Loop 15 --当转换出来的字符串乱码时,可尝试用注释掉的函数 16 --V_Varchar := Utl_Raw.Cast_To_Varchar2(Utl_Raw.Convert(Dbms_Lob.Substr(Blob_In, V_Buffer, V_Start),‘SIMPLIFIED CHINESE_CHINA.ZHS16GBK‘, ‘AMERICAN_THE NETHERLANDS.UTF8‘)); 17 V_Varchar := Utl_Raw.Cast_To_Varchar2(Dbms_Lob.Substr(Blob_In, V_Buffer, V_Start)); 18 V_Varchar1 := V_Varchar1 || V_Varchar; 19 20 V_Start := V_Start + V_Buffer; 21 End Loop; 22 23 Return V_Varchar1; 24 25 End Blob_To_Varchar;
1.首先执行上面的函数,返回的是个clob
update DR_RPT_REPORT_DATASOURCE set data_sql = c2b(to_clob((select replace(Blob_To_Varchar(data_sql),‘XXX‘,‘XXX‘) from DR_RPT_REPORT_DATASOURCE where data_id =‘XXXX‘ ))) where data_id = ‘‘ ;
ORA-22835 缓冲区对于 CLOB 到 CHAR 转换或 BLOB 到 RAW 转换而言太小
标签:ica start report 数据库 ast raw xxxx to_char from
原文地址:http://www.cnblogs.com/hjava/p/6836103.html