Возможный обходной путь - использовать блоки PL / SQL:
DECLARE
xml VARCHAR2(32000) :=
'<theRange>
<theRow><First>Bob</First><Last>Smith</Last><Age>30</Age></theRow>
<theRow><First>Sue</First><Last>Jones</Last><Age>34</Age></theRow>
...
...
...
<theRow><First>Tom</First><Last>Anderson</Last><Age>39</Age></theRow>
<theRow><First>Ali</First><Last>Grady</Last><Age>45</Age></theRow>
</theRange>';
CURSOR C (p1 INTEGER, p2 INTEGER) IS
SELECT * FROM (
SELECT extractvalue(column_value, '/theRow/First') FIRST,
extractvalue(column_value, '/theRow/Last') LAST,
to_number(extractvalue(column_value, '/theRow/Age')) Age
FROM TABLE(XMLSequence(XMLTYPE(xml).extract('/theRange/theRow'))))
)
WHERE age BETWEEN p1 AND p2;
BEGIN
FOR R IN C (30,35) LOOP
dbms_output.put_line(R.First||', '||R.Last||', '||R.Age);
END LOOP;
END;
(полностью не проверено)
EDIT:
В качестве вставки вы можете попробовать:
DECLARE
xml VARCHAR2(32000) :=
'<theRange>
<theRow><First>Bob</First><Last>Smith</Last><Age>30</Age></theRow>
<theRow><First>Sue</First><Last>Jones</Last><Age>34</Age></theRow>
...
...
...
<theRow><First>Tom</First><Last>Anderson</Last><Age>39</Age></theRow>
<theRow><First>Ali</First><Last>Grady</Last><Age>45</Age></theRow>
</theRange>';
BEGIN
INSERT INTO temp_table(last,first,age)
SELECT last, first, age FROM (
SELECT extractvalue(column_value, '/theRow/First') FIRST,
extractvalue(column_value, '/theRow/Last') LAST,
to_number(extractvalue(column_value, '/theRow/Age')) Age
FROM TABLE(XMLSequence(XMLTYPE(xml).extract('/theRange/theRow'))))
)
WHERE age BETWEEN 30 AND 35;
END;