DBMS_XMLQUERY : Invalid context handle specified
Hello,
Here is the simple code :
set serveroutput on;
declare
str_sql VARCHAR2(200) := ' (select * from dual) ';
res_xml CLOB;
v_context DBMS_XMLQUERY.ctxtype;
begin
v_context := DBMS_XMLQUERY.newcontext (str_sql);
res_xml := DBMS_XMLQUERY.getxml (v_context);
DBMS_OUTPUT.PUT_LINE('res_xml : ' || res_xml);
DBMS_XMLQUERY.closecontext (v_context);
end;
/
I had recently install a 11.2.0.4 Oracle Database and I got this exception : <ERROR>oracle.xml.sql.OracleXMLSQLException: Descripteur de contexte indiqué non valide.</ERROR>
When I replace the query by this : 'select * from dual' I get the result (OK) :
res_xml : <?xml version = '1.0'?>