CREATE OR REPLACE FUNCTION blob_to_clob2 (blob_in IN BLOB) RETURN CLOB AS v_clob CLOB; v_varchar VARCHAR2(32767); v_start PLS_INTEGER := 1; v_buffer PLS_INTEGER := 32767; BEGIN DBMS_LOB.CREATETEMPORARY(v_clob, TRUE); if DBMS_LOB.GETLENGTH(blob_in) is null then return empty_clob(); end if; FOR i IN 1..CEIL(DBMS_LOB.GETLENGTH(blob_in) / v_buffer) LOOP
create or replace FUNCTION blob_to_clob (blob_in IN BLOB) RETURN CLOB IS v_clob CLOB; v_varchar VARCHAR2(4000); v_start PLS_INTEGER := 1; v_buffer PLS_INTEGER := 4000; g_nls_db_char varchar2(60); BEGIN select userenv('LANGUAGE') into g_nls_db_char from dual;
if DBMS_LOB.GETLENGTH(blob_in) is null then return empty_clob(); end if;