XMLQuery-ORA-01706:用户函数结果值太大错误

时间:2019-02-19 23:20:24

标签: plsql

我正在尝试从xml检索数据值。通常正常。但是,如果xml大小较大,则会导致用户函数结果值过大错误。 有什么方法可以修改查询以避免错误? Oracle版本:12.1.0.2.0

示例查询:

FOR phone IN (SELECT ExtractValue(Value(p),'/telephoneLine/telephoneNumber/text()') as telephoneNumber
              ,XMLQUERY('string-join(/telephoneLine/serviceCode/serviceCode/text(),",")' PASSING Value(p) RETURNING CONTENT).getStringVal() as serviceCodes
                FROM   TABLE(XMLSequence(Extract(I_XML,'teleResponse/telephoneLine'))) p)
LOOP

    do the persist logic...

END LOOP;

示例XML:

<teleResponse>
    <telephoneLine>
        <telephoneNumber>4052087862</telephoneNumber>
        <status>AC</status>
        <serviceCode>
            <quantity>1</quantity>
            <serviceCode>BCONULD</serviceCode>
            <serviceStatus>A</serviceStatus>
        </serviceCode>
        <serviceCode>
            <quantity>1</quantity>
            <serviceCode>BNONPUB</serviceCode>
            <serviceStatus>A</serviceStatus>
        </serviceCode>
        <serviceCode>
            <quantity>1</quantity>
            <serviceCode>HUM</serviceCode>
            <serviceStatus>A</serviceStatus>
        </serviceCode>
        ......
        ......
        ......
        ......
        <serviceCode>
            <quantity>1</quantity>
            <serviceCode>HUX</serviceCode>
            <serviceStatus>A</serviceStatus>
        </serviceCode>
    </telephoneLine>
</teleResponse>

0 个答案:

没有答案