我在弄清楚如何将命名空间集成到具有 xmlexists 的 where 子句时遇到问题。查询如下:
SELECT sing_d1.sing_info_text1, sing_d1.sing_info_text2
FROM XMLTABLE(
xmlnamespaces (
'http://www.abccompany.com/Canonical' AS "abc",
'http://abccompany.com/PmtInfo' AS "pmt",
'http://abccompany.com/CommonTypes' AS "cmn",
'http://www.w3.org/2001/XMLSchema-instance' AS "xsi"),
'/abc:abc/abc:Pmt/pmt:Payments/pmt:PayInfo/pmt:Single/pmt:SingAddInfo'
PASSING payXml
COLUMNS
sing_info_type VARCHAR2(4000)
PATH 'cmn:AddInfoCmpType',
sing_info_text1 VARCHAR2(4000)
PATH 'cmn:AddInfoCmpText[1]',
sing_info_text2 VARCHAR2(4000)
PATH 'cmn:AddInfoCmpText[2]'
)sing_d1
WHERE
XMLExists(
'/abc:abc/abc:Pmt/pmt:Payments/pmt:PayInfo/pmt:Single/pmt:SingAddInfo[AddInfoCmpType = "IATCode"]'
);
任何线索将不胜感激。