0
您好我已經插入我的SOAP XML內容到表名爲foo後,但我有問題,查詢內容。查詢XML表中插入SOAP XML內容
<?xml version="1.0" encoding="UTF-8" ?>
- <ns:AccountQueryPage_Output xmlns:ns="urn:crmondemand/ws/ecbs/account/">
- <ListOfAccount xmlns="urn:/crmondemand/xml/Account/Data" lastpage="true">
- <Account>
<Id>CCC-TEST01</Id>
<AccountName>John Smith Pty Ltd</AccountName>
</Account>
</ListOfAccount>
</ns:AccountQueryPage_Output>
我的查詢是
select xmltype(xml_response).extract('//AccountName/text()',
'xmlns:ns="urn:crmondemand/ws/ecbs/account/" ' ||
'xmlns="urn:/crmondemand/xml/Account/Data').getStringVal() from Foo
,我得到
ORA-31011: XML parsing failed
ORA-19213: error occurred in XML processing at lines 2
LPX-00209: PI names starting with XML are reserved
ORA-06512: at "SYS.XMLTYPE", line 272
ORA-06512: at line 1
31011. 00000 - "XML parsing failed"
*Cause: XML parser returned an error while trying to parse the document.
*Action: Check if the document to be parsed is valid.
任何幫助,以什麼即時做錯了什麼?
謝謝
@ruudvan
嗨ruudvan我想問問,如果ü知道如何從XML文件中提取的記錄數
即我要搶17680
親切的問候
Liem
感謝ruudvan會讓它變得非常感謝 – Leon
嗨,我可以替換精選的clob列的XML內容的硬編碼?例如用SUBQ AS(SELECT XMLTYPE(xml_response)AS my_xml FROM scott.foo)當我嘗試,我得到錯誤ORA-31011:XML解析失敗 ORA-19213:在XML處理髮生在線2 LPX-00209錯誤:首先是XML PI名是保留 ORA-06512:在 「SYS.XMLTYPE」,線路272 ORA-06512:在line 1 – Leon
什麼是場xml_response的數據類型?如果表中已經有xml,則不需要編寫該子查詢。只要'從SCOTT.foo中選擇列f,XMLTABLE(...通過f.xml_response列.....);'。確保xmlnamespaces和xpath相同或相應地更改查詢。 – ruudvan