In order to insert more than 4000 characters into the BLOB field, I created 2 procedures:
CREATE OR REPLACE package body lob_pkg as
procedure lob_ins( nm_file in varchar2, nr_seq in number, p_text in raw) as begin insert into TB_FRAG values (nm_file, nr_seq, empty_blob() ) returning PCCF_BL_FRAG into g_blob; dbms_lob.write( g_blob,utl_raw.length(p_text), 1,p_text); end;
procedure add_more( p_text in raw ) as begin dbms_lob.writeappend( g_blob, utl_raw.length(p_text), p_text ); end;
So, in my program, first i make the call to the first procedure (lob_ins) and than from 4000 to 4000 characters i call recursively the second one, till all the characters have been appended to the blob.
The problem is that i'm getting the max open cursor error. I tried to set a higher number of cursors but it was no use. I want to know if there is some other way to insert stuff into the Blob field, or if there is something wrong with my procedures.