Explain Plan Window does not support XQuery

puchtec

Member²
I tried to get the explain plan from a SQL statement like:

SELECT XMLQuery('for $i in /test_list
return
{xs:integer(fn:sum($i/val))}
'
PASSING test_xml
RETURNING CONTENT)
FROM xml_test;

but I get an error "ORA-19100: PASSING or RETURNING keyword expected" - but the statements runs well in the SQL Window.

Any idea :confused: ?!?
 
What happens if you execute the following in a SQL Window?

explain plan for
SELECT XMLQuery('for $i in /test_list
return
{xs:integer(fn:sum($i/val))}
'
PASSING test_xml
RETURNING CONTENT)
FROM xml_test;
 
This works fine. If afterwards I run
Code:
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY());
I get a correct execution plan.

You can use this code to create the sample table:

Code:
CREATE TABLE xml_test(test_xml XMLTYPE);
INSERT INTO xml_test VALUES (XMLTYPE('<test_list><val>1</val><val>2</val></test_list>'));
COMMIT;
 
Back
Top