Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
OracleXMLTable函数和XPATH_Oracle_Xquery - Fatal编程技术网

OracleXMLTable函数和XPATH

OracleXMLTable函数和XPATH,oracle,xquery,Oracle,Xquery,我在xml类型表中存储了以下xml文档 <?xml version="1.0" encoding="utf-8"?> <Document xmlns="urn:iso:std:iso:200:tech:xsd:101" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <FIToFICstmrCdtTrf xmlns="urn:iso:std:iso:200:tech:xsd:101">

我在xml类型表中存储了以下xml文档

<?xml version="1.0" encoding="utf-8"?>
<Document xmlns="urn:iso:std:iso:200:tech:xsd:101" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <FIToFICstmrCdtTrf xmlns="urn:iso:std:iso:200:tech:xsd:101">
                            <CreditTx>
                <PaymentID>
                    <InstrumentId>AAB000001</InstrumentId>
                    <Id>4730 2013-10-23 AAB000001</Id>
                    <TranxId>BULKTTXTDAAB000001</TranxId>
                </PaymentID>
            </CreditTx>
        </FIToFICstmrCdtTrf>
</Document>
即使xpath是正确的,我也没有得到任何结果。对于

对于/Document/fitoficstmrcdtrf/CreditTx/PaymentID返回$i中的$i

您必须将文档作为

一美元 doc(“/your/path/your.xml”)/Document/FIToFICstmrCdtTrf/CreditTx/PaymentID 返回$i

了解资源的位置很重要,即/your/path/your.xml


我希望这对您有所帮助。

您需要注册XML名称空间。对不起,您能详细说明一下吗
SELECT payments.instrumentid,
payments.id,
payments.tranxid
FROM paymentxml,
XMLTable('for $i in /Document/FIToFICstmrCdtTrf/CreditTx/PaymentID
return $i'
PASSING OBJECT_VALUE
COLUMNS
instrumentid VARCHAR2(20) PATH 'InstrumentId' ,
id VARCHAR2(20) PATH 'Id' ,
tranxid VARCHAR2(20) PATH 'TranxId'
)payments