Liquibase script to change BLOB data to CLOB in oracle -
i need change 1 blob column type clob store data in json form. need migrate existing data new format. there way in liquibase convert stored blobs clob. links/ reference helpful
it u
create or replace function blob_to_clob (blob_in in blob) return clob v_clob clob; v_varchar varchar2(32767); v_start pls_integer := 1; v_buffer pls_integer := 32767; begin dbms_lob.createtemporary(v_clob, true); in 1..ceil(dbms_lob.getlength(blob_in) / v_buffer) loop v_varchar := utl_raw.cast_to_varchar2(dbms_lob.substr(blob_in, v_buffer, v_start)); dbms_lob.writeappend(v_clob, length(v_varchar), v_varchar); v_start := v_start + v_buffer; end loop; return v_clob; end blob_to_clob; /
Comments
Post a Comment