Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XML PARSING FAILED

637494May 5 2008 — edited May 6 2008
Hi,
i hv a procedure to[b] read a xml file from a location in server. i need to read it and insert the xml in the oracle tables.i am using utl_file utility to read the xml file but when i am inserting it i am getting the error as follows..

MY PROCEDURE IS

create or replace
procedure BT_CPE_XML_READ

IS
input_file utl_file.file_type;
input_buffer CLOB;
xml_input_buffer xmltype;
begin
-- C:\orac\PROD\db\tech_st\10.2.0\plsql\temp
input_file := utl_file.fopen ('C:\orac\PROD\db\tech_st\10.2.0\plsql\temp','\test.xml', 'R');

utl_file.get_line (input_file, input_buffer);
dbms_output.put_line(input_buffer);
--select XMLTYPE(input_buffer,null,1,1) into xml_input_buffer from dual;
select XMLTYPE(input_buffer) into xml_input_buffer from dual;
--insert into XML_DATA_TAB(XML_DATA) values(xml_input_buffer);
--dbms_output.put_line(input_buffer);
utl_file.fclose(input_file);

--exception
-- when others then null;
exception when others then
dbms_output.put_line(sqlcode||''||sqlerrm);
end;


MY ERROR IS
Connecting to the database .
<?xml version = '1.0'?>
-31011ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00007: unexpected end-of-file encountered
ORA-06512: at "SYS.XMLTYPE", line 254
ORA-06512: at line 1
Process exited.
Disconnecting from the database
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 3 2008
Added on May 5 2008
6 comments
1,152 views