I want to write the CLOBs to files.
Using UTL_FILE...is there anyway to avoid newline --- so that the
file size = LOB length ?
If not, is there another option ?
thanks
UTL_FILE.PUT() does not append newline characters, just make sure you
do not write more than the buffer size specified to UTL_FILE.FOPEN()
without flushing with UTL_FILE.FFLUSH(). For example,
declare
f UTL_FILE.FILE_TYPE;
cpos pls_integer := 1;
begin
f := utl_file.fopen('SOMEDIR', 'somefile.xml', 'w' , 16386);
while cpos < dbms_lob.getlength(:clob) loop
utl_file.put(f,dbms_lob.substr(:clob, 16386, cpos));
cpos := cpos + 16386;
utl_file.fflush(f);
end loop;
utl_file.fclose(f);
end;
Hth,
Vladimir M. Zakharychev
N-Networks, makers of Dynamic PSP(tm)
http://www.dynamicpsp.com