create table tq84_x(lpx number, c clob);
--
-- We have an ampersand in the insert statements…
-- … setting define off makes sure that this is not
-- interpreted as a variable.
--
set define off
begin
delete from tq84_x;
insert into tq84_x values ( 7.1, '<a>' );
insert into tq84_x values ( 7.2, ' ' );
insert into tq84_x values ( 210.1, 'x' );
insert into tq84_x values ( 225.1, '<a></b>' );
insert into tq84_x values ( 229.1, empty_clob() );
insert into tq84_x values ( 242.1, '<a>&</a>' );
insert into tq84_x values ( 243.1, '<a id=42/>' );
insert into tq84_x values ( 245.1, '<a></a>e' );
insert into tq84_x values ( 254.1, '<?xml version="1.0"><a/>'); -- Should be <?xml version="1.0"?>
insert into tq84_x values ( 0.0, null );
end;
/
select xmltype(c) from tq84_x where lpx = 7.1;
-- ORA-31011: XML parsing failed
-- ORA-19202: error in XML processing
-- LPX-00007: unexpected end-of-file encountered
select xmltype(c) from tq84_x where lpx = 7.2;
-- ORA-31011: XML parsing failed
-- ORA-19202: error in XML processing
-- LPX-00007: unexpected end-of-file encountered
select xmltype(c) from tq84_x where lpx = 229.1;
-- ORA-31011: XML parsing failed
-- ORA-19202: error in XML processing
-- LPX-00229: input source is empty