Hall Everybody,
I am using the XMLTABLE , following the blog:
https://oracle-base.com/articles/misc/xmltable-convert-xml-data-into-rows-and-columns-using-sql
I am having the following issue:
IF I store in the DB the following xml file:
<?xml version="1.0" encoding="UTF-8" ?><result xmlns:def="http://www.aaaa.int" xsi:type="def:result" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.aaaa.int"><filed1>vaulefiled1</field1></result>
then the below query is working:
SELECT xt.*
FROM aadba.xml_tab x,
XMLTABLE(
XMLNamespaces('http://www.aaaa.int' as "def", 'http://www.w3.org/2001/XMLSchema-instance' as "xsi"),
'/'
PASSING x.xml_data
COLUMNS
colum1 VARCHAR2(140) PATH '/result/field1',
) xt
I get the valuefield1 in a column.
Instead if I store in the DB the following xml file
<?xml version="1.0" encoding="UTF-8" ?><result xmlns:def="http://www.aaaa.int" xsi:type="def:result" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.aaaa.int"><filed1 xmlns="http://www.nato.aaaa.int">vaulefiled1</field1></result>
The previous query return null instead of valuefield1.
Could someone support me how to tune the sql command?
I am using Oracle DB 12c .
Regards