create or replace directory D_OUTPUT as 'E:\tep'; Declare lobloc Clob; amount Int := 0; offset Int := 1; buffer Varchar2(2000) := ''; handle utl_file.file_type; Begin Select Resume_context Into lobloc From lob_example Where Id = &Id; amount := dbms_lob.getlength(lobloc); dbms_lob.read(lobloc,amount,offset,buffer); handle := utl_file.fopen('D_OUTPUT','a.xml','w',2000); utl_file.put_line(handle,buffer); utl_file.fclose(handle); End;
lobloc Clob;
amount Int := 0;
offset Int := 1;
buffer Varchar2(2000) := '';
handle utl_file.file_type;
Begin
Select Resume_context Into lobloc From lob_example
Where Id = &Id;
amount := dbms_lob.getlength(lobloc);
dbms_lob.read(lobloc,amount,offset,buffer);
handle := utl_file.fopen('D_OUTPUT','a.xml','w',2000);
utl_file.put_line(handle,buffer);
utl_file.fclose(handle);
End;