我正在尝试从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>