我最近从WE8MSWIN1252
charset导出了一个数据库到AL32UTF8
我有一个功能将BLOB
转换为CLOB
FUNCTION BlobToClob( stream IN BLOB ) RETURN CLOB IS
{
.
.
DBMS_LOB.WriteAppend(cResult,DBMS_LOB.GETLENGTH(stream)-nPosition+1,UTL_RAW.cast_to_varchar2(DBMS_LOB.SUBSTR(stream,DBMS_LOB.GETLENGTH(stream)-nPosition+1,nPosition)));
.
.
}
我在AL32UTF8数据库中运行此函数时出现以下错误。
ORA-06512输入缓冲区的长度小于请求的数量
你有什么主意吗 ?
谢谢,
Bilel
使用标准函数DBMS_LOB.CONVERTTOCLOB
。您需要提供源编码,例如:
DECLARE
l_dest_lob CLOB;
l_src_blob BLOB;
l_dest_offset INTEGER := 1;
l_src_offset INTEGER := 1;
l_lang_context INTEGER;
l_warning INTEGER;
BEGIN
dbms_lob.converttoclob(dest_lob => l_dest_lob,
src_blob => l_src_blob,
amount => dbms_lob.blobmaxsize,
dest_offset => l_dest_offset,
src_offset => l_src_offset,
blob_csid => nls_charset_id('WE8MSWIN1252'),
lang_context => l_lang_context,
warning => l_warning);
END;