Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> XML File to CLOB and Display it
<10gR2>
I want to read a XML file into CLOB and display the (CLOB) content.
Keeps erroring at line#14: string buffer too small
Can you pls help ?
thanks
DECLARE
l_xmlclob CLOB := EMPTY_CLOB; l_bfile bfile; l_buffer VARCHAR2(100); l_amount NUMBER := 100 ; l_pos NUMBER := 1;
dbms_lob.fileopen(l_bfile); dbms_lob.loadfromfile(l_xmlclob,l_bfile,dbms_lob.getlength(l_bfile)); dbms_lob.fileclose(l_bfile); LOOP DBMS_LOB.READ(l_xmlclob, l_amount, l_pos, l_buffer); -- error here dbms_output.put_line(l_buffer); l_pos := l_pos + l_amount;
WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.PUT_LINE('End of Chapter Reached.');END; Received on Wed Dec 20 2006 - 18:45:23 CST