I have a data stored in as HTML table as CLOB type in a table, I had tried to parse it like below with reference from Parse HTML table with Oracle
with tbl as
(
SELECT ROW_ID,xmltype(SUBSTR(qe.NOTE, 0, INSTR(qe.NOTE, '<br>')-1)) xml_data
FROM MY_Table qe
WHERE EVENT='note'
)
select
ROW_ID,rtrim (xmlagg (xmlelement (e, x.data
|| '|')
ORDER BY x.row_number).extract ('//text()'), '|') AS Data
from
tbl
cross join
xmltable('/table/tr'
passing tbl.xml_data
columns
row_number FOR ORDINALITY,
data varchar2(2000) path 'td[1]'
) x
WHERE x.data IS NOT NULL
GROUP BY ROW_ID
the above is working for some values but it is breaking giving the error ORA-06502: PL/SQL: numeric or value error ORA-06512: at "SYS.XMLTYPE", line 272 as said in that reference itself We can try parsing an HTML file using a XML parser, but it’s likely to fail. The reason is that HTML documents can have the following HTML features that XML parsers don’t understand. -- https://stackoverflow.com/a/32573619/266304
Is there a HTML parser in Oracle instead of XML Parser, I had tried to search but nothing worked out
Anyone please help