需要从xml解析到db2

时间:2016-05-20 13:03:16

标签: xml db2

我正在尝试解析XML中的数据。我需要kasi标签

SELECT
    ID, woId, kasi, XMLNOTIFICATION, XMLPDARESPONSE
FROM
    (
        SELECT
            ID,
            CAST( XML2CLOB(xmlquery(
                'declare namespace ns2="http://www.it.ibm.com/namespaces/rsl/amm/wo/commonWO"; $XMLNOTIFICATION/ns2:woOut/woOutput/header/woId/text()'
            )) AS VARCHAR(100) ) AS WOID,
             CAST( XML2CLOB(xmlquery(
                'declare namespace ns2="http://www.it.ibm.com/namespaces/rsl/amm/wo/commonWO"; $XMLNOTIFICATION/ns2:woOut/woOutput/woExececutionResults/electricityMeterInstallation/additionalInstallationData/kapiKasi.kasi/text()'
--       /kasi/text()'
            )) AS VARCHAR(100) ) AS KASI,
            XMLNOTIFICATION, XMLPDARESPONSE
        FROM
            WOP.BUNDLE_WORK_ORDER
        WHERE
            XMLNOTIFICATION IS NOT NULL
        AND REFERENCEPREFIX = 1
        AND REFERENCENUMBER = ('561527801')
    )
WHERE
    WOID in ('EXT561527801')

xml文件是附加的 enter image description here

0 个答案:

没有答案